Documentation

Packet Structure

This document describes how OSDP packets are built and decoded.

All OSDP packets must have the following 5 bytes.

ByteNameMeaningValue
0SOMStart of Message0x53
1ADDRPhysical Address of the PD0x00–0x7E
2LEN_LSBPacket Length Least Significant ByteAny
3LEN_MSBPacket Length Most Significant ByteAny
4CTRLMessage Control InformationSee below

Message Control Information

The CTRL byte at offset 4 is a bit mask:

BitMaskNameMeaning
0–10x03SQNPacket sequence number
20x04CKSUM / CRCSet: 16-bit CRC; Clear: 8-bit CHECKSUM
30x08SCBSet: SCB is present; Clear: SCB is absent

SCB is the Security Control Block presence indicator. It is an optional blockpresent in secure channel messages.

Security Control Block (Optional)

ByteNameMeaningValue
5SEC_BLK_LENLength of Security Control BlockAny
6SEC_BLK_TYPESecurity Block TypeSee below
7 – m-1SEC_BLK_DATASecurity Block DataBased on type

Command/Reply Structure

The Command/Reply block is mandatory. If no SCB is present, it follows directlyafter the fixed header; otherwise it is offset by the SCB length.

ByteNameMeaningValue
5CMND/REPLYCommand or Reply CodeSee CMD/REPLY
6 – nDATA(optional) Data BlockBased on CMD/REPLY

Message Authentication Code (Optional)

Present in secure channel messages. These 4 bytes appear just before theCRC/CKSUM bytes.

ByteNameMeaningValue
n-6MAC[0]Message Authentication Code Byte 0Any
n-5MAC[1]Message Authentication Code Byte 1Any
n-4MAC[2]Message Authentication Code Byte 2Any
n-3MAC[3]Message Authentication Code Byte 3Any

Packet Validation

The last 2 bytes (or 1 byte if CKSUM mode is selected in the CTRL bit mask):

ByteNameMeaningValue
n-2CKSUM/CRC_LSBChecksum, or CRC-16 Least Significant ByteCKSUM/CRC
n-1CRC_MSB(optional) CRC-16 Most Significant ByteCKSUM/CRC