This commit is contained in:
David Rocha 2022-01-20 15:32:12 +00:00
parent f4f9ab8359
commit 0b187d19b2
1 changed files with 8 additions and 7 deletions

View File

@ -145,20 +145,20 @@ static int mk_cam(facilities_t* facilities, uint8_t *cam_oer, uint32_t *cam_len)
// bvc_hf_speed.speedConfidence = 1;
// Steering Wheel Angle
if(shared_message->w_angle_value != -1){
bvc_hf->steeringWheelAngle = malloc(sizeof(SteeringWheelAngle_t));
if(shared_message->w_angle_value != 1683){
bvc_hf->steeringWheelAngle = calloc(1, sizeof(SteeringWheelAngle_t));
bvc_hf->steeringWheelAngle->steeringWheelAngleValue = shared_message->w_angle_value;
bvc_hf->steeringWheelAngle->steeringWheelAngleConfidence = 1;
}
// still missing temperature; where is de_temperature ?
// Acceleration Control
if(shared_message->b_pedal_value != -1 && shared_message->s_pedal_value != -1){
// Acceleration Control (encondig failure)
if(shared_message->b_pedal_value != 1683 && shared_message->s_pedal_value != 1683){
if(shared_message->b_pedal_value)
ac = ac | 0x01;
if(shared_message->s_pedal_value)
ac = ac | 0x02;
bvc_hf->accelerationControl = malloc(sizeof(AccelerationControl_t));
bvc_hf->accelerationControl = calloc(1, sizeof(AccelerationControl_t));
bvc_hf->accelerationControl->buf = malloc(sizeof(uint8_t));
memcpy(bvc_hf->accelerationControl->buf, &ac, 1);
bvc_hf->accelerationControl->size = 1;
@ -248,9 +248,9 @@ static int mk_cam(facilities_t* facilities, uint8_t *cam_oer, uint32_t *cam_len)
uint8_t el = 0x00;
// Exterior Lights
if(shared_message->lights_value != -1){
if(shared_message->lights_value != 1683){
if(shared_message->lights_value)
el = el | 0x01;
el = el | 0x80;
bvc_lf->exteriorLights.buf = malloc(sizeof(uint8_t));
memcpy(bvc_lf->exteriorLights.buf, &el, 1);
bvc_lf->exteriorLights.size = 1;
@ -379,6 +379,7 @@ lightship_t* lightship_init() {
lightship->use_obd = 0;
}
else{
syslog_debug("[facilities] obd shmem found\n");
lightship->use_obd = 1;
close(shm_fd);
}