Stentofon Multidrop protocol
From Zenitel Wiki
The STENTOFON Multidrop Datalink Protocol is a master/slave protocol. When the master transmits, all slaves receive the data. Only one slave is allowed to transmit at the time, and only after it has been polled. The master polls all slaves in sequence. A slave is required to respond within 70ms after receiving a poll message.
The following sequences are possible:
Sequence 1:
- Master polls a slave
- Slave has information and transmits it
- Master receives the information and sends an ACK
Sequence 2:
- Master polls a slave
- Slave has no information and transmits an End Of Transmission
Sequence 3:
- Master transmits information to a slave
- Slave receives the information and sends an ACK
If a slave does not receive an ACK from the master it must wait to be polled again before it can re-transmit the message.
The following frames are defined:
- Poll: 0x01 <UINT1 slave node number> <UINT1 checksum> 0xF1
- EndOfTransmit: 0xF1
- Message: 0x02 <UINT1 slave node number> <network layer message 10 - 64 bytes> <UINT1 checksum> 0xF1
- Ack: 0x03 <UINT1 slave node number> <UINT1 checksum> 0xF1
UINT1 stands for Unsigned INTeger of length 1, which is a byte with a value in the range <0, 255>. The value 0xF1 is used as a frame termination and as a EndOfTransmit message. This value cannot be present in the rest of the frame. If a byte value happens to be 0xF1, it is replaced by the sequence 0xF0 0x00. If the value 0xF0 itself is part of the message frame, it is replaced by the sequence 0xF0 0x01.
The checksum is the exclusive or of all preceding bytes, including the header. The checksum is calculated before the substitution of the 0xF0 and 0xF1 byte values. After the checksum is calculated, the following substitutions are done to all bytes in the frames except the trailing 0xF1:
- 0xF0 -> 0xF0 0x01
- 0xF1 -> 0xF0 0x00
The receiving party substitutes the 0xF0 and 0xF1 values back where appropriate.