Skip to content

Commit

Permalink
modified: src/tmx/TmxApi/tmx/TmxApiMessages.h
Browse files Browse the repository at this point in the history
	modified:   src/tmx/TmxApi/tmx/j2735_messages/J2735MessageFactory.hpp
	new file:   src/tmx/TmxApi/tmx/j2735_messages/RoadSafetyMessage.hpp
	modified:   src/tmx/TmxApi/tmx/messages/IvpJ2735.c
	modified:   src/tmx/TmxUtils/test/J2735MessageTest.cpp
  • Loading branch information
jwillmartin committed Mar 21, 2024
1 parent 870370d commit 8177e89
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 26 deletions.
126 changes: 118 additions & 8 deletions src/tmx/TmxApi/tmx/TmxApiMessages.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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";
Expand All @@ -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 */

Expand Down
15 changes: 9 additions & 6 deletions src/tmx/TmxApi/tmx/j2735_messages/J2735MessageFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <tmx/j2735_messages/testMessage04.hpp>
#include <tmx/j2735_messages/testMessage05.hpp>
#include <tmx/j2735_messages/SensorDataSharingMessage.hpp>
#include <tmx/j2735_messages/RoadSafetyMessage.hpp>

namespace tmx {
namespace messages {
Expand All @@ -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
Expand Down Expand Up @@ -194,18 +196,19 @@ class J2735MessageFactory
add_allocator_to_maps<PvdMessage>();
add_allocator_to_maps<PsmMessage>();
add_allocator_to_maps<RsaMessage>();
add_allocator_to_maps<RsmMessage>();
add_allocator_to_maps<RtcmMessage>();
add_allocator_to_maps<SdsmMessage>();
add_allocator_to_maps<SrmMessage>();
add_allocator_to_maps<SsmMessage>();
add_allocator_to_maps<SpatMessage>();
add_allocator_to_maps<TimMessage>();
add_allocator_to_maps<tsm4Message>();
add_allocator_to_maps<tsm5Message>();
add_allocator_to_maps<tsm0Message>();
add_allocator_to_maps<tsm1Message>();
add_allocator_to_maps<tsm2Message>();
add_allocator_to_maps<tsm3Message>();
add_allocator_to_maps<SdsmMessage>();
add_allocator_to_maps<tsm4Message>();
add_allocator_to_maps<tsm5Message>();
#if SAEJ2735_SPEC < 63
add_allocator_to_maps<UperFrameMessage>();
#endif
Expand Down
15 changes: 15 additions & 0 deletions src/tmx/TmxApi/tmx/j2735_messages/RoadSafetyMessage.hpp
Original file line number Diff line number Diff line change
@@ -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 <RoadSafetyMessage.h>
#include <tmx/j2735_messages/J2735MessageTemplate.hpp>
#include <tmx/messages/TmxJ2735.hpp>

TMX_J2735_DECLARE(Rsm, RoadSafetyMessage, api::roadSafetyMessage, api::MSGSUBTYPE_ROADSAFETYMESSAGE_STRING)

#endif /* TMX_J2735_MESSAGES_ROADSAFETYMESSAGE_HPP_ */
22 changes: 11 additions & 11 deletions src/tmx/TmxApi/tmx/messages/IvpJ2735.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@
#include <SPAT.h>
#include <SignalStatusMessage.h>
#include <TravelerInformation.h>
#if SAEJ2735_SPEC > 2024
#include <PersonalSafetyMessage.h>
#include <TestMessage00.h>
#include <TestMessage01.h>
#include <TestMessage02.h>
#include <TestMessage03.h>
#include <TestMessage04.h>
#include <TestMessage05.h>
#if SAEJ2735_SPEC > 2020
#include <RoadSafetyMessage.h>
#include <RoadWeatherMessage.h>
#include <ProbeDataConfigMessage.h>
Expand All @@ -51,12 +57,6 @@
#include <RoadUserChargingConfigMessage.h>
#include <RoadUserChargingReportMessage.h>
#include <TrafficLightStatusMessage.h>
#include <TestMessage00.h>
#include <TestMessage01.h>
#include <TestMessage02.h>
#include <TestMessage03.h>
#include <TestMessage04.h>
#include <TestMessage05.h>
#include <TestMessage06.h>
#include <TestMessage07.h>
#include <TestMessage08.h>
Expand Down Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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";
Expand All @@ -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";
Expand Down
19 changes: 18 additions & 1 deletion src/tmx/TmxUtils/test/J2735MessageTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<UperFrameMessage>();
#if SAEJ2735_SPEC < 2020
enumNames[api::personalMobilityMessage] = api::MSGSUBTYPE_PERSONALMOBILITYMESSAGE_STRING;
// msgTypes[api::personalMobilityMessage] = new msg_type_impl<PmmMessage>();
testBytes[api::personalMobilityMessage] = "303a800111830200f58431482362c99e568d5b375b95c39c4b58b2c8cd6e168d5b2d68c9b366ad5a3460c1830000d693a401ad2747fc7e09b3720034";
#endif
}
}

