Init tolling OBU starting type

This commit is contained in:
emanuel 2022-06-15 12:25:32 +01:00
parent 0e0117288f
commit 431d834e5c
3 changed files with 10 additions and 3 deletions

View File

@ -795,7 +795,7 @@ int main() {
pthread_create(&facilities.sa_service, NULL, sa_service, (void*) &facilities); pthread_create(&facilities.sa_service, NULL, sa_service, (void*) &facilities);
// Tolling // Tolling
tolling_init(&facilities.tolling, facilities.zmq.ctx, facilities.zmq.security_address); tolling_init(&facilities.tolling, facilities.zmq.ctx, facilities.zmq.security_address, facilities.station_type);
// PC // PC
if (facilities.coordination.active) if (facilities.coordination.active)

View File

@ -1093,7 +1093,14 @@ int tpm_recv(void* fc, TPM_t* tpm_rx, void* security_socket, uint8_t* neighbour,
return 0; return 0;
} }
int tolling_init(tolling_t* tolling, void* zmq_ctx, char* security_address) { int tolling_init(tolling_t* tolling, void* zmq_ctx, char* security_address, uint8_t station_type) {
switch (station_type) {
case 15:
break;
default:
tolling->station.obu.toll_type = -1;
break;
}
return 0; return 0;
} }

View File

@ -60,7 +60,7 @@ typedef struct tolling {
* @param security_address The security service ZMQ address * @param security_address The security service ZMQ address
* @return Always successful * @return Always successful
*/ */
int tolling_init(tolling_t* tolling, void* zmq_ctx, char* security_address); int tolling_init(tolling_t* tolling, void* zmq_ctx, char* security_address, uint8_t station_type);
int tpm_pay(void* fc, tolling_info_t* info, void* security_socket, uint8_t* neighbour, uint8_t* dst_addr); int tpm_pay(void* fc, tolling_info_t* info, void* security_socket, uint8_t* neighbour, uint8_t* dst_addr);
int tpm_recv(void* fc, TPM_t* tpm_rx, void* security_socket, uint8_t* neighbour, uint8_t* src_addr); int tpm_recv(void* fc, TPM_t* tpm_rx, void* security_socket, uint8_t* neighbour, uint8_t* src_addr);