Skip to content

Conversation

@dmccoystephenson
Copy link
Member

@dmccoystephenson dmccoystephenson commented May 9, 2025

Problem

Per the J2735 standard, Traveler Information Messages (TIMs) can include up to 16 regions, each with 63 nodes, totaling a maximum of 1008 nodes. This results in a large OCTET STRING for the advisoryMessage element within the AdvisorySituationData structure. Currently, if this element exceeds 1400 bytes, encoding fails due to an arbitrary limit set in the SEMI file.

Solution

The SEMI file’s constraint on advisoryMessage length has been increased from 1400 bytes to 7000 bytes. This new limit accommodates encoding for all 16 regions at full capacity.

Testing

  • Unit tests were added to confirm that encoding ASD TIMs with 7 and 16 full regions now succeeds.
  • A test verifies that encoding fails when attempting to use 17 regions, in line with the J2735 limit of 16.
  • Various length limits were tested; 7000 bytes was chosen as the smallest multiple of 1400 that supports 16 full regions.
  • Two preexisting test cases failed after the update. These were commented out with explanations, as they incorrectly wrapped a BSM hex string in an AdvisorySituationData structure—an unintended use case.
  • Generating a TIM from Evanston, Wyoming to Laramie, Wyoming (which was previously failing to encode) was verified to encode successfully with these changes.

Note

It should be noted that this fix has been applied on top of the latest changes in the USDOT develop branch, not on top of the 2025 Q1 release. Since there are minimal changes, I don't think this will be a problem when using the 2025 Q1 release version of the jpo-ode project.

Copy link
Member Author

@dmccoystephenson dmccoystephenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review

messagePsid Psid, -- PSID of advisory message
broadcastInst BroadcastInstructions OPTIONAL, -- Broadcast instructions
advisoryMessage OCTET STRING (SIZE(0..1400)) -- Encoded advisory message
advisoryMessage OCTET STRING (SIZE(0..7000)) -- Encoded advisory message
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: It was not necessary to modify this constraint to get the new unit tests to pass, but this constraint appears to be coupled with the constraint above as both were set to 1400 and both were for an "Encoded advisory message"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The regions in these test files are duplicated (in this file it is the same region 7 times), but this shouldn't impact encoding verification.

@dmccoystephenson dmccoystephenson marked this pull request as ready for review May 9, 2025 21:54
@dmccoystephenson dmccoystephenson marked this pull request as draft May 12, 2025 16:08
@dmccoystephenson dmccoystephenson marked this pull request as ready for review May 16, 2025 18:42
Copy link

@mwodahl mwodahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had one small question about removing unused test cases - otherwise this looks great!

src/tests.cpp Outdated
TEST_CASE("Encode ASD", "[encoding]" ) {
std::cout << "=== Encode ASD ===" << std::endl;
/**
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: If this test case isn't valid, can it be removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think it could be removed; opened #2 for this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented-out test cases have been removed!

@dmccoystephenson dmccoystephenson marked this pull request as draft May 23, 2025 15:03
@dmccoystephenson
Copy link
Member Author

Marking this as a draft for now until ASD decoding can be verified on the SDX side.

Copy link
Member Author

@dmccoystephenson dmccoystephenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I need to check whether messages encoded with the 1400 constraint can be decoded using the 7000 constraint, and vice versa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants