Binding Table#

EmberZNet binding table API.

See binding-table.h for source code.

Functions#

sl_status_t
sl_zigbee_set_binding(uint8_t index, sl_zigbee_binding_table_entry_t *value)

Set an entry in the binding table by copying the structure pointed to by value into the binding table.

sl_status_t
sl_zigbee_get_binding(uint8_t index, sl_zigbee_binding_table_entry_t *result)

Copy a binding table entry to the structure that the result points to.

sl_status_t

Delete a binding table entry.

bool

Indicate whether any messages are currently being sent using this binding table entry.

sl_802154_short_addr_t

Return the node ID for the binding's destination if the ID is known.

void
sl_zigbee_set_binding_remote_node_id(uint8_t index, sl_802154_short_addr_t id)

Set the node ID for the binding's destination. See sl_zigbee_get_binding_remote_node_id() for a description.

sl_status_t

Delete all binding table entries.

void
sl_zigbee_remote_set_binding_handler(sl_zigbee_binding_table_entry_t *entry, sl_zigbee_zdo_status_t status)

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).

void
sl_zigbee_remote_delete_binding_handler(uint8_t index, sl_zigbee_zdo_status_t status)

Invoked when a remote node requests that a binding be removed from the local binding table (via the ZigBee Device Object at endpoint 0).

sl_status_t
sl_zigbee_set_reply_binding(uint8_t index, sl_zigbee_binding_table_entry_t *entry, sl_802154_short_addr_t source)

Create a binding table entry for the sender of a message, which can be used to send messages to that sender.

sl_status_t
sl_zigbee_note_senders_binding(uint8_t index, sl_802154_short_addr_t source)

Update the routing information associated with a binding table entry for the sender of a message.

Function Documentation#

sl_zigbee_set_binding#

sl_status_t sl_zigbee_set_binding (uint8_t index, sl_zigbee_binding_table_entry_t * value)

Set an entry in the binding table by copying the structure pointed to by value into the binding table.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

The index of a binding table entry.

sl_zigbee_binding_table_entry_t *N/Avalue

A pointer to a structure.

Note

  • You do not need to reserve memory for value.

Returns

  • An ::sl_status_t value that indicates the success or failure of the command.


sl_zigbee_get_binding#

sl_status_t sl_zigbee_get_binding (uint8_t index, sl_zigbee_binding_table_entry_t * result)

Copy a binding table entry to the structure that the result points to.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

The index of a binding table entry.

sl_zigbee_binding_table_entry_t *N/Aresult

A pointer to the location to which to copy the binding table entry.

Returns

  • An ::sl_status_t value that indicates the success or failure of the command.


sl_zigbee_delete_binding#

sl_status_t sl_zigbee_delete_binding (uint8_t index)

Delete a binding table entry.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

The index of a binding table entry.

Returns

  • An ::sl_status_t value that indicates the success or failure of the command.


sl_zigbee_binding_is_active#

bool sl_zigbee_binding_is_active (uint8_t index)

Indicate whether any messages are currently being sent using this binding table entry.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

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 sl_zigbee_binding_table_entry_t structure that defines the binding. The type field should have the value SL_ZIGBEE_UNUSED_BINDING.

Returns

  • True if the binding table entry is active, false otherwise.


sl_zigbee_get_binding_remote_node_id#

sl_802154_short_addr_t sl_zigbee_get_binding_remote_node_id (uint8_t index)

Return the node ID for the binding's destination if the ID is known.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

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 sl_zigbee_note_senders_binding() whenever a message arrives from the binding's destination, or by calling sl_zigbee_set_binding_remote_node_id() 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


sl_zigbee_set_binding_remote_node_id#

void sl_zigbee_set_binding_remote_node_id (uint8_t index, sl_802154_short_addr_t id)

Set the node ID for the binding's destination. See sl_zigbee_get_binding_remote_node_id() for a description.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

The index of a binding table entry.

sl_802154_short_addr_tN/Aid

The ID of the binding's destination.


sl_zigbee_clear_binding_table#

sl_status_t sl_zigbee_clear_binding_table (void )

Delete all binding table entries.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • An ::sl_status_t value that indicates the success or failure of the command.


sl_zigbee_remote_set_binding_handler#

void sl_zigbee_remote_set_binding_handler (sl_zigbee_binding_table_entry_t * entry, sl_zigbee_zdo_status_t status)

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).

Parameters
TypeDirectionArgument NameDescription
sl_zigbee_binding_table_entry_t *N/Aentry

A pointer to a new binding table entry.

sl_zigbee_zdo_status_tN/Astatus

This handler is invoked after a decision has already been made; an application wishing to make the decision itself must implement either sl_zigbee_internal_remote_set_binding_handler (if not using AppFramework), or ::sl_zigbee_af_remote_set_binding_permission_cb if using it. The callback making the decision runs as part of the stack task context, like other callbacks with non-void return values.

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 SL_ZIGBEE_UNICAST_BINDING. The application should set the type as appropriate for the binding's local endpoint and cluster ID.

If the application includes sl_zigbee_internal_remote_set_binding_handler(), the privileged handler making the decision for sl_zigbee_remote_set_binding_handler(), it must define SL_ZIGBEE_APPLICATION_HAS_REMOTE_BINDING_HANDLER in its CONFIGURATION_HEADER and also include sl_zigbee_internal_remote_delete_binding_handler().

Returns


sl_zigbee_remote_delete_binding_handler#

void sl_zigbee_remote_delete_binding_handler (uint8_t index, sl_zigbee_zdo_status_t status)

Invoked when a remote node requests that a binding be removed from the local binding table (via the ZigBee Device Object at endpoint 0).

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

The index of the binding entry to be removed.

sl_zigbee_zdo_status_tN/Astatus

If the application wants to make the decision itself it must implement either sl_zigbee_internal_remote_delete_binding_handler or ::sl_zigbee_af_remote_delete_binding_permission_cb. The application is free to remove the binding from the binding table, ignore the request, or take some other action.

If the application includes sl_zigbee_internal_remote_delete_binding_handler(), it must define SL_ZIGBEE_APPLICATION_HAS_REMOTE_BINDING_HANDLER in its CONFIGURATION_HEADER and also include sl_zigbee_internal_remote_set_binding_handler().

Returns


sl_zigbee_set_reply_binding#

sl_status_t sl_zigbee_set_reply_binding (uint8_t index, sl_zigbee_binding_table_entry_t * entry, sl_802154_short_addr_t source)

Create a binding table entry for the sender of a message, which can be used to send messages to that sender.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

The index of the binding to set.

sl_zigbee_binding_table_entry_t *N/Aentry

A pointer to data for the binding.

sl_802154_short_addr_tN/Asource

Node ID of the message sender

This function is identical to sl_zigbee_set_binding() except that calling it tells the stack that this binding corresponds to the given node ID (intended to be that of a message's sender ). The stack uses this information to associate the sender's routing info with the binding table entry.

Returns

  • An ::sl_status_t value that indicates the success or failure of the command.


sl_zigbee_note_senders_binding#

sl_status_t sl_zigbee_note_senders_binding (uint8_t index, sl_802154_short_addr_t source)

Update the routing information associated with a binding table entry for the sender of a message.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aindex

The index of the binding to update.

sl_802154_short_addr_tN/Asource

Node ID of the message's sender.

This function should be used in place of sl_zigbee_set_reply_binding() when a message arrives from a remote endpoint for which a binding already exists.

Returns

  • An ::sl_status_t value that indicates the success or failure of the command.