Expand Down Expand Up @@ -602,9 +604,24 @@ TEST_F(J2735MessageTest, EncodePersonalSafetyMessage){
container.load<XML>(ss);
psmmessage.set_contents(container.get_storage().get_tree());
psmENC.encode_j2735_message(psmmessage);
std::cout << psmENC.get_payload_str()<<std::endl;
std::cout << psmENC.get_payload_str() << std::endl;
ASSERT_EQ(32, psmENC.get_msgId());
}

TEST_F(J2735MessageTest, EncodeRoadSafetyMessage)
{
string rsm="<RoadSafetyMessage><commonContainer><eventInfo><eventID><operatorID><fullRdAuthID>1.3.6.1.4.1.9999.1</fullRdAuthID></operatorID><uniqueID>8901D5</uniqueID></eventID><eventUpdate>12</eventUpdate><eventCancellation>0</eventCancellation><startDateTime><year>2024</year><month>3</month><day>19</day><hour>15</hour><minute>30</minute><second>45</second><offset>0</offset></startDateTime><eventRecurrence><monday>1</monday><tuesday>1</tuesday><wednesday>1</wednesday><thursday>1</thursday><friday>1</friday><saturday>1</saturday><sunday>1</sunday></eventRecurrence><causeCode>7</causeCode><affectedVehicles><list>9217</list></affectedVehicles></eventInfo><regionInfo><referencePoint><lat>389549775</lat><long>-771491835</long><elevation>390</elevation></referencePoint></regionInfo></commonContainer><content><dynamicInfoContainer><priority>3</priority><dmsSignString><list>WrongWayDriver</list></dmsSignString><applicableRegion><referencePoint><lat>389549775</lat><long>-771491835</long><elevation>390</elevation></referencePoint></applicableRegion></dynamicInfoContainer></content></RoadSafetyMessage>";
std::stringstream ss;
RsmMessage rsmmessage;
RsmEncodedMessage rsmENC;
tmx::message_container_type container;
ss<<rsm;
container.load<XML>(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="<TestMessage04><body><tcrV01><reqid>C7C9A13FE6AC464E</reqid><reqseq>0</reqseq><scale>0</scale><bounds><TrafficControlBounds><oldest>27493419</oldest><reflon>-818349472</reflon><reflat>281118677</reflat><offsets><OffsetPoint><deltax>376</deltax><deltay>0</deltay></OffsetPoint><OffsetPoint><deltax>376</deltax><deltay>1320</deltay></OffsetPoint><OffsetPoint><deltax>0</deltax><deltay>1320</deltay></OffsetPoint></offsets></TrafficControlBounds></bounds></tcrV01> </body></TestMessage04>";
Expand Down

0 comments on commit 8177e89

Please sign in to comment.