add cam parameters init, still needs mem alloc
This commit is contained in:
parent
30903efa5a
commit
e9dfc7764f
13
src/cam.c
13
src/cam.c
|
|
@ -122,8 +122,17 @@ static int mk_cam(facilities_t* facilities, uint8_t *cam_oer, uint32_t *cam_len)
|
||||||
if(shared_message == MAP_FAILED)
|
if(shared_message == MAP_FAILED)
|
||||||
syslog_err("[facilities] failed to map CAN shared memory\n");
|
syslog_err("[facilities] failed to map CAN shared memory\n");
|
||||||
|
|
||||||
// process and fill fields here
|
// process and fill fields here, still need to alloc mem for optional
|
||||||
|
cam->cam.camParameters.highFrequencyContainer.choice.basicVehicleContainerHighFrequency.speed.speedValue = shared_message->speed_value;
|
||||||
|
//cam->cam.camParameters.lowFrequencyContainer->choice.basicVehicleContainerLowFrequency.exteriorLights = shared_message->lights_value;
|
||||||
|
cam->cam.camParameters.highFrequencyContainer.choice.basicVehicleContainerHighFrequency.steeringWheelAngle->steeringWheelAngleValue = shared_message->w_angle_value;
|
||||||
|
|
||||||
|
/*if(shared_message->b_pedal_value)
|
||||||
|
cam->cam.camParameters.highFrequencyContainer.choice.basicVehicleContainerHighFrequency.accelerationControl = 0;
|
||||||
|
else if(shared_message->s_pedal_value)
|
||||||
|
cam->cam.camParameters.highFrequencyContainer.choice.basicVehicleContainerHighFrequency.accelerationControl = 1;
|
||||||
|
*/
|
||||||
|
|
||||||
munmap(shared_message, sizeof(can_values_shm));
|
munmap(shared_message, sizeof(can_values_shm));
|
||||||
if(close(shm_fd) == -1)
|
if(close(shm_fd) == -1)
|
||||||
syslog_err("[facilities] failed to close CAN shared memory\n");
|
syslog_err("[facilities] failed to close CAN shared memory\n");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue