Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not report error when receiving DNET signals #296

Merged
merged 6 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lingua-franca-ref.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
master
rti-DNET
26 changes: 26 additions & 0 deletions src/core/federation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,18 @@ enum RTIMessageTypes {
*/
MSG_TYPE_NEIGHBOR_STRUCTURE = 24,

/**
* Byte identifying a downstream next event tag (DNET) message sent
* from the RTI in centralized coordination.
* The next eight bytes will be the timestamp.
* The next four bytes will be the microstep.
* This signal from the RTI tells the destination federate the latest tag that
* the federate can safely skip sending a next event tag (NET) signal.
* In other words, the federate doesn't have to send NET signals with tags
* earlier than or equal to this tag unless it cannot advance to its next event tag.
*/
MSG_TYPE_DOWNSTREAM_NEXT_EVENT_TAG = 26,

/**
* Byte identifying an acknowledgment of the previously received MSG_TYPE_FED_IDS message
* sent by the RTI to the federate
Expand Down Expand Up @@ -1155,6 +1167,20 @@ class RTIClient extends EventEmitter {
bufferIndex += 17;
break;
}
case RTIMessageTypes.MSG_TYPE_DOWNSTREAM_NEXT_EVENT_TAG: {
// The next eight bytes are the timestamp.
// The next four bytes are the microstep.
const tagBuffer = Buffer.alloc(12);
assembledData.copy(tagBuffer, 0, bufferIndex + 1, bufferIndex + 13);
const tag = Tag.fromBinary(tagBuffer);

Log.debug(this, () => {
return `Downstream next event tag (DNET) received from RTI for ${tag}.
DNET is not yet supported in TypeScript. Ignored.`;
});
bufferIndex += 13;
break;
}
case RTIMessageTypes.MSG_TYPE_ACK: {
Log.debug(this, () => {
return "Received an RTI MSG_TYPE_ACK";
Expand Down
Loading