CPM integration with initial dissemination control functions
This commit is contained in:
parent
03ffda2d92
commit
4d5d859453
|
|
@ -6,6 +6,7 @@ ADD_EXECUTABLE(it2s-itss-facilities
|
||||||
infrastructure.c
|
infrastructure.c
|
||||||
requests.c
|
requests.c
|
||||||
facilities.c
|
facilities.c
|
||||||
|
cpm.c
|
||||||
)
|
)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(it2s-itss-facilities
|
TARGET_LINK_LIBRARIES(it2s-itss-facilities
|
||||||
|
|
@ -19,6 +20,7 @@ TARGET_LINK_LIBRARIES(it2s-itss-facilities
|
||||||
-lit2s-asn-camv2
|
-lit2s-asn-camv2
|
||||||
-lit2s-asn-ivim
|
-lit2s-asn-ivim
|
||||||
-lit2s-asn-denmv2
|
-lit2s-asn-denmv2
|
||||||
|
-lit2s-asn-cpm
|
||||||
-lm
|
-lm
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,11 @@ int facilities_config(void* facilities_s) {
|
||||||
facilities->infrastructure->replay_interval = config->facilities.ivim.replay_interval;
|
facilities->infrastructure->replay_interval = config->facilities.ivim.replay_interval;
|
||||||
facilities->infrastructure->default_service_duration = config->facilities.ivim.default_service_duration * 60000;
|
facilities->infrastructure->default_service_duration = config->facilities.ivim.default_service_duration * 60000;
|
||||||
|
|
||||||
|
//CPM
|
||||||
|
facilities->dissemination->active = config->facilities.cpm.activate;
|
||||||
|
facilities->dissemination->T_GenCpmMin = config->facilities.cpm.rsu_obu_period_min;
|
||||||
|
facilities->dissemination->T_GenCpmMax = config->facilities.cpm.rsu_obu_period_max;
|
||||||
|
|
||||||
// Replay
|
// Replay
|
||||||
facilities->replay = config->networking.replay.activate;
|
facilities->replay = config->networking.replay.activate;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "denm.h"
|
#include "denm.h"
|
||||||
#include "requests.h"
|
#include "requests.h"
|
||||||
|
#include "cpm.h"
|
||||||
|
|
||||||
#include <itss-transport/BTPDataRequest.h>
|
#include <itss-transport/BTPDataRequest.h>
|
||||||
#include <itss-transport/BTPDataIndication.h>
|
#include <itss-transport/BTPDataIndication.h>
|
||||||
|
|
@ -16,6 +17,9 @@
|
||||||
#include <camv2/CAM.h>
|
#include <camv2/CAM.h>
|
||||||
#include <denmv2/DENM.h>
|
#include <denmv2/DENM.h>
|
||||||
#include <ivim/IVIM.h>
|
#include <ivim/IVIM.h>
|
||||||
|
#include <cpm/CPM.h>
|
||||||
|
#include <cpm/INTEGER.h>
|
||||||
|
#include <cpm/asn_application.h>
|
||||||
|
|
||||||
#include <it2s-btp.h>
|
#include <it2s-btp.h>
|
||||||
|
|
||||||
|
|
@ -74,6 +78,12 @@ static int transport_indication(facilities_t *facilities, void* responder, uint8
|
||||||
its_msg = calloc(1, sizeof(IVIM_t));
|
its_msg = calloc(1, sizeof(IVIM_t));
|
||||||
handled_msg = true;
|
handled_msg = true;
|
||||||
break;
|
break;
|
||||||
|
case Port_cpm:
|
||||||
|
its_msg_descriptor = &asn_DEF_CPM;
|
||||||
|
its_msg = calloc(1, sizeof(CPM_t));
|
||||||
|
handled_msg = true;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
syslog_debug("[facilities] messsage with unhandled BTP port received, ignoring");
|
syslog_debug("[facilities] messsage with unhandled BTP port received, ignoring");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
@ -376,6 +386,7 @@ int main() {
|
||||||
|
|
||||||
facilities.zmq.ctx = zmq_ctx_new();
|
facilities.zmq.ctx = zmq_ctx_new();
|
||||||
facilities.lightship = lightship_init();
|
facilities.lightship = lightship_init();
|
||||||
|
facilities.dissemination = dissemination_init();
|
||||||
facilities.tx_queue = queue_init();
|
facilities.tx_queue = queue_init();
|
||||||
facilities.den = calloc(1, sizeof(den_t));
|
facilities.den = calloc(1, sizeof(den_t));
|
||||||
facilities.infrastructure = calloc(1, sizeof(infrastructure_t));
|
facilities.infrastructure = calloc(1, sizeof(infrastructure_t));
|
||||||
|
|
@ -402,6 +413,9 @@ int main() {
|
||||||
// Infrastructure
|
// Infrastructure
|
||||||
pthread_create(&facilities.infrastructure_service, NULL, infrastructure_service, (void*) &facilities);
|
pthread_create(&facilities.infrastructure_service, NULL, infrastructure_service, (void*) &facilities);
|
||||||
|
|
||||||
|
// CPM
|
||||||
|
pthread_create(&facilities.cp_service, NULL, cp_service, (void*) &facilities);
|
||||||
|
|
||||||
uint8_t buffer[PACKET_MAX_LEN];
|
uint8_t buffer[PACKET_MAX_LEN];
|
||||||
syslog_info("[facilities] listening");
|
syslog_info("[facilities] listening");
|
||||||
uint8_t code;
|
uint8_t code;
|
||||||
|
|
@ -454,6 +468,7 @@ int main() {
|
||||||
pthread_join(facilities.ca_service, NULL);
|
pthread_join(facilities.ca_service, NULL);
|
||||||
pthread_join(facilities.den_service, NULL);
|
pthread_join(facilities.den_service, NULL);
|
||||||
pthread_join(facilities.infrastructure_service, NULL);
|
pthread_join(facilities.infrastructure_service, NULL);
|
||||||
|
pthread_join(facilities.cp_service, NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#include "denm.h"
|
#include "denm.h"
|
||||||
#include "infrastructure.h"
|
#include "infrastructure.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
|
#include "cpm.h"
|
||||||
|
|
||||||
typedef struct epv {
|
typedef struct epv {
|
||||||
pthread_mutex_t lock;
|
pthread_mutex_t lock;
|
||||||
|
|
@ -28,7 +29,7 @@ typedef struct facilities {
|
||||||
pthread_t den_service;
|
pthread_t den_service;
|
||||||
pthread_t infrastructure_service;
|
pthread_t infrastructure_service;
|
||||||
pthread_t transmitting;
|
pthread_t transmitting;
|
||||||
|
pthread_t cp_service;
|
||||||
// ZMQ
|
// ZMQ
|
||||||
struct {
|
struct {
|
||||||
void* ctx;
|
void* ctx;
|
||||||
|
|
@ -53,6 +54,9 @@ typedef struct facilities {
|
||||||
// Infrastructure
|
// Infrastructure
|
||||||
infrastructure_t* infrastructure;
|
infrastructure_t* infrastructure;
|
||||||
|
|
||||||
|
//CPM
|
||||||
|
dissemination_t* dissemination;
|
||||||
|
|
||||||
int station_type;
|
int station_type;
|
||||||
bool use_security;
|
bool use_security;
|
||||||
bool replay;
|
bool replay;
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,14 @@
|
||||||
#include "denm.h"
|
#include "denm.h"
|
||||||
#include "infrastructure.h"
|
#include "infrastructure.h"
|
||||||
#include "requests.h"
|
#include "requests.h"
|
||||||
|
#include "cpm.h"
|
||||||
|
|
||||||
#include <itss-facilities/FacilitiesDataResult.h>
|
#include <itss-facilities/FacilitiesDataResult.h>
|
||||||
#include <itss-transport/BTPDataRequest.h>
|
#include <itss-transport/BTPDataRequest.h>
|
||||||
|
|
||||||
#include <zmq.h>
|
#include <zmq.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
#include <cpm/CPM.h>
|
||||||
|
|
||||||
#define syslog_info(msg, ...) syslog(LOG_INFO, msg, ##__VA_ARGS__)
|
#define syslog_info(msg, ...) syslog(LOG_INFO, msg, ##__VA_ARGS__)
|
||||||
#define syslog_emerg(msg, ...) syslog(LOG_EMERG, "%s:%d [" msg "]", __func__, __LINE__, ##__VA_ARGS__)
|
#define syslog_emerg(msg, ...) syslog(LOG_EMERG, "%s:%d [" msg "]", __func__, __LINE__, ##__VA_ARGS__)
|
||||||
|
|
@ -84,6 +86,15 @@ int facilities_request_single_message(facilities_t* facilities, void* responder,
|
||||||
bdr->gnPacketTransportType = PacketTransportType_shb;
|
bdr->gnPacketTransportType = PacketTransportType_shb;
|
||||||
bdr->gnTrafficClass = 1;
|
bdr->gnTrafficClass = 1;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ItsMessageType_cpm:
|
||||||
|
its_msg_def = &asn_DEF_CPM;
|
||||||
|
its_msg = calloc(1, sizeof(CPM_t));
|
||||||
|
bdr->destinationPort = Port_cpm;
|
||||||
|
bdr->gnPacketTransportType = PacketTransportType_shb;
|
||||||
|
bdr->gnTrafficClass = 2;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
syslog_err("[facilities] unrecognized FDRequest message type (%ld)", fdreq->choice.singleMessage.itsMessageType);
|
syslog_err("[facilities] unrecognized FDRequest message type (%ld)", fdreq->choice.singleMessage.itsMessageType);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue