Function SimOneAPI::SetScenarioEventCB

Function Documentation

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

场景事件回调

Register the callback for scenario events.

此函数用于注册场景事件的回调函数,允许处理如命令或事件类型的消息

This function is used to register a callback function for scenario events, allowing for handling messages such as commands or events.

参数:

cb -- [in]

场景事件回调函数,函数签名为:

void callback(const char* source, const char* target, const char* type, const char* content)

  • source: 发送消息的车辆ID / ID of the vehicle sending the message

  • target: 接收消息的车辆ID / ID of the vehicle receiving the message

  • type: 消息类型,如"Command"或"Event" / The type of message, such as "Command" or "Event"

  • content: 消息内容 / The content of the message

返回:

如果注册回调函数成功,则返回true,否则返回false

Returns true if the callback registration is successful, false otherwise.