Messages are exchanged between devices (including central units) by way of message frames sent out by a device (source). These messages can be received by any other device. Depending on the destination address and configuration of the receiving device, it will decide how to handle the message:
Every device is addressed by a unique 3-byte ID (aka 'HM-ID'). This address is usually expressed in hexadezimal form, ommiting any hex denominating prefix commonly used in programming languages (prefix '0x'). Valid device IDs range from 000001
to FFFFFE
. ID 000000
is reserved as broadcast address when sending out data frames that do not require acknowledgement.
All message frames follow the same structure with a fixed-length message header and a variable-length payload:
| Message Header | Payload -------------+-------------------------------------------------------------------------------+---------------------------------- Index | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ... | Len-1 -------------+-------+-------+-------+-------+-----------------------+-----------------------+---------------------------------- Description | Len | Count | Flags | Type | Source-Address | Destination-Address | (depending on message type)
Length of the complete message frame, including header and payload. Maximum allowed length is 26.
Message frame counter, incremented by the source device each time a message is sent.
Message status flags, for more information see Message Flags
Defines how the payload is to be interpreted. For more details, see message_type
3-Byte address of the source device. Often referred to as HMID.
3-Byte address of the destination. Broadcasts are addressed to 000000. Also see HMID.
Carries the information transported by the message frame. Payload content is to be interpreted according to the message_type
The message flags byte carries status information relevant for protocol handling. It comprises the following bits:
The message type defines how the payload oof the message is to be interpreted.
Write much more about message types.
Decide if every message type should have its own subsubsection
Device properties are organized in form of channels, with special channel 0 that represents the device entity that communicates with others and at least one more channel that represents a sensor, actuator, or alike.
Seen from the protocol prespective, the configuration of a device is represented in form of registers each of which has an ID for identification and a one-byte-content that affects the behavior of the device. Registers are solely used for configuration purposes. Static information that is hardcoded into the device software, like serial number or HMID, is not represented by registers but can be queried using special messages.
Often, register specifications are written as a list of ID:VALUE pairs:
List0: 02:01 05:00 0A:AB 0B:CD 0C:EF 14:05 24:05 25:DC 26:05 27:03 00:00
This example shows that the device is paired to ID 'ABCDEF', represented by registers 0A, 0B and 0C.
A device organizes registers in the context of lists that are used for specific purposes:
Represents the device configuration. Each device has exactly one instance of this list and it is associated with channel 0.
Represents per-channel configuration. Each channel of a device must have a List1 and one of List3 or List4.
In the NewAskSin framework, registers are defined