Skip to content

Commit

Permalink
Merge pull request #296 from lf-lang/dnet-ad-hoc
Browse files Browse the repository at this point in the history
Do not report error when receiving DNET signals
  • Loading branch information
byeonggiljun authored Oct 18, 2024
2 parents 6c35f2b + f484d14 commit e2b569f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
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

0 comments on commit e2b569f

Please sign in to comment.