Echelon LonTal Stack User Manual

Page 53

Advertising
background image

LonTalk Stack Developer’s Guide

41

The packet sum is an 8-bit value that, when added to the first three bytes, results

in an 8-bit zero result.

The code packet hast the following features:
• Asynchronous method of presenting itself at any time (by using an escape

sequence).

• Checksum verification.
• Data transfer initiation.
• Duplication detection using a sequence number. Duplicates may be sent

when an expected response is lost or broken and does not occur within a

time-out period.

Data outside of the code packet is restricted to either a message or a multi-byte
local network interface command or response
and is always enclosed with a length

byte in the front and a checksum at the end. The length byte does not account for
the checksum at the end—the inclusion of the checksum is implied. The

checksum covers the data that preceded it; therefore, it does include the length

byte.

Note: All data outside a code packet must include an escape prefix before any

escape data values. For example, if a 0x7E value appears in the sequence it must

be followed by another 0x7E (the first 0x7E value is the escape prefix).
Checksum bytes and length bytes must be preceded with escape prefixes.
The following table summarizes the layout of the data message used in Layer 5

mode and for the niNETMGMT local network interface command (Layer 2 mode
is required for the LonTalk Stack). When sending local network interface

commands (NI Commands other than the niCOMM or niNETMGMT) that have
additional data, the commands are contained in a data message and they are

preceded by a CpMsg code packet.

BYTE 0

BYTE 1

BYTE 2..N

BYTE N+1

Length
(bytes to

follow
except
checksum)

NI
Command

SICB starting w/ message header

Message
Checksum

of bytes 0-N

The following table summarizes the layout of the data message used in Layer 2
mode.

BYTE 0

BYTE 1

BYTE 2..N

BYTE N+1

Length
(bytes to

follow
except
checksum)

NI
Command

Priority/AltPath/DeltaBacklog byte,
NPDU,

CRC (2 Bytes)

Message
Checksum

of bytes 0-N

Advertising