Frame Sequence Numbers
The Frame Sequence Number enumerates a serial message exchanged between the Host and the Module, and vice versa. For best practice, it is recommend the Frame Sequence Number be incremented by 1 for each newly initiated message. Any transaction, whether initiated by the Host or the Module, may be acknowledged (i.e., ACK'ed) by the recipient with a response using the same Frame Sequence Number.
The Frame Sequence Number is used for tracking purposes but is not a mandatory feature. If its use is not desired, it should be assigned a value of 0x00.
Transaction Sequence Numbers
While the FSN is exclusively used to ack serial messages, the TSN is used to track request/response frames that are being sent OTA. Either a randomly generated TSN is used(assigned when frame is sent) or you can set a custom TSN when sending a ZCL/ZDO Frame.
Examples
ZDO Command Without Custom TSN:
TX [RHASendZDOUnicast] [F1 04 01 22(FSN) 1C 1C E6 21 00 06 FF(TSN) 15 3C 20 0F 00 00 46 24 00 01 06 00 03 FF 1F 0F 00 00 46 24 00 01 F7 04 ] ( Random TSN of FF used )
RX [RHAZDOSendStatus] [F1 04 03 22(FSN) 02 00 0D(TSN) 38 00 ] ( Send status of success, The ZCL Transaction Sequence Number is assigned to this message, with a valid value in place only if the Status indicates Success )
RX [RHAZDOResponseReceived] [F1 04 05 A7 07 1C E6 21 80 0D(TSN) 01 00 68 02 ] (TSN matches the one assigned in the SendStatus frame)
RX [RHAZDOAPSAcknowledgement] [F1 04 04 A8 02 00 0D(TSN) BF 00 ] (TSN matches the one assigned in the SendStatus frame )
ZDO Command With Custom TSN:
TX [RHASendZDOUnicast] [F1 04 01 22(FSN) 1C 1C E6 21 00 06 0D(TSN) 15 3C 20 0F 00 00 46 24 00 01 06 00 03 FF 1F 0F 00 00 46 24 00 01 F7 04 ] ( Custom TSN of 0D used )
RX [RHAZDOSendStatus] [F1 04 03 22(FSN) 02 00 0D(TSN) 38 00 ] ( Send status of success, The ZCL Transaction Sequence Number is assigned the Custom TSN )
RX [RHAZDOResponseReceived] [F1 04 05 A7 07 1C E6 21 80 0D(TSN) 01 00 68 02 ] (TSN matches the Custom TSN)
RX [RHAZDOAPSAcknowledgement] [F1 04 04 A8 02 00 0D(TSN) BF 00 ] (TSN matches the Custom TSN)
ZCL Command With Custom TSN:
TX [RHASendZCLUnicast] [F1 05 00 4B(FSN) 10 1C E6 01 01 06 00 07 00 10 FF FF 0B(TSN) 00 02 00 00 8C 03 ]
RX [RHAZCLSendStatus] [F1 05 03 4B(FSN) 02 00 0B(TSN) 60 00 ]
RX [RHAZCLResponseReceived] [F1 05 11 CD 12 1C E6 01 01 06 00 00 18 00 00 0B(TSN) 01 05 00 00 00 10 00 38 02 ]
RX [RHAZCLAPSAcknowledgement] [F1 05 10 CE 02 00 0B(TSN) F0 00]