Available on crate feature
std only.Expand description
Module for handling PK Command Message IDs.
§Overview
Message ID is a 2-character string used to uniquely identify commands and support the ACK mechanism and retransmission detection in the PK Command protocol.
§Base-94 Encoding Scheme
- Character Set: Printable ASCII characters from
0x21(!) to0x7E(~) - Total Characters: 94 characters
- Encoding Formula:
ID = (c1 - 0x21) * 94 + (c2 - 0x21)c1andc2are the two characters of the MSG ID string
§ID Range and Rollover
- Minimum Value: 0 (represented as
!!) - Maximum Value: 8835 (represented as
~~) - Rollover Mechanism: When ID reaches 8835, the next increment returns 0
§Scope and Lifetime
- IDs are cumulative throughout the entire session
- IDs are NOT reset by
ENDTRcommands - Used for:
- Command tracking: Each command is uniquely identified by its MSG ID
- ACK validation: Receiver must return the same MSG ID in ACKNO response
- Retransmission detection: Receiving the same MSG ID indicates a retransmitted packet
§Special Case: ERROR Command
- ERROR command’s MSG ID is fixed as two space characters (
0x20 0x20) - Its acknowledgement (
ACKNO ERROR) also has MSG ID fixed as two spaces