I have developed a vehicleio-plugin for vehicleio to send and receive can-messages.
Receive and parse can-messages from the car perform good.
But I found some problems in sending different can-messages with different cycle-time.
In driveworks9.0, the api for send-command through vehicleio-plugin is:
dwStatus _dwVehicleIODriver_sendCommand(const dwVehicleIOCommand* cmd, dwSensorHandle_t sensor)
And that would cause a problem if I want to transform cmd into several different can_message, especailly when I have to send them with different cycle-time.
for example, the implements of send in sample:
dwStatus _dwVehicleIODriver_sendCommand(const dwVehicleIOCommand* cmd,
dwStatus result = DW_SUCCESS;
status = dwCANInterpreter_createMessageFromName(&msgCAN, GENERIC_MSG_STEERING_CMD, gIntp); checkError(result, status, "create steering message failed"); status = encodeSteering(msgCAN, cmd); checkError(result, status, "encode steering failed"); status = dwSensorCAN_sendMessage(&msgCAN, 1000000, sensor); checkError(result, status, "send steering failed"); return result;
if I want to transform the dwVehicleIOCommand into several messages, is there any recommended way?
I noticed in dw10.0, the apis have been different, which goes as following:
typedef dwStatus(* dwSensorCANPlugin_send) (const dwCANMessage *msg, dwTime_t timeout_us, dwSensorPluginSensorHandle_t sensor)
this makes it easier to send different messages,give our developers more control ability.
but I wouldn’t like to upgrade the system.