See Binding Table for documentation.

License#

Copyright 2018 Silicon Laboratories Inc. www.silabs.com

The licensor of this software is Silicon Laboratories Inc. Your use of this software is governed by the terms of Silicon Labs Master Software License Agreement (MSLA) available at www.silabs.com/about-us/legal/master-software-license-agreement. This software is distributed to you in Source Code format and is governed by the sections of the MSLA applicable to Source Code.

/***************************************************************************/
#ifndef SILABS_BINDING_TABLE_H
#define SILABS_BINDING_TABLE_H

#include "stack/include/sl_zigbee_types.h"

sl_status_t sl_zigbee_set_binding(uint8_t index, sl_zigbee_binding_table_entry_t *value);

sl_status_t sl_zigbee_get_binding(uint8_t index,
                                  sl_zigbee_binding_table_entry_t *result);

sl_status_t sl_zigbee_delete_binding(uint8_t index);

bool sl_zigbee_binding_is_active(uint8_t index);

sl_802154_short_addr_t sl_zigbee_get_binding_remote_node_id(uint8_t index);

void sl_zigbee_set_binding_remote_node_id(uint8_t index, sl_802154_short_addr_t id);

sl_status_t sl_zigbee_clear_binding_table(void);

void sl_zigbee_remote_set_binding_handler(sl_zigbee_binding_table_entry_t *entry, sl_zigbee_zdo_status_t status);

void sl_zigbee_remote_delete_binding_handler(uint8_t index, sl_zigbee_zdo_status_t status);

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

sl_status_t sl_zigbee_note_senders_binding(uint8_t index, sl_802154_short_addr_t source);

#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Set or get the binding table size
sl_status_t sl_zigbee_set_binding_table_size(uint8_t size);
uint8_t sl_zigbee_get_binding_table_size(void);

//Privileged callbacks for remote node requests to add/delete a binding.
sl_zigbee_zdo_status_t sl_zigbee_internal_remote_set_binding_handler(sl_zigbee_binding_table_entry_t *entry);
sl_zigbee_zdo_status_t sl_zigbee_internal_remote_delete_binding_handler(uint8_t index);
#endif

#endif // SILABS_BINDING_TABLE_H

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
N/Aindex

The index of a binding table entry.

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.


Definition at line 42 of file stack/include/binding-table.h

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
N/Aindex

The index of a binding table entry.

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.


Definition at line 58 of file stack/include/binding-table.h

sl_zigbee_delete_binding#

sl_status_t sl_zigbee_delete_binding (uint8_t index)

Delete a binding table entry.

Parameters
N/Aindex

The index of a binding table entry.

Returns

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


Definition at line 68 of file stack/include/binding-table.h

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
N/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.


Definition at line 82 of file stack/include/binding-table.h

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
N/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


Definition at line 105 of file stack/include/binding-table.h

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
N/Aindex

The index of a binding table entry.

N/Aid

The ID of the binding's destination.


Definition at line 114 of file stack/include/binding-table.h

sl_zigbee_clear_binding_table#

sl_status_t sl_zigbee_clear_binding_table (void )

Delete all binding table entries.

Parameters
N/A

Returns

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


Definition at line 121 of file stack/include/binding-table.h

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
N/Aentry

A pointer to a new binding table entry.

N/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


Definition at line 155 of file stack/include/binding-table.h

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
N/Aindex

The index of the binding entry to be removed.

N/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


Definition at line 179 of file stack/include/binding-table.h

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
N/Aindex

The index of the binding to set.

N/Aentry

A pointer to data for the binding.

N/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.


Definition at line 198 of file stack/include/binding-table.h

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
N/Aindex

The index of the binding to update.

N/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.


Definition at line 215 of file stack/include/binding-table.h