-
Notifications
You must be signed in to change notification settings - Fork 2
OSNP Application Layer
##Scope
The OSNP application layer defines the way a hub and a device communicate with each other at the application level. This includes the format of the message itself and the type of command/responses exchanged between the parties.
##Introduction
All data structures defined in this specification are encoded using ASN.1 and more specifically the X.690 standard using the BER format. More details can be found here.
A short summary of the standard is that all data types are formatted in the TLV format (Tag-Length-Value), where the tag expresses the kind of data. This is followed by its length and value. TLVs can be nested (this is indicated in the tag), and the meaning of the tag can be dependent on its location in the structure.
##Packets
An unit of data in the application layer is called a packet. There are three kinds of packets:
- Command Packet: sent from the Hub to the Device containing one or more commands.
- Response Packet: sent from the Device to the Hub in relation to a previously sent command packet. It contains a response for each for the commands in the command packet, in the same order in which they were sent.
- Notification Packet: sent from the Device to the Hub spontaneously to notify of it of one or more events. The Hub can subscribe to different kind of notifications from the device, but the Hub should tolerate (eventually ignore) unsolicited notifications.
Each of this packet is represented by a constructed TLV. The tag for each of them is:
- Command Packet: 0xE0
- Response Packet: 0xE1
- Notification Packet: 0xE2