Fix previous commit

This commit is contained in:
emanuel 2022-02-17 16:41:58 +00:00
parent e2c3dcd906
commit dd1c494fe8
1 changed files with 2 additions and 6 deletions

View File

@ -35,9 +35,7 @@ int tpm_pay(void* fc, uint8_t* neighbour) {
tolling_s* tolling = (tolling_s*) &facilities->tolling;
pthread_mutex_lock(&facilities->epv.time.lock);
facilities->epv.time.resolution = TIME_MICROSECONDS;
tolling->tz = it2s_tender_get_time(&facilities->epv) ;
facilities->epv.time.resolution = TIME_MILLISECONDS;
tolling->tz = it2s_tender_get_now(TIME_MICROSECONDS) ;
pthread_mutex_unlock(&facilities->epv.time.lock);
TransportRequest_t* tr = NULL;
@ -474,9 +472,7 @@ int tpm_recv(void* fc, TPM_t* tpm_rx, uint8_t* neighbour) {
goto cleanup;
}
pthread_mutex_lock(&facilities->epv.time.lock);
facilities->epv.time.resolution = TIME_MICROSECONDS;
syslog_info("[facilities] [tolling] reply took %ld us", it2s_tender_get_time(&facilities->epv) - tolling->tz);
facilities->epv.time.resolution = TIME_MILLISECONDS;
syslog_info("[facilities] [tolling] reply took %ld us", it2s_tender_get_now(TIME_MICROSECONDS) - tolling->tz);
pthread_mutex_unlock(&facilities->epv.time.lock);
veh_handle_recv(tolling, tpm_rx, neighbour);
break;