Microseconds tolling timestamps for test results

This commit is contained in:
emanuel 2022-02-17 12:45:24 +00:00
parent f17838cdca
commit e2c3dcd906
1 changed files with 10 additions and 2 deletions

View File

@ -34,7 +34,11 @@ int tpm_pay(void* fc, uint8_t* neighbour) {
facilities_t* facilities = (facilities_t*) fc;
tolling_s* tolling = (tolling_s*) &facilities->tolling;
tolling->tz = it2s_tender_get_clock(&facilities->epv) ;
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;
pthread_mutex_unlock(&facilities->epv.time.lock);
TransportRequest_t* tr = NULL;
SecurityRequest_t* sreq = NULL;
@ -469,7 +473,11 @@ int tpm_recv(void* fc, TPM_t* tpm_rx, uint8_t* neighbour) {
syslog_debug("[facilities] [tolling] received TPM.reply, ignoring");
goto cleanup;
}
syslog_info("[facilities] [tolling] reply took %ld ms", it2s_tender_get_clock(&facilities->epv) - tolling->tz);
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;
pthread_mutex_unlock(&facilities->epv.time.lock);
veh_handle_recv(tolling, tpm_rx, neighbour);
break;