Westermo GD-01 User Manual

Page 177

Advertising
background image

177

6196-2220

Data packets

Like for AT commands, DATA are encapsulated into packets.
These packets are composed of a header (3 bytes),
the data bytes and the checksum (1 byte):

Start pattern 0xDD

.........................................................................................................................

Bit 0-7

Data packet length LSB

................................................................................................................

Bit 0-7

Data packet length MSB / Data packet type

........................................................

Bit 0-2/ Bit 3-7

Data Bytes

..................................................................................................................................................

Bit 0-7

Checksum

...................................................................................................................................................

Bit 0-7

The 3 bytes of the header are:

• the first byte (0xDD) used to identify the packet,

• the second byte represents the 8 LSB bits of the length of the data field,

• the last byte is made of 2 parts :

• the 3 LSB bits represent the 3 MSB bits of the length of the data field,

• the 5 MSB bits represent the packet type.

Data packets can have different values according to the type of packet:

• 0 – DATA packet: the packet contains the data to transmit on the radio link or

received from the radio link,

• 1 – STATUS packet: the packet contains the status of SA (DTR), SB (RTS), X bits( ) and

the break condition coding as follow :

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

SA

SB

X

BRK

RI

Spare

Spare

Spare

• the length of data for the status packet is always equal to 1,

• whenever a status changes (except break), all the status bits are included,

• these bits are off by default (and therefore the bits DTR and RTS), so it is necessary to

send a status packet to the target at the beginning of the multiplexing to start the
transmission,

• 2 – READY packet: the packet indicates that the target is ready to receive data:

– no data are transmitted in this packet (so the length is null),

• 3 – BUSY packet: the packet indicates that the target is busy and can not receive data:

– like the ready packet, no data are transmitted,

• other values currently, these values are not used (reserved for future enhancement).

The checksum is calculated like the AT command packet checksum (addition of all the
transmitted bytes including the header bytes).

B A C K

Advertising