diff --git a/src/tmx/TmxApi/tmx/TmxApiMessages.h b/src/tmx/TmxApi/tmx/TmxApiMessages.h index b8a1e6daa..81875fba8 100644 --- a/src/tmx/TmxApi/tmx/TmxApiMessages.h +++ b/src/tmx/TmxApi/tmx/TmxApiMessages.h @@ -88,14 +88,43 @@ enum MsgSubType signalStatusMessage = 30, travelerInformation = 31, personalSafetyMessage = 32, - sensorDataSharingMessage = 41, + #if SAEJ2735_SPEC < 2020 personalMobilityMessage = 245, + #endif + roadSafetyMessage = 33, + roadWeatherMessage = 34, + probeDataConfigMessage = 35, + probeDataReportMessage = 36, + tollAdvertisementMessage = 37, + tollUsageMessage = 38, + tollUsageAckMessage = 39, + cooperativeControlMessage = 40, + sensorDataSharingMessage = 41, + maneuverSharingAndCoordinatingMessage = 42, + roadGeometryAndAttributes = 43, + personalSafetyMessage2 = 44, + trafficSignalPhaseAndTiming = 45, + signalControlAndPrioritizationRequest = 46, + signalControlAndPrioritizationStatus = 47, + roadUserChargingConfigMessage = 48, + roadUserChargingReportMessage = 49, + trafficLightStatusMessage = 50, testMessage00 = 240, testMessage01 = 241, testMessage02 = 242, testMessage03 = 243, testMessage04 = 244, - testMessage05 = 245, + testMessage05 = 245, + testMessage06 = 246, + testMessage07 = 247, + testMessage08 = 248, + testMessage09 = 249, + testMessage10 = 250, + testMessage11 = 251, + testMessage12 = 252, + testMessage13 = 253, + testMessage14 = 254, + testMessage15 = 255, J2735_end = 256, GID = 300 }; @@ -136,15 +165,42 @@ static CONSTEXPR const char *MSGSUBTYPE_TRAVELERINFORMATION_STRING = "TIM"; static CONSTEXPR const char *MSGSUBTYPE_PERSONALSAFETYMESSAGE_D_STRING = "PSM"; static CONSTEXPR const char *MSGSUBTYPE_PERSONALSAFETYMESSAGE_STRING = "PSM-P"; static CONSTEXPR const char *MSGSUBTYPE_PERSONALMOBILITYMESSAGE_STRING = "PMM"; -static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE04_STRING = "TMSG04-P"; -static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE05_STRING = "TMSG05-P"; +static CONSTEXPR const char *MSGSUBTYPE_ROADSAFETYMESSAGE_STRING = "RSM"; +static CONSTEXPR const char *MSGSUBTYPE_ROADWEATHERMESSAGE_STRING = "RWM"; +static CONSTEXPR const char *MSGSUBTYPE_PROBEDATACONFIGMESSAGE_STRING = "PDC"; +static CONSTEXPR const char *MSGSUBTYPE_PROBEDATAREPORTMESSAGE_STRING = "PDR"; +static CONSTEXPR const char *MSGSUBTYPE_TOLLADVERTISEMENTMESSAGE_STRING = "TAM"; +static CONSTEXPR const char *MSGSUBTYPE_TOLLUSAGEMESSAGE_STRING = "TUM"; +static CONSTEXPR const char *MSGSUBTYPE_TOLLUSAGEACKMESSAGE_STRING = "TUMack"; +static CONSTEXPR const char *MSGSUBTYPE_COOPERATIVECONTROLMESSAGE_STRING = "CCM"; +static CONSTEXPR const char *MSGSUBTYPE_SENSORDATASHARINGMESSAGE_STRING = "SDSM"; +static CONSTEXPR const char *MSGSUBTYPE_MANEUVERSHARINGANDCOORDINATINGMESSAGE_STRING = "MSCM"; +static CONSTEXPR const char *MSGSUBTYPE_ROADGEOMETRYANDATTRIBUTES_STRING = "RGA"; +static CONSTEXPR const char *MSGSUBTYPE_PERSONALSAFETYMESSAGE2_STRING = "PSM2"; +static CONSTEXPR const char *MSGSUBTYPE_TRAFFICSIGNALPHASEANDTIMING_STRING = "TSPaT"; +static CONSTEXPR const char *MSGSUBTYPE_SIGNALCONTROLANDPRIORITIZATIONREQUEST_STRING = "SCPR"; +static CONSTEXPR const char *MSGSUBTYPE_SIGNALCONTROLANDPRIORITIZATIONSTATUS_STRING = "SCPS"; +static CONSTEXPR const char *MSGSUBTYPE_ROADUSERCHARGINGCONFIGMESSAGE_STRING = "RUCCM"; +static CONSTEXPR const char *MSGSUBTYPE_ROADUSERCHARGINGREPORTMESSAGE_STRING = "RUCRM"; +static CONSTEXPR const char *MSGSUBTYPE_TRAFFICLIGHTSTATUSMESSAGE_STRING = "TLSM"; static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE00_STRING = "TMSG00-P"; static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE01_STRING = "TMSG01-P"; static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE02_STRING = "TMSG02-P"; static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE03_STRING = "TMSG03-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE04_STRING = "TMSG04-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE05_STRING = "TMSG05-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE06_STRING = "TMSG06-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE07_STRING = "TMSG07-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE08_STRING = "TMSG08-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE09_STRING = "TMSG09-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE10_STRING = "TMSG10-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE11_STRING = "TMSG11-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE12_STRING = "TMSG12-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE13_STRING = "TMSG13-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE14_STRING = "TMSG14-P"; +static CONSTEXPR const char *MSGSUBTYPE_TESTMESSAGE15_STRING = "TMSG15-P"; static CONSTEXPR const char *MSGSUBTYPE_J2735_END_STRING = "J2735_end"; static CONSTEXPR const char *MSGSUBTYPE_GID_STRING = "GID"; -static CONSTEXPR const char *MSGSUBTYPE_SENSORDATASHARINGMESSAGE_STRING = "SDSM"; enum Encoding { @@ -196,15 +252,42 @@ enum msgPSID rtcmCorrections_PSID = 0x8000, signalRequestMessage_PSID = 0xE0000016, signalStatusMessage_PSID = 0x8002, - sensorDataSharingMessage_PSID = 0x8010, travelerInformation_PSID = 0x8003, personalSafetyMessage_PSID = 0x27, + roadSafetyMessage_PSID = 0x8003, + roadWeatherMessage_PSID = 0x204099, + probeDataConfigMessage_PSID = 0x8004, + probeDataReportMessage_PSID = 0x8004, + tollAdvertisementMessage_PSID = 0x800F, + tollUsageMessage_PSID = 0x800F, + tollUsageAckMessage_PSID = 0x800F, + cooperativeControlMessage_PSID = 0x800E, + sensorDataSharingMessage_PSID = 0x8010, + maneuverSharingAndCoordinatingMessage_PSID = 0x8011, + roadGeometryAndAttributes_PSID = 0xE0000017, + personalSafetyMessage2_PSID = 0x27, + trafficSignalPhaseAndTiming_PSID = 0x8002, + signalControlAndPrioritizationRequest_PSID = 0xE0000016, + signalControlAndPrioritizationStatus_PSID = 0xE0000015, + roadUserChargingConfigMessage_PSID = 0x800F, + roadUserChargingReportMessage_PSID = 0x800F, + trafficLightStatusMessage_PSID = 0x8002, testMessage00_PSID = 0xBFEE, testMessage01_PSID = 0xBFEE, testMessage02_PSID = 0xBFEE, testMessage03_PSID = 0xBFEE, testMessage04_PSID = 0x8003, - testMessage05_PSID = 0x8003 + testMessage05_PSID = 0x8003, + testMessage06_PSID = 0xBFEE, + testMessage07_PSID = 0xBFEE, + testMessage08_PSID = 0xBFEE, + testMessage09_PSID = 0xBFEE, + testMessage10_PSID = 0xBFEE, + testMessage11_PSID = 0xBFEE, + testMessage12_PSID = 0xBFEE, + testMessage13_PSID = 0xBFEE, + testMessage14_PSID = 0xBFEE, + testMessage15_PSID = 0xBFEE }; static CONSTEXPR const char *MSGPSID_NONE_PSID_STRING = "None"; @@ -221,15 +304,42 @@ static CONSTEXPR const char *MSGPSID_ROADSIDEALERT_PSID_STRING = "0x8003"; static CONSTEXPR const char *MSGPSID_RTCMCORRECTIONS_PSID_STRING = "0x8000"; static CONSTEXPR const char *MSGPSID_SIGNALREQUESTMESSAGE_PSID_STRING = "0xE0000016"; static CONSTEXPR const char *MSGPSID_SIGNALSTATUSMESSAGE_PSID_STRING = "0x8002"; -static CONSTEXPR const char *MSGPSID_SENSORDATASHARINGMESSAGE_PSID_STRING = "0x8010"; static CONSTEXPR const char *MSGPSID_TRAVELERINFORMATION_PSID_STRING = "0x8003"; static CONSTEXPR const char *MSGPSID_PERSONALSAFETYMESSAGE_PSID_STRING = "0x27"; +static CONSTEXPR const char *MSGPSID_ROADSAFETYMESSAGE_PSID_STRING = "0x8003"; +static CONSTEXPR const char *MSGPSID_ROADWEATHERMESSAGE_PSID_STRING = "0x204099"; +static CONSTEXPR const char *MSGPSID_PROBEDATACONFIGMESSAGE_PSID_STRING = "0x8004"; +static CONSTEXPR const char *MSGPSID_PROBEDATAREPORTMESSAGE_PSID_STRING = "0x8004"; +static CONSTEXPR const char *MSGPSID_TOLLADVERTISEMENTMESSAGE_PSID_STRING = "0x800F"; +static CONSTEXPR const char *MSGPSID_TOLLUSAGEMESSAGE_PSID_STRING = "0x800F"; +static CONSTEXPR const char *MSGPSID_TOLLUSAGEACKMESSAGE_PSID_STRING = "0x800F"; +static CONSTEXPR const char *MSGPSID_COOPERATIVECONTROLMESSAGE_PSID_STRING = "0x800E"; +static CONSTEXPR const char *MSGPSID_SENSORDATASHARINGMESSAGE_PSID_STRING = "0x8010"; +static CONSTEXPR const char *MSGPSID_MANEUVERSHARINGANDCOORDINATINGMESSAGE_PSID_STRING = "0x8011"; +static CONSTEXPR const char *MSGPSID_ROADGEOMETRYANDATTRIBUTES_PSID_STRING = "0xE0000017"; +static CONSTEXPR const char *MSGPSID_PERSONALSAFETYMESSAGE2_PSID_STRING = "0x27"; +static CONSTEXPR const char *MSGPSID_TRAFFICSIGNALPHASEANDTIMING_PSID_STRING = "0x8002"; +static CONSTEXPR const char *MSGPSID_SIGNALCONTROLANDPRIORITIZATIONREQUEST_PSID_STRING = "0xE0000016"; +static CONSTEXPR const char *MSGPSID_SIGNALCONTROLANDPRIORITIZATIONSTATUS_PSID_STRING = "0xE0000015"; +static CONSTEXPR const char *MSGPSID_ROADUSERCHARGINGCONFIGMESSAGE_PSID_STRING = "0x800F"; +static CONSTEXPR const char *MSGPSID_ROADUSERCHARGINGREPORTMESSAGE_PSID_STRING = "0x800F"; +static CONSTEXPR const char *MSGPSID_TRAFFICLIGHTSTATUSMESSAGE_PSID_STRING = "TLSM"; static CONSTEXPR const char *MSGPSID_TESTMESSAGE00_PSID_STRING = "0xBFEE"; static CONSTEXPR const char *MSGPSID_TESTMESSAGE01_PSID_STRING = "0xBFEE"; static CONSTEXPR const char *MSGPSID_TESTMESSAGE02_PSID_STRING = "0xBFEE"; static CONSTEXPR const char *MSGPSID_TESTMESSAGE03_PSID_STRING = "0xBFEE"; static CONSTEXPR const char *MSGPSID_TESTMESSAGE04_PSID_STRING = "0x8003"; static CONSTEXPR const char *MSGPSID_TESTMESSAGE05_PSID_STRING = "0x8003"; +static CONSTEXPR const char *MSGPSID_TESTMESSAGE06_PSID_STRING = "0xBFEE"; +static CONSTEXPR const char *MSGPSID_TESTMESSAGE07_PSID_STRING = "0xBFEE"; +static CONSTEXPR const char *MSGPSID_TESTMESSAGE08_PSID_STRING = "0xBFEE"; +static CONSTEXPR const char *MSGPSID_TESTMESSAGE09_PSID_STRING = "0xBFEE"; +static CONSTEXPR const char *MSGPSID_TESTMESSAGE10_PSID_STRING = "0xBFEE"; +static CONSTEXPR const char *MSGPSID_TESTMESSAGE11_PSID_STRING = "0xBFEE"; +static CONSTEXPR const char *MSGPSID_TESTMESSAGE12_PSID_STRING = "0xBFEE"; +static CONSTEXPR const char *MSGPSID_TESTMESSAGE13_PSID_STRING = "0xBFEE"; +static CONSTEXPR const char *MSGPSID_TESTMESSAGE14_PSID_STRING = "0xBFEE"; +static CONSTEXPR const char *MSGPSID_TESTMESSAGE15_PSID_STRING = "0xBFEE"; } /* End namespace api */ diff --git a/src/tmx/TmxApi/tmx/j2735_messages/J2735MessageFactory.hpp b/src/tmx/TmxApi/tmx/j2735_messages/J2735MessageFactory.hpp index 1fa6eadf8..c9caf9d74 100644 --- a/src/tmx/TmxApi/tmx/j2735_messages/J2735MessageFactory.hpp +++ b/src/tmx/TmxApi/tmx/j2735_messages/J2735MessageFactory.hpp @@ -44,6 +44,7 @@ #include #include #include +#include namespace tmx { namespace messages { @@ -69,18 +70,19 @@ using message_types = message_type_list< PsmMessage, PvdMessage, RsaMessage, + RsmMessage, RtcmMessage, + SdsmMessage, SrmMessage, SsmMessage, SpatMessage, TimMessage, - tsm4Message, - tsm5Message, tsm0Message, tsm1Message, tsm2Message, tsm3Message, - SdsmMessage + tsm4Message, + tsm5Message >; /// Base allocator type @@ -194,18 +196,19 @@ class J2735MessageFactory add_allocator_to_maps(); add_allocator_to_maps(); add_allocator_to_maps(); + add_allocator_to_maps(); add_allocator_to_maps(); + add_allocator_to_maps(); add_allocator_to_maps(); add_allocator_to_maps(); add_allocator_to_maps(); add_allocator_to_maps(); - add_allocator_to_maps(); - add_allocator_to_maps(); add_allocator_to_maps(); add_allocator_to_maps(); add_allocator_to_maps(); add_allocator_to_maps(); - add_allocator_to_maps(); + add_allocator_to_maps(); + add_allocator_to_maps(); #if SAEJ2735_SPEC < 63 add_allocator_to_maps(); #endif diff --git a/src/tmx/TmxApi/tmx/j2735_messages/RoadSafetyMessage.hpp b/src/tmx/TmxApi/tmx/j2735_messages/RoadSafetyMessage.hpp new file mode 100644 index 000000000..57a06588c --- /dev/null +++ b/src/tmx/TmxApi/tmx/j2735_messages/RoadSafetyMessage.hpp @@ -0,0 +1,15 @@ +/* + * @file RoadSafetyMessage.hpp + * + * Created on: March 19, 2024 + */ +#ifndef TMX_J2735_MESSAGES_ROADSAFETYMESSAGE_HPP_ +#define TMX_J2735_MESSAGES_ROADSAFETYMESSAGE_HPP_ + +#include +#include +#include + +TMX_J2735_DECLARE(Rsm, RoadSafetyMessage, api::roadSafetyMessage, api::MSGSUBTYPE_ROADSAFETYMESSAGE_STRING) + +#endif /* TMX_J2735_MESSAGES_ROADSAFETYMESSAGE_HPP_ */ diff --git a/src/tmx/TmxApi/tmx/messages/IvpJ2735.c b/src/tmx/TmxApi/tmx/messages/IvpJ2735.c index 17d633022..e2e2d1493 100644 --- a/src/tmx/TmxApi/tmx/messages/IvpJ2735.c +++ b/src/tmx/TmxApi/tmx/messages/IvpJ2735.c @@ -31,8 +31,14 @@ #include #include #include -#if SAEJ2735_SPEC > 2024 #include +#include +#include +#include +#include +#include +#include +#if SAEJ2735_SPEC > 2020 #include #include #include @@ -51,12 +57,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include #include #include #include @@ -144,8 +144,9 @@ const char *getMessageSubTypeFromMsgId(e_DSRCmsgID msgId) case DSRCmsgID_signalRequestMessage: return "SRM"; case DSRCmsgID_signalStatusMessage: return "SSM"; case DSRCmsgID_travelerInformation: return "TIM"; - #if SAEJ2735_SPEC > 2024 case DSRCmsgID_personalSafetyMessage: return "PSM"; + case DSRCmsgID_sensorDataSharingMessage: return "SDSM"; + #if SAEJ2735_SPEC > 2020 case DSRCmsgID_roadSafetyMessage: return "RSM"; case DSRCmsgID_roadWeatherMessage: return "RWM"; case DSRCmsgID_probeDataConfigMessage: return "PDC"; @@ -154,7 +155,6 @@ const char *getMessageSubTypeFromMsgId(e_DSRCmsgID msgId) case DSRCmsgID_tollUsageMessage: return "TUM"; case DSRCmsgID_tollUsageAckMessage: return "TUMack"; case DSRCmsgID_cooperativeControlMessage: return "CCM"; - case DSRCmsgID_sensorDataSharingMessage: return "SDSM"; case DSRCmsgID_maneuverSharingAndCoordinatingMessage: return "MSCM"; case DSRCmsgID_roadGeometryAndAttributes: return "RGA"; case DSRCmsgID_personalSafetyMessage2: return "PSM2"; @@ -195,8 +195,9 @@ const char *getMessageDescriptionFromMsgId(e_DSRCmsgID msgId) case DSRCmsgID_signalRequestMessage: return "DSRC Signal Request Message"; case DSRCmsgID_signalStatusMessage: return "DSRC Signal Status Message"; case DSRCmsgID_travelerInformation: return "DSRC Traveler Information Message"; - #if SAEJ2735_SPEC > 2024 case DSRCmsgID_personalSafetyMessage: return "DSRC Personal Safety Message"; + case DSRCmsgID_sensorDataSharingMessage: return "DSRC Sensor Data Sharing Message"; + #if SAEJ2735_SPEC > 2020 case DSRCmsgID_roadSafetyMessage: return "DSRC Road Safety Message"; case DSRCmsgID_roadWeatherMessage: return "DSRC Road Weather Message"; case DSRCmsgID_probeDataConfigMessage: return "DSRC Probe Data Config Message"; @@ -205,7 +206,6 @@ const char *getMessageDescriptionFromMsgId(e_DSRCmsgID msgId) case DSRCmsgID_tollUsageMessage: return "DSRC Toll Usage Message"; case DSRCmsgID_tollUsageAckMessage: return "DSRC Toll Usage Ack Message"; case DSRCmsgID_cooperativeControlMessage: return "DSRC Cooperative Control Message"; - case DSRCmsgID_sensorDataSharingMessage: return "DSRC Sensor Data Sharing Message"; case DSRCmsgID_maneuverSharingAndCoordinatingMessage: return "DSRC Maneuver Sharing And Coordinating Message"; case DSRCmsgID_roadGeometryAndAttributes: return "DSRC Road Geometry And Attributes"; case DSRCmsgID_personalSafetyMessage2: return "DSRC Personal Safety Message2"; diff --git a/src/tmx/TmxUtils/test/J2735MessageTest.cpp b/src/tmx/TmxUtils/test/J2735MessageTest.cpp index 4a196e7dd..b864fecb1 100644 --- a/src/tmx/TmxUtils/test/J2735MessageTest.cpp +++ b/src/tmx/TmxUtils/test/J2735MessageTest.cpp @@ -179,9 +179,11 @@ class J2735MessageTest: public testing::Test { //enumNames[api::travelerInformation] = api::MSGSUBTYPE_TRAVELERINFORMATION_STRING; enumNames[api::uperFrame_D] = api::MSGSUBTYPE_UPERFRAME_D_STRING; // msgTypes[api::uperFrame_D] = new msg_type_impl(); + #if SAEJ2735_SPEC < 2020 enumNames[api::personalMobilityMessage] = api::MSGSUBTYPE_PERSONALMOBILITYMESSAGE_STRING; // msgTypes[api::personalMobilityMessage] = new msg_type_impl(); testBytes[api::personalMobilityMessage] = "303a800111830200f58431482362c99e568d5b375b95c39c4b58b2c8cd6e168d5b2d68c9b366ad5a3460c1830000d693a401ad2747fc7e09b3720034"; + #endif } } @@ -602,9 +604,24 @@ TEST_F(J2735MessageTest, EncodePersonalSafetyMessage){ container.load(ss); psmmessage.set_contents(container.get_storage().get_tree()); psmENC.encode_j2735_message(psmmessage); - std::cout << psmENC.get_payload_str()<(ss); + rsmmessage.set_contents(container.get_storage().get_tree()); + rsmENC.encode_j2735_message(rsmmessage); + std::cout << rsmENC.get_payload_str() << std::endl; + ASSERT_EQ(33, rsmENC.get_msgId()); +} TEST_F(J2735MessageTest, EncodeTrafficControlRequest){ string tsm4str="C7C9A13FE6AC464E0027493419-8183494722811186773760376132001320 ";