Binding Table#
EmberZNet binding table API.
See binding-table.h for source code.
Functions#
Set an entry in the binding table by copying the structure pointed to by value
into the binding table.
Copy a binding table entry to the structure that the result
points to.
Delete a binding table entry.
Indicate whether any messages are currently being sent using this binding table entry.
Return the node ID for the binding's destination if the ID is known.
Set the node ID for the binding's destination. See emberGetBindingRemoteNodeId() for a description.
Delete all binding table entries.
A callback invoked when a remote node requests that a binding be added to the local binding table (via the ZigBee Device Object at endpoint 0).
Invoked when a remote node requests that a binding be removed from the local binding table (via the ZigBee Device Object at endpoint 0).
Return a binding index that matches the current incoming message, if known.
Create a binding table entry for the sender of a message, which can be used to send messages to that sender.
Update the routing information associated with a binding table entry for the sender of a message.
Function Documentation#
emberSetBinding#
EmberStatus emberSetBinding (uint8_t index, EmberBindingTableEntry * value)
Set an entry in the binding table by copying the structure pointed to by value
into the binding table.
N/A | index | The index of a binding table entry. |
N/A | value | A pointer to a structure. |
Note
You do not need to reserve memory for
value
.
Returns
An EmberStatus value that indicates the success or failure of the command.
40
of file stack/include/binding-table.h
emberGetBinding#
EmberStatus emberGetBinding (uint8_t index, EmberBindingTableEntry * result)
Copy a binding table entry to the structure that the result
points to.
N/A | index | The index of a binding table entry. |
N/A | result | A pointer to the location to which to copy the binding table entry. |
Returns
An EmberStatus value that indicates the success or failure of the command.
53
of file stack/include/binding-table.h
emberDeleteBinding#
EmberStatus emberDeleteBinding (uint8_t index)
Delete a binding table entry.
N/A | index | The index of a binding table entry. |
Returns
An EmberStatus value that indicates the success or failure of the command.
62
of file stack/include/binding-table.h
emberBindingIsActive#
bool emberBindingIsActive (uint8_t index)
Indicate whether any messages are currently being sent using this binding table entry.
N/A | index | The index of a binding table entry. |
Note that this function does not indicate whether a binding is clear. To determine whether a binding is clear, check the EmberBindingTableEntry structure that defines the binding. The type field should have the value EMBER_UNUSED_BINDING.
Returns
True if the binding table entry is active, false otherwise.
76
of file stack/include/binding-table.h
emberGetBindingRemoteNodeId#
EmberNodeId emberGetBindingRemoteNodeId (uint8_t index)
Return the node ID for the binding's destination if the ID is known.
N/A | index | The index of a binding table entry. |
If a message is sent using the binding and the destination's ID is not known, the stack will discover the ID by broadcasting a ZDO address request. The application can avoid the need for this discovery by calling emberNoteSendersBinding() whenever a message arrives from the binding's destination, or by calling emberSetBindingRemoteNodeId() when it knows the correct ID via some other means, such as having saved it in nonvolatile memory.
The destination's node ID is forgotten when the binding is changed, when the local node reboots or, much more rarely, when the destination node changes its ID in response to an ID conflict.
Returns
The short ID of the destination node or EMBER_NULL_NODE_ID if no destination is known.
99
of file stack/include/binding-table.h
emberSetBindingRemoteNodeId#
void emberSetBindingRemoteNodeId (uint8_t index, EmberNodeId id)
Set the node ID for the binding's destination. See emberGetBindingRemoteNodeId() for a description.
N/A | index | The index of a binding table entry. |
N/A | id | The ID of the binding's destination. |
108
of file stack/include/binding-table.h
emberClearBindingTable#
EmberStatus emberClearBindingTable (void )
Delete all binding table entries.
N/A |
Returns
An EmberStatus value that indicates the success or failure of the command.
115
of file stack/include/binding-table.h
emberRemoteSetBindingHandler#
EmberZdoStatus emberRemoteSetBindingHandler (EmberBindingTableEntry * entry)
A callback invoked when a remote node requests that a binding be added to the local binding table (via the ZigBee Device Object at endpoint 0).
N/A | entry | A pointer to a new binding table entry. |
The application is free to add the binding to the binding table, ignore the request, or take some other action. It is recommended that nonvolatile bindings be used for remote provisioning applications.
The binding's type defaults to EMBER_UNICAST_BINDING. The application should set the type as appropriate for the binding's local endpoint and cluster ID.
If the application includes emberRemoteSetBindingHandler(), it must define EMBER_APPLICATION_HAS_REMOTE_BINDING_HANDLER in its CONFIGURATION_HEADER and also include emberRemoteDeleteBindingHandler().
Returns
EMBER_ZDP_SUCCESS if the binding was added to the table EMBER_ZDP_NOT_AUTHORIZED if permission was denied or binding is active EMBER_ZDP_INVALID_ENDPOINT if the endpoint is 0 or in the reserved range EMBER_ZDP_TABLE_FULL if there is no more space in the binding table
141
of file stack/include/binding-table.h
emberRemoteDeleteBindingHandler#
EmberZdoStatus emberRemoteDeleteBindingHandler (uint8_t index)
Invoked when a remote node requests that a binding be removed from the local binding table (via the ZigBee Device Object at endpoint 0).
N/A | index | The index of the binding entry to be removed. |
The application is free to remove the binding from the binding table, ignore the request, or take some other action.
If the application includes emberRemoteDeleteBindingHandler(), it must define EMBER_APPLICATION_HAS_REMOTE_BINDING_HANDLER in its CONFIGURATION_HEADER and also include emberRemoteSetBindingHandler().
Returns
EMBER_ZDP_SUCCESS if the binding was removed from the table EMBER_ZDP_NOT_AUTHORIZED if permission was denied or binding is active EMBER_INVALID_ENDPOINT if the endpoint is 0 or in the reserved range EMBER_ZDP_NO_ENTRY if the binding doesn't exist
162
of file stack/include/binding-table.h
emberGetBindingIndex#
uint8_t emberGetBindingIndex (void )
Return a binding index that matches the current incoming message, if known.
N/A |
A binding matches the incoming message if:
The binding's source endpoint is the same as the message's destination endpoint.
The binding's destination endpoint is the same as the message's source endpoint.
The source of the message has been previously identified as the the binding's remote node by a successful address discovery or by the application via a call to either emberSetReplyBinding() or emberNoteSendersBinding().
Note
This function can be called only from within emberIncomingMessageHandler().
Returns
The index of a binding that matches the current incoming message or
0xFF
if there is no matching binding.
184
of file stack/include/binding-table.h
emberSetReplyBinding#
EmberStatus emberSetReplyBinding (uint8_t index, EmberBindingTableEntry * entry)
Create a binding table entry for the sender of a message, which can be used to send messages to that sender.
N/A | index | The index of the binding to set. |
N/A | entry | A pointer to data for the binding. |
This function is identical to emberSetBinding() except that calling it tells the stack that this binding corresponds to the sender of the current message. The stack uses this information to associate the sender's routing info with the binding table entry. Note
This function may only be called from within emberIncomingMessageHandler().
Returns
An EmberStatus value that indicates the success or failure of the command.
203
of file stack/include/binding-table.h
emberNoteSendersBinding#
EmberStatus emberNoteSendersBinding (uint8_t index)
Update the routing information associated with a binding table entry for the sender of a message.
N/A | index | The index of the binding to update. |
This function should be used in place of emberSetReplyBinding() when a message arrives from a remote endpoint for which a binding already exists.
Returns
An EmberStatus value that indicates the success or failure of the command.
216
of file stack/include/binding-table.h