check obd data timestamp validity (skip ci because of previous mysql errors) [skip ci]
This commit is contained in:
parent
9648cd5fc4
commit
14ba7778d7
|
|
@ -146,7 +146,7 @@ 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 != 1683){
|
||||
if(shared_message->w_angle_value != 1683 && (now/1000 - shared_message->w_angle_timestamp) <= 1){
|
||||
bvc_hf->steeringWheelAngle = calloc(1, sizeof(SteeringWheelAngle_t));
|
||||
bvc_hf->steeringWheelAngle->steeringWheelAngleValue = shared_message->w_angle_value;
|
||||
bvc_hf->steeringWheelAngle->steeringWheelAngleConfidence = 1;
|
||||
|
|
@ -154,7 +154,7 @@ static int mk_cam(facilities_t* facilities, uint8_t *cam_oer, uint32_t *cam_len)
|
|||
// still missing temperature; where is de_temperature ?
|
||||
|
||||
// Acceleration Control (encondig failure)
|
||||
if(shared_message->b_pedal_value != 1683 && shared_message->s_pedal_value != 1683){
|
||||
if(shared_message->b_pedal_value != 1683 && shared_message->s_pedal_value != 1683 && (now/1000 - shared_message->b_pedal_timestamp) <= 1 && (now - shared_message->s_pedal_timestamp) <= 1){
|
||||
if(shared_message->b_pedal_value)
|
||||
ac = ac | 0x80;
|
||||
if(shared_message->s_pedal_value)
|
||||
|
|
@ -249,7 +249,7 @@ 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 != 1683){
|
||||
if(shared_message->lights_value != 1683 && (now/1000 - shared_message->lights_timestamp) <= 1){
|
||||
if(shared_message->lights_value)
|
||||
el = el | 0x80;
|
||||
bvc_lf->exteriorLights.buf = malloc(sizeof(uint8_t));
|
||||
|
|
|
|||
Loading…
Reference in New Issue