User manual

AOAA Kit Software User’s Guide
Page 42
Copyright 2012 © Embedded Artists AB
Value: The value being set. The actual number of bytes and how to interpret this field is
capability specific.
7.6 Subscribe Message
The Subscribe message is a request to start a subscription of value changes for a specific Node
capability.
Dest Addr: Address of the Node that will receive the Subscribe message.
Src Addr: Address of the node sending the Subscribe message.
Act: The flag field is called Act since it defines the subscribe action, see section 7.6.1 for
details.
Msg ID: 0x03
Cap: The ID of the capability, see section 7.11 for a list of defined capabilities.
Value: The value is related to the subscribe action.
7.6.1 Subscribe actions
The subscribe action defines which kind of value change that is of interest for the subscriber, for
example, the subscriber wants to know when the capability value is greater than X (where X is
specified in the Value field of the message). Below is a list of supported subscribe actions.
Action
Value (Act)
Description
Greater Than
0x1
Publish value if it is greater than X
Less Than
0x2
Publish value if it is less than X
Difference
0x3
Publish value if it is different than X
7.6.2 Subscribe Response
The node that receives a Subscribe message and accepts this message must respond with an
allocated subscription ID. This ID can then be used by the subscriber to issue an Unsubscribe request.
The Subscribe message ID is used for the response, but the Flag/Act field has the value 0xF.
7.7 Unsubscribe Message
The Unsubscribe message is a request to cancel an ongoing subscription. The subscription ID
received in the subscribe response must be used when unsubscribing.
Dest Addr
Src Addr
Flags
Msg ID
1 byte
0x4
11 bits
0x0
Sub ID
1 byte
Dest Addr
Src Addr
Act
Msg ID
1 byte
0x3
11 bits
0xF
Dest Addr
Src Addr
Act
Msg ID
Value
1 byte
0x3
1-5 bytes
11 bits
4 bits
Cap
1 byte