diff --git a/lingua-franca-ref.txt b/lingua-franca-ref.txt index 1f7391f9..8ba7da0a 100644 --- a/lingua-franca-ref.txt +++ b/lingua-franca-ref.txt @@ -1 +1 @@ -master +rti-DNET diff --git a/src/core/federation.ts b/src/core/federation.ts index e956710b..fa74359b 100644 --- a/src/core/federation.ts +++ b/src/core/federation.ts @@ -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 @@ -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";