Function SimOneAPI::ReceiveRouteMessageCB
Defined in File SimOneServiceAPI.h
Function Documentation
-
bool SimOneAPI::ReceiveRouteMessageCB(void (*cb)(int fromId, ESimOne_Client_Type fromType, int length, const void *pBuffer, int commandId))
节点通信数据接收API
Node communication data receiving API.
该函数用于注册回调,以从其他节点接收数据
This function is used to register a callback to receive data from other nodes.
- 参数:
cb -- [in]
回调函数,用于处理接收到的数据,函数签名为:
void callback(int fromId, ESimOne_Client_Type fromType, int length, const void* pBuffer, int commandId)
fromId: 发送方节点的ID / ID of the sending node
fromType: 发送方节点的类型 / Type of the sending node
length: 接收到的数据长度 / Length of the received data
pBuffer: 接收到的数据缓冲区 / Buffer containing the received data
commandId: 命令ID(当前未使用)/ Command ID (not in use currently)
- 返回:
成功返回true,失败返回false
Returns true if successful, false otherwise.