跳转至

V2X API

车路协同通信接口。
Vehicle-to-everything communication interfaces.


GetV2XInfo

获得对应车辆编号V2X中的UPER编码之后的v2x消息.
Retrieve V2X Message After UPER Encoding for the Corresponding Vehicle Identifier in V2X.

bool GetV2XInfo(const char *mainVehicleId, const char *sensorId, int infoType, SimOne_Data_V2XNFS *pDetections)

参数 Parameters:

名称 类型 说明
mainVehicleId const char * 主车的ID
Id of the main vehicle
sensorId const char * OBU传感器ID
OBU sensor Id
infoType int OBU消息类型 enum ESimOne_V2X_MessageFrame_PR type of the obu message witch matches with enum ESimOne_V2X_MessageFrame_PR
pDetections SimOne_Data_V2XNFS * V2XASN信息 V2XASN data

返回值 Returns:

类型 说明
bool 如果成功获取到V2XASN信息,则返回true,否则返回false
Returns true if the V2XASN data is successfully retrieved, false otherwise

SetV2XInfoUpdateCB

获得对应车辆编号V2X中的UPER编码之后的v2x消息更新回调.
Callback for Updates on V2X Messages After UPER Encoding for the Corresponding Vehicle Identifier in V2X

bool SetV2XInfoUpdateCB(void(*cb)(const char *mainVehicleId, const char *sensorId, SimOne_Data_V2XNFS *pDetections))

参数 Parameters:

名称 类型 说明
cb void(*)(const char *mainVehicleId, const char *sensorId, SimOne_Data_V2XNFS *pDetections) 通过V2X中对应车辆编号获取V2X中的UPER编码之后的v2x消息的回调
Callback function for getting the UPER ASN message by the corresponding traffic-vehicle identifier in V2X

返回值 Returns:

类型 说明
bool 如果注册回调函数成功,则返回true,否则返回false
Returns true if the callback registration is successful, false otherwise.