Skip to content

信号与事件 Signals & Events


SetSignalLights

bool SetSignalLights(const char *mainVehicleId, SimOne_Data_Signal_Lights *pSignalLights)

设置车辆信号灯状态
Set signal lights for the vehicle.

Parameters:

名称 类型 说明
mainVehicleId const char * 主车的ID
Id of the main vehicle.
pSignalLights SimOne_Data_Signal_Lights * 车辆信号灯数据
Vehicle signal light data.

Returns:

类型 说明
bool 如果信号灯状态设置成功,则返回true,否则返回false
Returns true if the signal light status is successfully set, false otherwise.

SetVehicleEvent

bool SetVehicleEvent(const char *mainVehicleId, SimOne_Data_Vehicle_EventInfo *pVehicleEvent)

设置主车预警消息
Set vehicle event information.

Parameters:

名称 类型 说明
mainVehicleId const char * 主车的ID
Id of the main vehicle.
pVehicleEvent SimOne_Data_Vehicle_EventInfo * 车辆事件信息数据
Vehicle event information data.

Returns:

类型 说明
bool 如果事件信息设置成功,则返回true,否则返回false
Returns true if the event information is successfully set, false otherwise.

SetScenarioEventCB

bool SetScenarioEventCB(void(*cb)(const char *source, const char *target, const char *type, const char *content))

场景事件回调
Register the callback for scenario events.

Parameters:

名称 类型 说明
cb void(*)(const char *source, const char *target, const char *type, const char *content) 场景事件回调函数
Scenario event callback function.

Returns:

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