diff --git a/src/config.c b/src/config.c index 897518b..b82e3c9 100644 --- a/src/config.c +++ b/src/config.c @@ -495,7 +495,6 @@ int facilities_config() { } } - itss_epv_init(); facilities.edm.enabled = itss_cfg->applications.extensions.enabled; @@ -503,7 +502,6 @@ int facilities_config() { mreq->present = EIS_ManagementRequest_PR_attributes; mreq->choice.attributes.present = EIS_ManagementRequestAttributes_PR_get; mreq->choice.attributes.choice.get.clockType = 1; - mreq->choice.attributes.choice.get.clock = 1; mreq->choice.attributes.choice.get.clockOffset = 1; void* management_socket = itss_0connect(facilities.zmq.management_address, ZMQ_REQ); uint8_t b_tx[256], b_rx[256]; @@ -523,11 +521,10 @@ int facilities_config() { if (mrep->returnCode == EIS_ManagementReplyReturnCode_accepted && mrep->data && mrep->data->choice.attributes.clockType && - mrep->data->choice.attributes.clock && mrep->data->choice.attributes.clockOffset) { - epv.time.type = *mrep->data->choice.attributes.clockType; - asn_INTEGER2uint64(mrep->data->choice.attributes.clock, &epv.time.clock); + itss_epv_init(*mrep->data->choice.attributes.clockType, TIME_MILLISECONDS); + asn_INTEGER2uint64(mrep->data->choice.attributes.clockOffset, &epv.time.offset); } else { log_error("rejected MR attribute request"); @@ -537,6 +534,7 @@ int facilities_config() { ASN_STRUCT_FREE(asn_DEF_EIS_ManagementRequest, mreq); ASN_STRUCT_FREE(asn_DEF_EIS_ManagementReply, mrep); + if (etsi_its_cfg->facilities.saem.activate) { // TODO handle various services facilities.bulletin.to_provide_len = 1; facilities.bulletin.to_provide[0] = calloc(1, sizeof(announcement_t));