Packet Type Byte - Mantracourt T24-BSi Technical Manual

T24 series
Hide thumbs Also See for T24-BSi:
Table of Contents

Advertisement

'reads from buffer
DIM CRC AS LONG
DIM LSB AS INTEGER
DIM C AS LONG
DIM D AS INTEGER
DIM Res(1) AS BYTE
CRC = 65535
FOR C = 1 TO LEN(sTarget)
'xor byte
CRC = CRC XOR ASC(MID$(sTarget, C, 1))
FOR D = 1 TO 8
'get lsb
LSB = (CRC AND 1) = 1
'move right
CRC = INT(CRC / 2)
'if LSB was 1 xor with polynomial
IF LSB THEN CRC = CRC XOR (&HA001&)
NEXT D
NEXT C
sTarget = sTarget & CHR$((CRC AND 255))
sTarget = sTarget & CHR$(INT(CRC / 256))
END SUB

Packet Type Byte

The Packet Type bytes indicates the type of packet and holds information regarding Error, Low Battery and
Broadcast status of received packets.
bit7
bit 6
Error
LoBatt
0
0
Bit
Function
Bit indicated an error is present.
Error
This is set and reset by the
device which will include this
information in the packet sent to
the module.
Bit indicated a low battery. This
LoBatt
is set and reset by the device
which will include this
information in the packet sent to
the module.
Used to indicate that a routed
Broadcast
packet was broadcast so the
receiver knows not to respond.
7
Mantracourt Electronics Limited T24 Technical Manual
bit 5
bit 4
Broadcast
0
0
bit 3
bit 2
0
Value
Type
3
Data Provider
5
Read
6
Write/command
7
Response ACK
8
Response NAK
9
Response
Timeout
10
Response Data
Invalid
bit 1
Packet Type
0
0
Description
Used to provide
unrequested data.
Read data from a specific
device.
Write a value or execute a
command to a specific
device
Response - Acknowledged.
May also contain data.
Response - Not
Acknowledged. The
command was not
recognised.
Response Timed out. A
response was not received
by the device.
Response – Data invalid.
The device has reported
that the data in a Write was
invalid or out of range.
bit 0
0

Advertisement

Table of Contents
loading

Table of Contents