Documentation
Introduction
OSDP describes the communication protocol for interfacing one or more PeripheralDevices (PD) to a Control Panel (CP). The OSDP specification describes theprotocol over a two-wire RS-485 multi-drop serial communication channel.Nevertheless, this protocol can be used to transfer secure data over anyphysical channel.
LibOSDP complies with v2.2 of the OSDP specification. This page pulls excerptsfrom the specification that are crucial to understanding the protocol.
Physical Interface
Half-duplex RS-485 — one twisted pair, shield/signal ground.
Signaling
Half-duplex asynchronous serial: 8 data bits, 1 stop bit, no parity bits, withany one of the following baud rates: 9600, 19200, 38400, 57600, 115200, or230400.
Character Encoding
The complete 8-bit character is used. All possible bit patterns may appearwithin a message.
Channel Access
The communication channel is used in "interrogation/reply" mode. Only the CPmay spontaneously send a message. Each message sent by the CP is addressed toone and only one PD.
Timing
The transmitting device must guarantee a gap of at least two character timesbefore accessing the communication channel. This idle-line delay is required toallow signal converters and/or multiplexers to sense that the line has becomeidle.
The PD must send a single reply to each addressed message within 200 ms. If thePD is temporarily unable to process a command, it must send osdp_BUSY. Whenthe CP receives osdp_BUSY, it may re-send the same command as if it had timedout.
The typical REPLY_DELAY should be less than 3 milliseconds. If a device isoverwhelmed it can send a BUSY message.
Message Synchronization
A PD obtains message synchronization by waiting for an inter-character timeoutand then looking for a Start-Of-Message (SOM) code. The device receives andstores at least the header fields while computing the checksum/CRC. If thechecksum is valid, only the PD matching the address field processes the message;all other PDs monitor the packet by counting the remaining bytes to anticipatethe start of the next packet.
An inter-character timeout while receiving aborts the receive sequence, afterwhich the PD re-syncs using the method above. The nominal inter-charactertimeout is 20 milliseconds.
Packet Structure
See the packet structure documentation.
Peripheral Device Capabilities
OSDP PDs must advertise a list of predefined capabilities to the CP in responseto the osdp_PDCAP command. See thecomprehensive list of PD capabilities.