The master include file for the Ember ApplicationFramework API.
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_AF_API
#define SILABS_AF_API
#ifdef __cplusplus
extern "C" {
#endif
// Micro and compiler-specific typedefs and macros
#include PLATFORM_HEADER
#ifndef CONFIGURATION_HEADER
#define CONFIGURATION_HEADER "app/framework/util/config.h"
#endif
#include CONFIGURATION_HEADER
// The ZCL Long String type data type takes first 2 bytes as the length
// And the sl_zigbee_af_read_attribute takes an uint8_t as the output length.
// So, it is important to ensure the largest value is less than the 253.
// NOTE : SL_MIN is not used instead following MIN is created using macro comparison.
// because, SL_MIN for GCC expands to creating variable of same type using __typeof__,
// assigning the supplied values and comparing, which causes a gcc error
// "error: variable length array declaration not allowed at file scope" for unit tests
// where ZCL_ATTRIBUTE_MAX_DATA_SIZE used in definition local arrays for attribute
// inside a function.
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define ZCL_ATTRIBUTE_MAX_DATA_SIZE MIN(ZCL_ATTRIBUTE_LARGEST, 253)
// Includes needed for ember related functions for the EZSP host
#include "stack/include/sl_zigbee_types.h"
#include "stack/include/sl_zigbee_random_api.h"
#ifdef EZSP_HOST
#include "app/util/ezsp/ezsp-protocol.h"
#include "app/util/ezsp/ezsp.h"
#include "app/util/ezsp/ezsp-utils.h"
#include "app/util/ezsp/serial-interface.h"
#else
// Includes needed for ember related functions for the SoC
#include "stack/include/sl_zigbee.h"
#endif // EZSP_HOST
#include "hal/hal.h"
#include "event_queue/event-queue.h"
#include "app/framework/include/af-types.h"
#include "app/framework/util/print.h"
#include "app/framework/util/time-util.h"
#ifdef SL_COMPONENT_CATALOG_PRESENT
#include "sl_component_catalog.h"
#ifdef SL_CATALOG_ZIGBEE_ZCL_FRAMEWORK_CORE_PRESENT
#include "zcl-framework-core-config.h"
#endif // SL_CATALOG_ZIGBEE_ZCL_FRAMEWORK_CORE_PRESENT
#ifdef SL_CATALOG_BYTE_UTILITIES_PRESENT
#include "byte-utilities.h"
#endif // SL_CATALOG_BYTE_UTILITIES_PRESENT
#ifdef SL_CATALOG_ZIGBEE_TEST_HARNESS_Z3_PRESENT
extern void sl_zigbee_af_test_harness_z3_beacon_send_event_handler(sl_zigbee_af_event_t * event);
extern void sl_zigbee_af_test_harness_z3_open_network_event_handler(sl_zigbee_af_event_t * event);
extern void sl_zigbee_af_test_harness_z3_reset_key_event_handler(sl_zigbee_af_event_t * event);
extern void sl_zigbee_af_test_harness_z3_zdo_send_event_handler(sl_zigbee_af_event_t * event);
extern void sl_zigbee_af_test_harness_z3_zll_stuff_event_handler(sl_zigbee_af_event_t * event);
extern void sl_zigbee_af_test_harness_z3_reset_event_handler(sl_zigbee_af_event_t * event);
#endif //SL_CATALOG_ZIGBEE_TEST_HARNESS_Z3_PRESENT
#endif // SL_COMPONENT_CATALOG_PRESENT
#ifdef SL_CATALOG_CLI_PRESENT
#include "sl_cli.h"
#define SL_CLI_COMMAND_ARG sl_cli_command_arg_t * arguments
#else // !SL_CATALOG_CLI_PRESENT
#define SL_CLI_COMMAND_ARG void
#endif // SL_CATALOG_CLI_PRESENT
#if defined(SL_CATALOG_ZIGBEE_DEBUG_PRINT_PRESENT) && !defined(SL_ZIGBEE_SCRIPTED_TEST)
#include "sl_zigbee_debug_print.h"
#endif // SL_CATALOG_ZIGBEE_DEBUG_PRINT_PRESENT
#include "serial/serial.h"
#include "sl_endianness.h"
// Temporary fix for UC_ALPHA_2, see EMZIGBEE-6782
#include "plugin-component-mappings.h"
#include "af-storage.h"
#include "zap-command.h"
#include "zap-id.h"
#include "zap-print.h"
#include "zap-enabled-incoming-commands.h"
#include "zap-type.h"
#include "app/framework/common/sl_zigbee_system_common.h"
#include "app/framework/util/util.h"
#include "app/framework/util/global-callback.h"
#include "app/framework/util/global-other-callback.h"
#include "app/framework/service-function/sl_service_function.h"
#include "app/framework/util/zcl-debug-print.h"
#include "app/framework/util/client-api.h"
#include "app/util/serial/sl_zigbee_command_interpreter.h"
extern uint8_t ascii_lut[];
// @{
sl_zigbee_af_attribute_metadata_t *sl_zigbee_af_locate_attribute_metadata(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId,
sl_zigbee_af_attribute_id_t attributeId,
uint8_t mask,
uint16_t manufacturerCode);
#ifdef DOXYGEN_SHOULD_SKIP_THIS
bool sl_zigbee_af_contains_attribute(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId,
sl_zigbee_af_attribute_id_t attributeId,
uint8_t mask,
uint16_t manufacturerCode);
#else
#define sl_zigbee_af_contains_attribute(endpoint, clusterId, attributeId, mask, manufacturerCode) \
(sl_zigbee_af_locate_attribute_metadata(endpoint, clusterId, attributeId, mask, manufacturerCode) != NULL)
#endif
bool sl_zigbee_af_contains_cluster_with_mfg_code(uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint16_t manufacturerCode);
bool sl_zigbee_af_contains_cluster(uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId);
bool sl_zigbee_af_contains_server_with_mfg_code(uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint16_t manufacturerCode);
bool sl_zigbee_af_contains_server(uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId);
bool sl_zigbee_af_contains_client_with_mfg_code(uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint16_t manufacturerCode);
bool sl_zigbee_af_contains_client(uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId);
sl_zigbee_af_status_t sl_zigbee_af_write_attribute(uint8_t endpoint,
sl_zigbee_af_cluster_id_t cluster,
sl_zigbee_af_attribute_id_t attributeID,
uint8_t mask,
uint8_t* dataPtr,
sl_zigbee_af_attribute_type_t dataType);
sl_zigbee_af_status_t sl_zigbee_af_write_server_attribute(uint8_t endpoint,
sl_zigbee_af_cluster_id_t cluster,
sl_zigbee_af_attribute_id_t attributeID,
uint8_t* dataPtr,
sl_zigbee_af_attribute_type_t dataType);
sl_zigbee_af_status_t sl_zigbee_af_write_client_attribute(uint8_t endpoint,
sl_zigbee_af_cluster_id_t cluster,
sl_zigbee_af_attribute_id_t attributeID,
uint8_t* dataPtr,
sl_zigbee_af_attribute_type_t dataType);
sl_zigbee_af_status_t sl_zigbee_af_write_manufacturer_specific_server_attribute(uint8_t endpoint,
sl_zigbee_af_cluster_id_t cluster,
sl_zigbee_af_attribute_id_t attributeID,
uint16_t manufacturerCode,
uint8_t* dataPtr,
sl_zigbee_af_attribute_type_t dataType);
sl_zigbee_af_status_t sl_zigbee_af_write_manufacturer_specific_client_attribute(uint8_t endpoint,
sl_zigbee_af_cluster_id_t cluster,
sl_zigbee_af_attribute_id_t attributeID,
uint16_t manufacturerCode,
uint8_t* dataPtr,
sl_zigbee_af_attribute_type_t dataType);
sl_zigbee_af_status_t sl_zigbee_af_verify_attribute_write(uint8_t endpoint,
sl_zigbee_af_cluster_id_t cluster,
sl_zigbee_af_attribute_id_t attributeID,
uint8_t mask,
uint16_t manufacturerCode,
uint8_t* dataPtr,
sl_zigbee_af_attribute_type_t dataType);
sl_zigbee_af_status_t sl_zigbee_af_read_attribute(uint8_t endpoint,
sl_zigbee_af_cluster_id_t cluster,
sl_zigbee_af_attribute_id_t attributeID,
uint8_t mask,
uint8_t* dataPtr,
uint8_t readLength,
sl_zigbee_af_attribute_type_t* dataType);
sl_zigbee_af_status_t sl_zigbee_af_read_server_attribute(uint8_t endpoint,
sl_zigbee_af_cluster_id_t cluster,
sl_zigbee_af_attribute_id_t attributeID,
uint8_t* dataPtr,
uint8_t readLength);
sl_zigbee_af_status_t sl_zigbee_af_read_client_attribute(uint8_t endpoint,
sl_zigbee_af_cluster_id_t cluster,
sl_zigbee_af_attribute_id_t attributeID,
uint8_t* dataPtr,
uint8_t readLength);
sl_zigbee_af_status_t sl_zigbee_af_read_manufacturer_specific_server_attribute(uint8_t endpoint,
sl_zigbee_af_cluster_id_t cluster,
sl_zigbee_af_attribute_id_t attributeID,
uint16_t manufacturerCode,
uint8_t* dataPtr,
uint8_t readLength);
sl_zigbee_af_status_t sl_zigbee_af_read_manufacturer_specific_client_attribute(uint8_t endpoint,
sl_zigbee_af_cluster_id_t cluster,
sl_zigbee_af_attribute_id_t attributeID,
uint16_t manufacturerCode,
uint8_t* dataPtr,
uint8_t readLength);
uint8_t sl_zigbee_af_get_data_size(uint8_t dataType);
uint8_t sl_zigbee_af_get_open_network_duration_sec(void);
#define sl_zigbee_af_cluster_is_manufacturer_specific(cluster) ((cluster)->clusterId >= 0xFC00u)
#define sl_zigbee_af_attribute_is_read_only(metadata) (((metadata)->mask & ATTRIBUTE_MASK_WRITABLE) == 0)
#define sl_zigbee_af_attribute_is_client(metadata) (((metadata)->mask & ATTRIBUTE_MASK_CLIENT) != 0)
#define sl_zigbee_af_attribute_is_tokenized(metadata) (metadata != NULL && (((metadata)->mask & ATTRIBUTE_MASK_TOKENIZE) != 0))
#define sl_zigbee_af_attribute_is_external(metadata) (((metadata)->mask & ATTRIBUTE_MASK_EXTERNAL_STORAGE) != 0)
#define sl_zigbee_af_attribute_is_singleton(metadata) (((metadata)->mask & ATTRIBUTE_MASK_SINGLETON) != 0)
#define sl_zigbee_af_attribute_is_manufacturer_specific(metadata) (((metadata)->mask & ATTRIBUTE_MASK_MANUFACTURER_SPECIFIC) != 0)
#define sl_zigbee_af_attribute_size(metadata) ((metadata)->size)
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
// master array of all defined endpoints
extern sl_zigbee_af_defined_endpoint_t sli_zigbee_af_endpoints[];
#ifdef SL_CATALOG_ZIGBEE_TEST_HARNESS_Z3_PRESENT
// Master array of all zigbee PRO networks - not 'const', since the
// node type may be changed at run-time.
extern sli_zigbee_af_zigbee_pro_network sli_zigbee_af_zigbee_pro_networks[];
// The current zigbee PRO network or NULL.
extern sli_zigbee_af_zigbee_pro_network *sli_zigbee_af_current_zigbee_pro_network;
#else
// Master array of all Zigbee PRO networks.
extern const sli_zigbee_af_zigbee_pro_network sli_zigbee_af_zigbee_pro_networks[];
// The current Zigbee PRO network or NULL.
extern const sli_zigbee_af_zigbee_pro_network *sli_zigbee_af_current_zigbee_pro_network;
#endif
// True if the current network is a Zigbee PRO network.
#define sli_zigbee_af_pro_is_current_network() (sli_zigbee_af_current_zigbee_pro_network != NULL)
#endif
uint8_t sl_zigbee_af_endpoint_from_index(uint8_t index);
uint8_t sl_zigbee_af_index_from_endpoint(uint8_t endpoint);
uint8_t sl_zigbee_af_index_from_endpoint_including_disabled_endpoints(uint8_t endpoint);
uint8_t sl_zigbee_af_find_cluster_client_endpoint_index(uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId);
uint8_t sl_zigbee_af_find_cluster_server_endpoint_index(uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId);
#define sl_zigbee_af_profile_id_from_index(index) (sli_zigbee_af_endpoints[(index)].profileId)
#define sl_zigbee_af_device_id_from_index(index) (sli_zigbee_af_endpoints[(index)].deviceId)
#define sl_zigbee_af_device_version_from_index(index) (sli_zigbee_af_endpoints[(index)].deviceVersion)
#define sl_zigbee_af_network_index_from_endpoint_index(index) (sli_zigbee_af_endpoints[(index)].networkIndex)
uint8_t sl_zigbee_af_network_index_from_endpoint(uint8_t endpoint);
#define sl_zigbee_af_primary_profile_id() sl_zigbee_af_profile_id_from_index(0)
#define sl_zigbee_af_primary_endpoint() (sli_zigbee_af_endpoints[0].endpoint)
uint8_t sl_zigbee_af_endpoint_count(void);
uint8_t sl_zigbee_af_fixed_endpoint_count(void);
#if (SL_ZIGBEE_AF_PLUGIN_ZCL_CLUSTER_ENABLE_DISABLE_RUN_TIME == 1)
#if !defined(SL_ZIGBEE_TEST)
bool sl_zigbee_af_cluster_enable_disable(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId,
sl_zigbee_af_cluster_mask_t mask,
bool enable);
bool sl_zigbee_af_is_cluster_enabled(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId,
sl_zigbee_af_cluster_mask_t mask);
#endif
#endif //SL_ZIGBEE_AF_PLUGIN_ZCL_CLUSTER_ENABLE_DISABLE_RUN_TIME
#ifndef DOXYGEN_SHOULD_SKIP_THIS
enum {
SL_ZIGBEE_AF_DATA_TYPE_ANALOG = 0,
SL_ZIGBEE_AF_DATA_TYPE_DISCRETE = 1,
SL_ZIGBEE_AF_DATA_TYPE_NONE = 2
};
#endif //DOXYGEN_SHOULD_SKIP_THIS
uint8_t sl_zigbee_af_get_attribute_analog_or_discrete_type(uint8_t dataType);
bool sl_zigbee_af_is_type_signed(sl_zigbee_af_attribute_type_t dataType);
uint32_t sl_zigbee_af_get_int32u(const uint8_t* message, uint16_t currentIndex, uint16_t msgLen);
uint32_t sl_zigbee_af_get_int24u(const uint8_t* message, uint16_t currentIndex, uint16_t msgLen);
uint16_t sl_zigbee_af_get_int16u(const uint8_t* message, uint16_t currentIndex, uint16_t msgLen);
uint8_t* sl_zigbee_af_get_string(uint8_t* message, uint16_t currentIndex, uint16_t msgLen);
uint8_t* sl_zigbee_af_get_long_string(uint8_t* message, uint16_t currentIndex, uint16_t msgLen);
/*
* @brief Extract a ZCL Date from the message buffer and returns it
* in the given destination. Returns the number of bytes copied.
*/
uint8_t sl_zigbee_af_get_date(uint8_t* message, uint16_t currentIndex, uint16_t msgLen, sl_zigbee_af_date_t *destination);
#define sl_zigbee_af_get_int8u(message, currentIndex, msgLen) message[currentIndex]
#define sl_zigbee_af_copy_int8u(data, index, x) (data[index] = (x))
void sl_zigbee_af_copy_int16u(uint8_t *data, uint16_t index, uint16_t x);
void sl_zigbee_af_copy_int24u(uint8_t *data, uint16_t index, uint32_t x);
void sl_zigbee_af_copy_int32u(uint8_t *data, uint16_t index, uint32_t x);
/*
* @brief Copy a ZCL string type into a buffer. The size
* parameter should indicate the maximum number of characters to copy to the
* destination buffer not including the length byte.
*/
void sl_zigbee_af_copy_string(uint8_t *dest, uint8_t *src, uint8_t size);
/*
* @brief Copy a ZCL long string into a buffer. The size
* parameter should indicate the maximum number of characters to copy to the
* destination buffer not including the length bytes.
*/
void sl_zigbee_af_copy_long_string(uint8_t *dest, uint8_t *src, uint16_t size);
/*
* @brief Determine the length of a Zigbee Cluster Library string
* (where the first byte is assumed to be the length).
*/
uint8_t sl_zigbee_af_string_length(const uint8_t *buffer);
/*
* @brief Determine the length of a Zigbee Cluster Library long string.
* (where the first two bytes are assumed to be the length).
*/
uint16_t sl_zigbee_af_long_string_length(const uint8_t *buffer);
/*
* @brief Determine the size of a Zigbee Cluster Library
* attribute value.
*
* The attribute could be non-string, string, or long string. For strings,
* the size includes the length of the string plus the number of the string's
* length prefix byte(s).
*
* Additionally, checks that the resulting size does not exceed the
* specified buffer size.
*
* @param dataType Zigbee data type
* @param buffer pointer to a buffer containing a string value
* @param bufferSize size of the buffer
*
* @return 0 if dataType is unrecognized or data size exceeds buffer size
*. nonzero for valid data size
*/
uint16_t sl_zigbee_af_attribute_value_size(sl_zigbee_af_attribute_type_t dataType,
const uint8_t *buffer,
const uint16_t bufferSize);
// end of name API // end of attribute-storage
// @{
bool sl_zigbee_af_is_device_enabled(uint8_t endpoint);
bool sl_zigbee_af_is_device_identifying(uint8_t endpoint);
void sl_zigbee_af_set_device_enabled(uint8_t endpoint, bool enabled);
// end of name API // end of device-control
// @{
void sl_zigbee_wakeup_common_task(void);
bool sl_zigbee_af_endpoint_enable_disable(uint8_t endpoint, bool enable);
bool sl_zigbee_af_endpoint_index_is_enabled(uint8_t index);
#define SL_ZIGBEE_AF_NEW_IMAGE_VERIFICATION true
#define SL_ZIGBEE_AF_CONTINUE_IMAGE_VERIFY false
extern const sl_zigbee_af_ota_image_id_t sl_zigbee_af_invalid_image_id;
bool sl_zigbee_af_is_this_data_type_a_string_type(sl_zigbee_af_attribute_type_t dataType);
bool sl_zigbee_af_is_string_attribute_type(sl_zigbee_af_attribute_type_t attributeType);
bool sl_zigbee_af_is_long_string_attribute_type(sl_zigbee_af_attribute_type_t attributeType);
#define SL_ZIGBEE_AF_ZCL_SEQUENCE_MASK 0x7Fu
#define SL_ZIGBEE_AF_MESSAGE_TAG_MASK 0x7Fu
uint8_t sl_zigbee_af_next_sequence(void);
uint8_t sl_zigbee_af_get_last_sequence_number(void);
int8_t sl_zigbee_af_compare_values(uint8_t* val1, uint8_t* val2, uint8_t len, bool signedNumber);
void sl_zigbee_af_get_eui64(sl_802154_long_addr_t returnEui64);
#ifdef EZSP_HOST
// Normally this is provided by the stack code, but on the host
// it is provided by the application code.
void sl_util_reverse_mem_copy(uint8_t* dest, const uint8_t* src, uint16_t length);
sl_zigbee_ezsp_status_t sl_zigbee_ezsp_get_last_status();
#endif // EZSP_HOST
sl_802154_short_addr_t sl_zigbee_af_get_node_id(void);
#if defined(DOXYGEN_SHOULD_SKIP_THIS) || defined(EZSP_HOST)
sl_status_t sl_zigbee_af_generate_random_key(sl_zigbee_key_data_t *result);
#else
#define sl_zigbee_af_generate_random_key(result) sl_zigbee_generate_random_key(result)
#endif
sl_802154_pan_id_t sl_zigbee_af_get_pan_id(void);
uint8_t sl_zigbee_af_get_radio_channel(void);
sl_zigbee_network_status_t sl_zigbee_af_network_state(void);
sl_status_t sl_zigbee_af_get_network_parameters(sl_zigbee_node_type_t *nodeType,
sl_zigbee_network_parameters_t *parameters);
sl_status_t sl_zigbee_af_get_node_type(sl_zigbee_node_type_t *nodeType);
#define SL_ZIGBEE_AF_REJOIN_DUE_TO_END_DEVICE_MOVE 0xA0u
#define SL_ZIGBEE_AF_REJOIN_DUE_TO_TC_KEEPALIVE_FAILURE 0xA1u
#define SL_ZIGBEE_AF_REJOIN_DUE_TO_CLI_COMMAND 0xA2u
#define SL_ZIGBEE_AF_REJOIN_DUE_TO_WWAH_CONNECTIVITY_MANAGER 0xA3u
#define SL_ZIGBEE_AF_REJOIN_FIRST_REASON SL_ZIGBEE_AF_REJOIN_DUE_TO_END_DEVICE_MOVE
#define SL_ZIGBEE_AF_REJOIN_LAST_REASON SL_ZIGBEE_AF_REJOIN_DUE_TO_END_DEVICE_MOVE
sl_status_t sl_zigbee_af_permit_join(uint8_t duration,
bool broadcastMgmtPermitJoin);
#ifdef DOXYGEN_SHOULD_SKIP_THIS
sl_status_t sl_zigbee_af_broadcast_permit_join(uint8_t duration);
#else
#define sl_zigbee_af_broadcast_permit_join(duration) \
sl_zigbee_af_permit_join((duration), true)
#endif
void sl_zigbee_af_acquire_lock(void);
void sl_zigbee_af_release_lock(void);
// end of name API // end of miscellaneous
// @{
#define SL_ZIGBEE_AF_CLIENT_CLUSTER_TICK true
#define SL_ZIGBEE_AF_SERVER_CLUSTER_TICK false
sl_status_t sl_zigbee_zcl_schedule_tick_extended(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId,
bool isClient,
uint32_t delayMs,
sl_zigbee_af_event_poll_control_t pollControl,
sl_zigbee_af_event_sleep_control_t sleepControl);
sl_status_t sl_zigbee_zcl_schedule_cluster_tick(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId,
bool isClient,
uint32_t delayMs,
sl_zigbee_af_event_sleep_control_t sleepControl);
sl_status_t sl_zigbee_zcl_schedule_client_tick_extended(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId,
uint32_t delayMs,
sl_zigbee_af_event_poll_control_t pollControl,
sl_zigbee_af_event_sleep_control_t sleepControl);
sl_status_t sl_zigbee_zcl_schedule_client_tick(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId,
uint32_t delayMs);
sl_status_t sl_zigbee_zcl_schedule_server_tick_extended(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId,
uint32_t delayMs,
sl_zigbee_af_event_poll_control_t pollControl,
sl_zigbee_af_event_sleep_control_t sleepControl);
sl_status_t sl_zigbee_zcl_schedule_server_tick(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId,
uint32_t delayMs);
sl_status_t sl_zigbee_zcl_deactivate_cluster_tick(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId,
bool isClient);
sl_status_t sl_zigbee_zcl_deactivate_client_tick(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId);
sl_status_t sl_zigbee_zcl_deactivate_server_tick(uint8_t endpoint,
sl_zigbee_af_cluster_id_t clusterId);
#define sl_zigbee_af_get_current_sleep_control() \
sl_zigbee_af_get_current_sleep_control_cb()
#define sl_zigbee_af_set_default_sleep_control(x) \
sl_zigbee_af_set_default_sleep_control_cb(x)
#define sl_zigbee_af_get_default_sleep_control() \
sl_zigbee_af_get_default_sleep_control_cb()
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
#define sl_zigbee_af_add_to_current_app_tasks(x) \
sl_zigbee_af_add_to_current_app_tasks_cb(x)
#define sl_zigbee_af_remove_from_current_app_tasks(x) \
sl_zigbee_af_remove_from_current_app_tasks_cb(x)
#define sl_zigbee_af_current_app_tasks() sl_zigbee_af_get_current_app_tasks_cb()
#endif // !DOXYGEN_SHOULD_SKIP_THIS
// end of name API // end of sleep-control
// @{
sl_status_t sl_zigbee_af_send_response(void);
sl_status_t sl_zigbee_af_send_response_with_cb(sl_zigbee_af_message_sent_function_t callback);
sl_status_t sl_zigbee_af_send_multicast(sl_zigbee_multicast_id_t multicastId,
sl_802154_short_addr_t alias,
uint8_t sequence,
sl_zigbee_aps_frame_t *apsFrame,
uint16_t messageLength,
uint8_t* message);
sl_status_t sl_zigbee_af_send_multicast_to_bindings(sl_zigbee_aps_frame_t *apsFrame,
uint16_t messageLength,
uint8_t* message);
sl_status_t sl_zigbee_af_send_multicast_with_cb(sl_zigbee_multicast_id_t multicastId,
sl_802154_short_addr_t alias,
uint8_t sequence,
sl_zigbee_aps_frame_t *apsFrame,
uint16_t messageLength,
uint8_t* message,
sl_zigbee_af_message_sent_function_t callback);
sl_status_t sl_zigbee_af_send_broadcast(sl_802154_short_addr_t alias,
sl_802154_short_addr_t destination,
uint8_t sequence,
sl_zigbee_aps_frame_t *apsFrame,
uint16_t messageLength,
uint8_t* message);
sl_status_t sl_zigbee_af_send_broadcast_with_cb(sl_802154_short_addr_t destination,
sl_zigbee_aps_frame_t *apsFrame,
uint16_t messageLength,
uint8_t *message,
sl_802154_short_addr_t alias,
uint8_t sequence,
sl_zigbee_af_message_sent_function_t callback);
sl_status_t sl_zigbee_af_send_unicast(sl_zigbee_outgoing_message_type_t type,
uint16_t indexOrDestination,
sl_zigbee_aps_frame_t *apsFrame,
uint16_t messageLength,
uint8_t* message);
sl_status_t sl_zigbee_af_send_unicast_with_cb(sl_zigbee_outgoing_message_type_t type,
uint16_t indexOrDestination,
sl_zigbee_aps_frame_t *apsFrame,
uint16_t messageLength,
uint8_t* message,
sl_zigbee_af_message_sent_function_t callback);
sl_status_t sl_zigbee_af_send_unicast_to_bindings(sl_zigbee_aps_frame_t *apsFrame,
uint16_t messageLength,
uint8_t* message);
sl_status_t sl_zigbee_af_send_unicast_to_bindings_with_cb(sl_zigbee_aps_frame_t *apsFrame,
uint16_t messageLength,
uint8_t* message,
sl_zigbee_af_message_sent_function_t callback);
sl_status_t sl_zigbee_af_send_inter_pan(sl_802154_pan_id_t panId,
const sl_802154_long_addr_t destinationLongId,
sl_802154_short_addr_t destinationShortId,
sl_zigbee_multicast_id_t multicastId,
sl_zigbee_af_cluster_id_t clusterId,
sl_zigbee_af_profile_id_t profileId,
uint16_t messageLength,
uint8_t* messageBytes);
sl_status_t sl_zigbee_af_send_command_unicast_to_bindings(void);
sl_status_t sl_zigbee_af_send_command_unicast_to_bindings_with_cb(sl_zigbee_af_message_sent_function_t callback);
sl_status_t sl_zigbee_af_send_command_multicast(sl_zigbee_multicast_id_t multicastId, sl_802154_short_addr_t alias, uint8_t sequence);
sl_status_t sl_zigbee_af_send_command_multicast_with_cb(sl_zigbee_multicast_id_t multicastId, sl_802154_short_addr_t alias, uint8_t sequence,
sl_zigbee_af_message_sent_function_t callback);
sl_status_t sl_zigbee_af_send_command_multicast_to_bindings(void);
sl_status_t sl_zigbee_af_send_command_unicast(sl_zigbee_outgoing_message_type_t type,
uint16_t indexOrDestination);
sl_status_t sl_zigbee_af_send_command_unicast_with_cb(sl_zigbee_outgoing_message_type_t type,
uint16_t indexOrDestination,
sl_zigbee_af_message_sent_function_t callback);
sl_status_t sl_zigbee_af_send_command_broadcast(sl_802154_short_addr_t destination,
sl_802154_short_addr_t alias,
uint8_t sequence);
sl_status_t sl_zigbee_af_send_command_broadcast_with_cb(sl_802154_short_addr_t destination,
sl_802154_short_addr_t alias,
uint8_t sequence,
sl_zigbee_af_message_sent_function_t callback);
sl_status_t sl_zigbee_af_send_command_inter_pan(sl_802154_pan_id_t panId,
const sl_802154_long_addr_t destinationLongId,
sl_802154_short_addr_t destinationShortId,
sl_zigbee_multicast_id_t multicastId,
sl_zigbee_af_profile_id_t profileId);
sl_status_t sl_zigbee_af_send_default_response(const sl_zigbee_af_cluster_command_t *cmd,
sl_zigbee_af_status_t status);
sl_status_t sl_zigbee_af_send_default_response_with_cb(const sl_zigbee_af_cluster_command_t *cmd,
sl_zigbee_af_status_t status,
sl_zigbee_af_message_sent_function_t callback);
sl_status_t sl_zigbee_af_send_immediate_default_response(sl_zigbee_af_status_t status);
sl_status_t sl_zigbee_af_send_immediate_default_response_with_cb(sl_zigbee_af_status_t status,
sl_zigbee_af_message_sent_function_t callback);
uint8_t sl_zigbee_af_maximum_aps_payload_length(sl_zigbee_outgoing_message_type_t type,
uint16_t indexOrDestination,
sl_zigbee_aps_frame_t *apsFrame);
sl_zigbee_aps_frame_t *sl_zigbee_af_get_command_aps_frame(void);
void sl_zigbee_af_set_command_endpoints(uint8_t sourceEndpoint, uint8_t destinationEndpoint);
#define SL_ZIGBEE_AF_CLIENT_CLUSTER_DISCOVERY false
#define SL_ZIGBEE_AF_SERVER_CLUSTER_DISCOVERY true
sl_status_t sl_zigbee_af_find_devices_by_profile_and_cluster(sl_802154_short_addr_t target,
sl_zigbee_af_profile_id_t profileId,
sl_zigbee_af_cluster_id_t clusterId,
bool serverCluster,
sl_zigbee_af_service_discovery_callback_t *callback);
sl_status_t sl_zigbee_af_find_clusters_by_device_and_endpoint(sl_802154_short_addr_t target,
uint8_t targetEndpoint,
sl_zigbee_af_service_discovery_callback_t *callback);
sl_status_t sl_zigbee_af_find_ieee_address(sl_802154_short_addr_t shortAddress,
sl_zigbee_af_service_discovery_callback_t *callback);
sl_status_t sl_zigbee_af_find_node_id(sl_802154_long_addr_t longAddress,
sl_zigbee_af_service_discovery_callback_t *callback);
sl_status_t sl_zigbee_af_find_active_endpoints(sl_802154_short_addr_t target,
sl_zigbee_af_service_discovery_callback_t *callback);
uint8_t sl_zigbee_af_add_address_table_entry(sl_802154_long_addr_t longId, sl_802154_short_addr_t shortId);
sl_status_t sl_zigbee_af_set_address_table_entry(uint8_t index,
sl_802154_long_addr_t longId,
sl_802154_short_addr_t shortId);
sl_status_t sl_zigbee_af_remove_address_table_entry(uint8_t index);
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
#define sl_zigbee_af_current_command() (sli_zigbee_af_current_command)
extern sl_zigbee_af_cluster_command_t *sli_zigbee_af_current_command;
#endif
#define sl_zigbee_af_current_endpoint() (sl_zigbee_af_current_command()->apsFrame->destinationEndpoint)
#ifdef DOXYGEN_SHOULD_SKIP_THIS
sl_status_t sl_zigbee_af_initiate_key_establishment(sl_802154_short_addr_t nodeId, uint8_t endpoint);
sl_status_t sl_zigbee_af_initiate_inter_pan_key_establishment(sl_802154_pan_id_t panId,
const sl_802154_long_addr_t eui64);
bool sl_zigbee_af_performing_key_establishment(void);
sl_status_t sl_zigbee_af_initiate_partner_link_key_exchange(sl_802154_short_addr_t target,
uint8_t endpoint,
sl_zigbee_af_partner_link_key_exchange_callback_t *callback);
#else
#define sl_zigbee_af_initiate_key_establishment(nodeId, endpoint) \
sl_zigbee_af_initiate_key_establishment_cb(nodeId, endpoint)
#define sl_zigbee_af_initiate_inter_pan_key_establishment(panId, eui64) \
sl_zigbee_af_initiate_inter_pan_key_establishment_cb(panId, eui64)
#define sl_zigbee_af_performing_key_establishment() \
sl_zigbee_af_performing_key_establishment_cb()
#define sl_zigbee_af_initiate_partner_link_key_exchange(target, endpoint, callback) \
sl_zigbee_af_initiate_partner_link_key_exchange_cb(target, endpoint, callback)
#endif
bool sl_zigbee_af_is_current_security_profile_smart_energy(void);
// end of name API // end of messaging
// @{
sl_status_t sl_zigbee_subscribe_to_zcl_commands(uint16_t cluster_id,
uint16_t manufacturer_id,
uint8_t direction,
sl_service_function_t service_function);
// end of name API // end of zcl_commands
// Frame control fields (8 bits total)
// Bits 0 and 1 are Frame Type Sub-field
#define ZCL_FRAME_CONTROL_FRAME_TYPE_MASK (BIT(0) | BIT(1))
#define ZCL_CLUSTER_SPECIFIC_COMMAND BIT(0)
#define ZCL_PROFILE_WIDE_COMMAND 0u
#define ZCL_GLOBAL_COMMAND (ZCL_PROFILE_WIDE_COMMAND)
// Bit 2 is Manufacturer Specific Sub-field
#define ZCL_MANUFACTURER_SPECIFIC_MASK BIT(2)
// Bit 3 is Direction Sub-field
#define ZCL_FRAME_CONTROL_DIRECTION_MASK BIT(3)
#define ZCL_FRAME_CONTROL_SERVER_TO_CLIENT BIT(3)
#define ZCL_FRAME_CONTROL_CLIENT_TO_SERVER 0u
// Bit 4 is Disable Default Response Sub-field
#define ZCL_DISABLE_DEFAULT_RESPONSE_MASK BIT(4)
// Bits 5 to 7 are reserved
#define ZCL_DIRECTION_CLIENT_TO_SERVER 0u
#define ZCL_DIRECTION_SERVER_TO_CLIENT 1u
// Packet must be at least 3 bytes for ZCL overhead.
// Frame Control (1-byte)
// Sequence Number (1-byte)
// Command Id (1-byte)
#define SL_ZIGBEE_AF_ZCL_OVERHEAD 3
#define SL_ZIGBEE_AF_ZCL_MANUFACTURER_SPECIFIC_OVERHEAD 5
// Permitted values for sl_zigbee_af_set_form_and_join_mode
#define FIND_AND_JOIN_MODE_ALLOW_2_4_GHZ BIT(0)
#define FIND_AND_JOIN_MODE_ALLOW_SUB_GHZ BIT(1)
#define FIND_AND_JOIN_MODE_ALLOW_BOTH (FIND_AND_JOIN_MODE_ALLOW_2_4_GHZ | FIND_AND_JOIN_MODE_ALLOW_SUB_GHZ)
// end of zcl-macros
// @{
sl_status_t sl_zigbee_af_form_network(sl_zigbee_network_parameters_t *parameters);
sl_status_t sl_zigbee_af_join_network(sl_zigbee_network_parameters_t *parameters);
#ifdef DOXYGEN_SHOULD_SKIP_THIS
sl_status_t sl_zigbee_af_find_unused_pan_id_and_form(void);
sl_status_t sl_zigbee_af_start_search_for_joinable_network(void);
#else
#define sl_zigbee_af_find_unused_pan_id_and_form() sl_zigbee_af_find_unused_pan_id_and_form_cb()
#define sl_zigbee_af_start_search_for_joinable_network() sl_zigbee_af_start_search_for_joinable_network_cb()
#endif
sl_status_t sl_zigbee_af_push_network_index(uint8_t networkIndex);
sl_status_t sl_zigbee_af_push_callback_network_index(void);
sl_status_t sl_zigbee_af_push_endpoint_network_index(uint8_t endpoint);
sl_status_t sl_zigbee_af_pop_network_index(void);
uint8_t sl_zigbee_af_primary_endpoint_for_network_index(uint8_t networkIndex);
uint8_t sl_zigbee_af_primary_endpoint_for_current_network_index(void);
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
sl_status_t sli_zigbee_af_initialize_network_index_stack(void);
void sli_zigbee_af_assert_network_index_stack_is_empty(void);
#endif
// end of API // end of network-utility-functions
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
#if defined(SL_ZIGBEE_TEST)
#define SL_ZIGBEE_TEST_ASSERT(x) assert(x)
#else
#define SL_ZIGBEE_TEST_ASSERT(x)
#endif
#endif
// Note: This is a #define for now but could be a real function call in the future.
#define sl_zigbee_af_max_power_level() (3)
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
// This macro used to be generated by AppBuilder, defining it disables legacy CLI commands.
// Legacy CLI is no longer supported and will eventually be cleaned up (see EMZIGBEE-868),
// until then define this statically.
#define SL_ZIGBEE_AF_GENERATE_CLI
#endif // !DOXYGEN_SHOULD_SKIP_THIS
#ifdef __cplusplus
}
#endif
#endif // SILABS_AF_API
API#
Return true if the cluster is in the manufacturer-specific range.
Return true if the attribute is read only.
Return true if this is a client attribute and false if if it is a server attribute.
Return true if the attribute is saved to a token.
Return true if the attribute is saved in external storage.
Return true if the attribute is a singleton.
Return true if the attribute is manufacturer specific.
Return the size of attribute in bytes.
Take an index of an endpoint and return the profile ID for it.
Take an index of an endpoint and return the device ID for it.
Take an index of an endpoint and return the device version for it.
Take an index of an endpoint and return the network index for it.
Return the primary profile ID.
Return the primary endpoint.
Extract a single byte out of the message.
Copy a uint8_t from variable into buffer.
Indicate a new image verification is taking place.
Indicate the continuation of an image verification already in progress.
The mask applied by sl_zigbee_af_next_sequence when generating ZCL sequence numbers.
The mask applied to generated message tags used by the framework when sending messages via EZSP. Customers who call ezspSend functions directly must use message tags outside this mask.
Return true if the cluster is in the manufacturer-specific range.
Return true if the cluster is in the manufacturer-specific range.
Return true if the cluster is in the manufacturer-specific range.
Return true if the cluster is in the manufacturer-specific range.
Return true if the cluster is in the manufacturer-specific range.
Return true if the cluster is in the manufacturer-specific range.
Friendly define for use in the scheduling or canceling client events with sl_zigbee_zcl_schedule_cluster_tick() and sl_zigbee_zcl_deactivate_cluster_tick().
Friendly define for use in the scheduling or canceling server events with sl_zigbee_zcl_schedule_cluster_tick() and sl_zigbee_zcl_deactivate_cluster_tick().
Retrieve the most restrictive sleep control value for all scheduled events. This function is used by sl_zigbee_af_ok_to_nap and emberAfOkToHibernate to makes sure that there are no events scheduled, which will keep the device from hibernating or napping.
Set the default sleep control value against which all scheduled event sleep control values will be evaluated. This can be used to keep a device awake for an extended period of time by setting the default to SL_ZIGBEE_AF_STAY_AWAKE and then resetting the value to SL_ZIGBEE_AF_OK_TO_HIBERNATE once the wake period is complete.
Retrieve the default sleep control against which all event sleep control values are evaluated. The default sleep control value is initialized to SL_ZIGBEE_AF_OK_TO_HIBERNATE but can be changed by the application at any time using the sl_zigbee_af_set_default_sleep_control() function.
Friendly define for use in discovering client clusters with sl_zigbee_af_find_devices_by_profile_and_cluster().
Friendly define for use in discovering server clusters with sl_zigbee_af_find_devices_by_profile_and_cluster().
Return the current endpoint that is being served.
This variable defines an invalid image ID. It is used to determine if a returned sl_zigbee_af_ota_image_id_t is valid or not by passing the data to the function sl_zigbee_af_is_ota_image_id_valid().
Locate attribute metadata.
Return true if the attribute exists.
Return true if an endpoint contains a cluster, checking for mfg code.
Return true if the endpoint contains the ZCL cluster with specified ID.
Return true if the endpoint has a cluster server, checking for the mfg code.
Return true if the endpoint contains the ZCL server with a specified ID.
Return true if the endpoint contains the cluster client.
Return true if the endpoint contains the ZCL client with a specified ID.
Write an attribute performing all checks.
Write a cluster server attribute.
Write a cluster client attribute.
Write a manufacturer-specific server attribute.
Write a manufacturer-specific client attribute.
Test the success of attribute write.
Read the attribute value performing all the checks.
Read the server attribute value performing all the checks.
Read the client attribute value, performing all the checks.
Read the manufacturer-specific server attribute value, performing all checks.
Read the manufacturer-specific client attribute value, performing all checks.
Return the size of the ZCL data in bytes.
Return the number of seconds the network remains open.
Take an index of an endpoint and return the Zigbee endpoint.
Return the network index of a given endpoint.
Return the total number of endpoints (dynamic and pre-compiled).
Return the number of pre-compiled endpoints.
Return the type of the attribute, either ANALOG, DISCRETE, or NONE.
Return true if type is signed, false otherwise.
Extract a 32-bit integer from the message buffer.
Extract a 24-bit integer from the message buffer.
Extract a 16-bit integer from the message buffer.
Extract a ZCL string from the message buffer.
Extract a ZCL long string from the message buffer.
Return true if the cluster is in the manufacturer-specific range.
Copy a uint16_t value into a buffer.
Copy a uint24_t value into a buffer.
Copy a uint32_t value into a buffer.
Return true if the cluster is in the manufacturer-specific range.
Return true if the cluster is in the manufacturer-specific range.
Return true if the cluster is in the manufacturer-specific range.
Return true if the cluster is in the manufacturer-specific range.
Return true if the cluster is in the manufacturer-specific range.
Check whether the endpoint is enabled.
Check whether the endpoint is identifying.
Enable or disable an endpoint.
Set the Zigbee stack task to ready when running on an OS.
Enable/disable endpoints.
Determine if an endpoint at the specified index is enabled or disabled.
Return true if a given ZCL data type is a string type.
Return true if the given attribute type is a string.
Return true if the given attribute type is a long string.
Increment the ZCL sequence number and return the value.
Retrieve the last sequence number that was used.
Compare two values of known length as integers.Simple integer comparison function. Signed integer comparison are supported for numbers with length of 4 (bytes) or less. The integers are in native endianness.
Populate the passed EUI64 with the local EUI64 MAC address.
Return the node ID of the local node.
Generate a random key (link, network, or master).
Return the PAN ID of the local node.
Return the radioChannel of the current network.
Return the current network state. This call caches the results on the host to prevent frequent EZSP transactions.
Return the current network parameters.
Return the current node type.
Enable local permit join and optionally broadcast the ZDO Mgmt_Permit_Join_req message. This API can be called from any device type and still return SL_STATUS_OK. If the API is called from an end device, the permit association bit will just be left off.
Enable local permit join and broadcast the ZDO Mgmt_Permit_Join_req message. This API can be called from any device type and still return SL_STATUS_OK. If the API is called from an end device, the permit association bit will just be left off.
Acquire the app framework mutex (for RTOS builds). This should be done if code run from outside of the app framework (callback) context in RTOS builds needs to call app framework APIs, as interactions between app framework and other application tasks are not otherwise designed to be thread-safe. Note that APIs relating to app framework events are included in this category of app framework APIs (so thread-safe interactions with the event queue from other tasks require the acquisition of this lock).
Release the app framework mutex (for RTOS builds), allowing other application tasks (like the app framework task) waiting on this mutex to run. This should be done once the application code has finished its calls to app framework data or APIs.
Schedule a cluster-related event inside the application framework's event mechanism. This function provides a wrapper for the Ember stack event mechanism which allows the cluster code to access its events by their endpoint, cluster ID, and client/server identity. The passed poll and sleep controls allow the cluster to indicate whether it needs to long or short poll and whether it needs to stay awake or if it can sleep.
Schedule a cluster-related event inside the application framework's event mechanism. This function is a wrapper for ::sl_zigbee_af_schedule_tick_extended. The cluster on the given endpoint will be set to long poll if sleepControl is set to SL_ZIGBEE_AF_OK_TO_HIBERNATE or will be set to short poll otherwise. It will stay awake if sleepControl is SL_ZIGBEE_AF_STAY_AWAKE and will sleep otherwise.
Schedule a cluster client event. This function is a wrapper for sl_zigbee_zcl_schedule_tick_extended.
Schedule a cluster client event. This function is a wrapper for sl_zigbee_zcl_schedule_client_tick_extended. It indicates that the cluster client on the given endpoint can long poll and can sleep.
Schedule a cluster server event. This function is a wrapper for sl_zigbee_zcl_schedule_tick_extended.
Schedule a cluster server event. This function is a wrapper for sl_zigbee_zcl_schedule_server_tick_extended. It indicates that the cluster server on the given endpoint can long poll and can sleep.
Deactivate a cluster-related event. This function provides a wrapper for the Ember stack's event mechanism, which allows an event to be accessed by its endpoint, cluster ID, and client/server identity.
Deactivate a cluster client event. This function is a wrapper for sl_zigbee_zcl_deactivate_cluster_tick.
Deactivate a cluster server event. This function is a wrapper for sl_zigbee_zcl_deactivate_cluster_tick.
Send a ZCL response, based on the information that is currently in the outgoing buffer. It is expected that a complete ZCL message is present, including header. The application may use this method directly from within the message handling function and associated callbacks. However, this will result in the response being sent before the APS ACK is sent, which is not ideal.
Send ZCL response with attached message sent callback.
Send a multicast message to all endpoints that share a specific multicast ID and are within a specified number of hops of the sender.
Multicast the message to the group in the binding table that match the cluster and source endpoint in the APS frame. Note: if the binding table contains many matching entries, calling this API cause a significant amount of network traffic. Care should be taken when considering the effects of broadcasts in a network.
Send multicast with attached message sent callback.
Send a broadcast message as per the ZigBee specification.
Send broadcast with attached message sent callback.
Send unicast.
Send unicast with attached message sent callback.
Unicast the message to each remote node in the binding table that matches the cluster and source endpoint in the APS frame. Note: if the binding table contains many matching entries, calling this API cause a significant amount of network traffic.
sl_zigbee_af_send_unicast_to_bindings with attached message sent callback.
Send interpan message.
Send the command prepared with sl_zigbee_af_fill.... macro.
sl_zigbee_af_send_command_unicast_to_bindings with attached message sent callback.
Send the command prepared with sl_zigbee_af_fill.... macro.
sl_zigbee_af_send_command_multicast with attached message sent callback.
Send the command prepared with sl_zigbee_af_fill.... macro.
Send the command prepared with sl_zigbee_af_fill.... macro.
sl_zigbee_af_send_command_unicast with attached message sent callback.
Send the command prepared with sl_zigbee_af_fill.... macro.
sl_zigbee_af_send_command_broadcast with attached message sent callback.
Send the command prepared with sl_zigbee_af_fill.... macro.
Send a default response to a cluster command.
sl_zigbee_af_send_default_response with attached message sent callback.
Send a default response to a cluster command using the current command.
sl_zigbee_af_send_immediate_default_response with attached message sent callback.
Return the maximum size of the payload that the Application Support sub-layer will accept for the given message type, destination, and APS frame.
Access to client API APS frame.
Set the source and destination endpoints in the client API APS frame.
Find devices in the network with endpoints matching a given profile ID and cluster ID in their descriptors. Target may either be a specific device, or the broadcast address SL_ZIGBEE_RX_ON_WHEN_IDLE_BROADCAST_ADDRESS.
Find all of the given in and out clusters implemented on a devices given endpoint. Target should only be the short address of a specific device.
Initiate a discovery for the IEEE address of the specified node ID. This will send a unicast sent to the target node ID.
Initiate a discovery for the short ID of the specified long address. This will send a broadcast to all RX-on-when-idle devices (non-sleepies).
Initiate an Active Endpoint request ZDO message to the target node ID.
Add an entry for a remote device to the address table.
Add an entry for a remote device to the address table at a specific location.
Remove a specific entry from the address table.
Initiate key establishment with a remote node. sl_zigbee_af_key_establishment_cb will be called as events occur and when key establishment completes.
Initiate key establishment with a remote node on a different PAN. sl_zigbee_af_inter_pan_key_establishment_cb will be called as events occur and when key establishment completes.
Indicate whether the device is in the process of performing key establishment.
Initiate partner link key exchange with a remote node.
Use this function to determine if the security profile of the current network was set to Smart Energy. The security profile is configured in AppBuilder. @ return true if the security profile is Smart Energy or false otherwise.
Runtime subscription to specific incoming ZCL commands.
Form a new network using the specified network parameters.
Associate with the network using the specified network parameters.
Find an unused PAN ID and form a new network.
Find a joinable network and join it.
Set the current network to that of the given index and add it to the stack of networks maintained by the framework. Every call to this API must be paired with a subsequent call to sl_zigbee_af_pop_network_index.
Set the current network to the callback network and adds it to the stack of networks maintained by the framework. Every call to this API must be paired with a subsequent call to sl_zigbee_af_pop_network_index.
Set the current network to that of the given endpoint and adds it to the stack of networks maintained by the framework. Every call to this API must be paired with a subsequent call to sl_zigbee_af_pop_network_index.
Remove the topmost network from the stack of networks maintained by the framework and sets the current network to the new topmost network. Every call to this API must be paired with a prior call to sl_zigbee_af_push_network_index, sl_zigbee_af_push_callback_network_index, or sl_zigbee_af_push_endpoint_network_index.
Return the primary endpoint of the given network index or 0xFF if no endpoints belong to the network.sl_zigbee_af_status.
Return the primary endpoint of the current network index or 0xFF if no endpoints belong to the current network.
Macros#
The maximum power level that can be used by the chip.
API Documentation#
sl_zigbee_af_cluster_is_manufacturer_specific#
#define sl_zigbee_af_cluster_is_manufacturer_specificValue:
(cluster)
Return true if the cluster is in the manufacturer-specific range.
562
of file app/framework/include/af.h
sl_zigbee_af_attribute_is_read_only#
#define sl_zigbee_af_attribute_is_read_onlyValue:
(metadata)
Return true if the attribute is read only.
569
of file app/framework/include/af.h
sl_zigbee_af_attribute_is_client#
#define sl_zigbee_af_attribute_is_clientValue:
(metadata)
Return true if this is a client attribute and false if if it is a server attribute.
577
of file app/framework/include/af.h
sl_zigbee_af_attribute_is_tokenized#
#define sl_zigbee_af_attribute_is_tokenizedValue:
(metadata)
Return true if the attribute is saved to a token.
584
of file app/framework/include/af.h
sl_zigbee_af_attribute_is_external#
#define sl_zigbee_af_attribute_is_externalValue:
(metadata)
Return true if the attribute is saved in external storage.
591
of file app/framework/include/af.h
sl_zigbee_af_attribute_is_singleton#
#define sl_zigbee_af_attribute_is_singletonValue:
(metadata)
Return true if the attribute is a singleton.
598
of file app/framework/include/af.h
sl_zigbee_af_attribute_is_manufacturer_specific#
#define sl_zigbee_af_attribute_is_manufacturer_specificValue:
(metadata)
Return true if the attribute is manufacturer specific.
605
of file app/framework/include/af.h
sl_zigbee_af_attribute_size#
#define sl_zigbee_af_attribute_sizeValue:
(metadata)
Return the size of attribute in bytes.
612
of file app/framework/include/af.h
sl_zigbee_af_profile_id_from_index#
#define sl_zigbee_af_profile_id_from_indexValue:
(index)
Take an index of an endpoint and return the profile ID for it.
683
of file app/framework/include/af.h
sl_zigbee_af_device_id_from_index#
#define sl_zigbee_af_device_id_from_indexValue:
(index)
Take an index of an endpoint and return the device ID for it.
688
of file app/framework/include/af.h
sl_zigbee_af_device_version_from_index#
#define sl_zigbee_af_device_version_from_indexValue:
(index)
Take an index of an endpoint and return the device version for it.
693
of file app/framework/include/af.h
sl_zigbee_af_network_index_from_endpoint_index#
#define sl_zigbee_af_network_index_from_endpoint_indexValue:
(index)
Take an index of an endpoint and return the network index for it.
698
of file app/framework/include/af.h
sl_zigbee_af_primary_profile_id#
#define sl_zigbee_af_primary_profile_idValue:
()
Return the primary profile ID.
Primary profile is the profile of a primary endpoint as defined in AppBuilder.
714
of file app/framework/include/af.h
sl_zigbee_af_primary_endpoint#
#define sl_zigbee_af_primary_endpointValue:
()
Return the primary endpoint.
719
of file app/framework/include/af.h
sl_zigbee_af_get_int8u#
#define sl_zigbee_af_get_int8uValue:
(message, currentIndex, msgLen)
Extract a single byte out of the message.
814
of file app/framework/include/af.h
sl_zigbee_af_copy_int8u#
#define sl_zigbee_af_copy_int8uValue:
(data, index, x)
Copy a uint8_t from variable into buffer.
819
of file app/framework/include/af.h
SL_ZIGBEE_AF_NEW_IMAGE_VERIFICATION#
#define SL_ZIGBEE_AF_NEW_IMAGE_VERIFICATIONValue:
true
Indicate a new image verification is taking place.
967
of file app/framework/include/af.h
SL_ZIGBEE_AF_CONTINUE_IMAGE_VERIFY#
#define SL_ZIGBEE_AF_CONTINUE_IMAGE_VERIFYValue:
false
Indicate the continuation of an image verification already in progress.
973
of file app/framework/include/af.h
SL_ZIGBEE_AF_ZCL_SEQUENCE_MASK#
#define SL_ZIGBEE_AF_ZCL_SEQUENCE_MASKValue:
0x7Fu
The mask applied by sl_zigbee_af_next_sequence when generating ZCL sequence numbers.
1005
of file app/framework/include/af.h
SL_ZIGBEE_AF_MESSAGE_TAG_MASK#
#define SL_ZIGBEE_AF_MESSAGE_TAG_MASKValue:
0x7Fu
The mask applied to generated message tags used by the framework when sending messages via EZSP. Customers who call ezspSend functions directly must use message tags outside this mask.
1011
of file app/framework/include/af.h
SL_ZIGBEE_AF_REJOIN_DUE_TO_END_DEVICE_MOVE#
#define SL_ZIGBEE_AF_REJOIN_DUE_TO_END_DEVICE_MOVEValue:
(cluster)
Return true if the cluster is in the manufacturer-specific range.
1108
of file app/framework/include/af.h
SL_ZIGBEE_AF_REJOIN_DUE_TO_TC_KEEPALIVE_FAILURE#
#define SL_ZIGBEE_AF_REJOIN_DUE_TO_TC_KEEPALIVE_FAILUREValue:
(cluster)
Return true if the cluster is in the manufacturer-specific range.
1109
of file app/framework/include/af.h
SL_ZIGBEE_AF_REJOIN_DUE_TO_CLI_COMMAND#
#define SL_ZIGBEE_AF_REJOIN_DUE_TO_CLI_COMMANDValue:
(cluster)
Return true if the cluster is in the manufacturer-specific range.
1110
of file app/framework/include/af.h
SL_ZIGBEE_AF_REJOIN_DUE_TO_WWAH_CONNECTIVITY_MANAGER#
#define SL_ZIGBEE_AF_REJOIN_DUE_TO_WWAH_CONNECTIVITY_MANAGERValue:
(cluster)
Return true if the cluster is in the manufacturer-specific range.
1111
of file app/framework/include/af.h
SL_ZIGBEE_AF_REJOIN_FIRST_REASON#
#define SL_ZIGBEE_AF_REJOIN_FIRST_REASONValue:
(cluster)
Return true if the cluster is in the manufacturer-specific range.
1113
of file app/framework/include/af.h
SL_ZIGBEE_AF_REJOIN_LAST_REASON#
#define SL_ZIGBEE_AF_REJOIN_LAST_REASONValue:
(cluster)
Return true if the cluster is in the manufacturer-specific range.
1114
of file app/framework/include/af.h
SL_ZIGBEE_AF_CLIENT_CLUSTER_TICK#
#define SL_ZIGBEE_AF_CLIENT_CLUSTER_TICKValue:
true
Friendly define for use in the scheduling or canceling client events with sl_zigbee_zcl_schedule_cluster_tick() and sl_zigbee_zcl_deactivate_cluster_tick().
1196
of file app/framework/include/af.h
SL_ZIGBEE_AF_SERVER_CLUSTER_TICK#
#define SL_ZIGBEE_AF_SERVER_CLUSTER_TICKValue:
false
Friendly define for use in the scheduling or canceling server events with sl_zigbee_zcl_schedule_cluster_tick() and sl_zigbee_zcl_deactivate_cluster_tick().
1203
of file app/framework/include/af.h
sl_zigbee_af_get_current_sleep_control#
#define sl_zigbee_af_get_current_sleep_controlValue:
()
Retrieve the most restrictive sleep control value for all scheduled events. This function is used by sl_zigbee_af_ok_to_nap and emberAfOkToHibernate to makes sure that there are no events scheduled, which will keep the device from hibernating or napping.
Returns
The most restrictive sleep control value for all scheduled events or the value returned by sl_zigbee_af_get_default_sleep_control() if no events are currently scheduled. The default sleep control value is initialized to SL_ZIGBEE_AF_OK_TO_HIBERNATE but can be changed at any time using the sl_zigbee_af_set_default_sleep_control() function.
1386
of file app/framework/include/af.h
sl_zigbee_af_set_default_sleep_control#
#define sl_zigbee_af_set_default_sleep_controlValue:
(x)
Set the default sleep control value against which all scheduled event sleep control values will be evaluated. This can be used to keep a device awake for an extended period of time by setting the default to SL_ZIGBEE_AF_STAY_AWAKE and then resetting the value to SL_ZIGBEE_AF_OK_TO_HIBERNATE once the wake period is complete.
1398
of file app/framework/include/af.h
sl_zigbee_af_get_default_sleep_control#
#define sl_zigbee_af_get_default_sleep_controlValue:
()
Retrieve the default sleep control against which all event sleep control values are evaluated. The default sleep control value is initialized to SL_ZIGBEE_AF_OK_TO_HIBERNATE but can be changed by the application at any time using the sl_zigbee_af_set_default_sleep_control() function.
Returns
The current default sleep control value.
1409
of file app/framework/include/af.h
SL_ZIGBEE_AF_CLIENT_CLUSTER_DISCOVERY#
#define SL_ZIGBEE_AF_CLIENT_CLUSTER_DISCOVERYValue:
false
Friendly define for use in discovering client clusters with sl_zigbee_af_find_devices_by_profile_and_cluster().
1777
of file app/framework/include/af.h
SL_ZIGBEE_AF_SERVER_CLUSTER_DISCOVERY#
#define SL_ZIGBEE_AF_SERVER_CLUSTER_DISCOVERYValue:
true
Friendly define for use in discovering server clusters with sl_zigbee_af_find_devices_by_profile_and_cluster().
1783
of file app/framework/include/af.h
sl_zigbee_af_current_endpoint#
#define sl_zigbee_af_current_endpointValue:
()
Return the current endpoint that is being served.
The purpose of this macro is mostly to access endpoint that is being served in the command callbacks.
1932
of file app/framework/include/af.h
sl_zigbee_af_invalid_image_id#
const sl_zigbee_af_ota_image_id_t sl_zigbee_af_invalid_image_id
This variable defines an invalid image ID. It is used to determine if a returned sl_zigbee_af_ota_image_id_t is valid or not by passing the data to the function sl_zigbee_af_is_ota_image_id_valid().
981
of file app/framework/include/af.h
sl_zigbee_af_locate_attribute_metadata#
sl_zigbee_af_attribute_metadata_t * sl_zigbee_af_locate_attribute_metadata (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, sl_zigbee_af_attribute_id_t attributeId, uint8_t mask, uint16_t manufacturerCode)
Locate attribute metadata.
N/A | endpoint | Zigbee endpoint number. |
N/A | clusterId | Cluster ID of the sought cluster. |
N/A | attributeId | Attribute ID of the sought attribute. |
N/A | mask | CLUSTER_MASK_SERVER or CLUSTER_MASK_CLIENT |
N/A | manufacturerCode | Manufacturer code of the sough attribute. |
This function returns a pointer to the attribute metadata structure or NULL if attribute is not found.
Returns
Returns pointer to the attribute metadata location.
154
of file app/framework/include/af.h
sl_zigbee_af_contains_attribute#
bool sl_zigbee_af_contains_attribute (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, sl_zigbee_af_attribute_id_t attributeId, uint8_t mask, uint16_t manufacturerCode)
Return true if the attribute exists.
N/A | endpoint | |
N/A | clusterId | |
N/A | attributeId | |
N/A | mask | |
N/A | manufacturerCode |
162
of file app/framework/include/af.h
sl_zigbee_af_contains_cluster_with_mfg_code#
bool sl_zigbee_af_contains_cluster_with_mfg_code (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint16_t manufacturerCode)
Return true if an endpoint contains a cluster, checking for mfg code.
N/A | endpoint | Zigbee endpoint number. |
N/A | clusterId | Cluster ID of the sought cluster. |
N/A | manufacturerCode | Manufacturer code of the sought endpoint. |
This function returns true regardless of whether the endpoint contains server, client or both. For standard libraries (when ClusterId < FC00), the manufacturerCode is ignored.
184
of file app/framework/include/af.h
sl_zigbee_af_contains_cluster#
bool sl_zigbee_af_contains_cluster (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId)
Return true if the endpoint contains the ZCL cluster with specified ID.
N/A | endpoint | Zigbee endpoint number. |
N/A | clusterId | Cluster ID of the sought cluster. |
This function returns true regardless of whether the endpoint contains server, client or both in the Zigbee Cluster Library. This wraps sl_zigbee_af_contains_cluster_with_mfg_code with manufacturerCode = SL_ZIGBEE_AF_NULL_MANUFACTURER_CODE If this function is used with a manufacturer specific clusterId, it returns the first cluster that it finds in the Cluster table. It does not return any other clusters that share that ID.
200
of file app/framework/include/af.h
sl_zigbee_af_contains_server_with_mfg_code#
bool sl_zigbee_af_contains_server_with_mfg_code (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint16_t manufacturerCode)
Return true if the endpoint has a cluster server, checking for the mfg code.
N/A | endpoint | Zigbee endpoint number. |
N/A | clusterId | Cluster ID of the sought cluster. |
N/A | manufacturerCode | Manufacturer code of the sought cluster. |
This function returns true if the endpoint contains server of a given cluster. For standard libraries (when ClusterId < FC00), the manufacturerCode is ignored.
213
of file app/framework/include/af.h
sl_zigbee_af_contains_server#
bool sl_zigbee_af_contains_server (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId)
Return true if the endpoint contains the ZCL server with a specified ID.
N/A | endpoint | Zigbee endpoint number. |
N/A | clusterId | Cluster ID of the sought cluster. |
This function returns true if the endpoint contains server of a given cluster. This wraps sl_zigbee_af_contains_server with manufacturerCode = SL_ZIGBEE_AF_NULL_MANUFACTURER_CODE If this function is used with a manufacturer specific clusterId, it returns the first cluster that it finds in the Cluster table. It does not return any other clusters that share that ID.
229
of file app/framework/include/af.h
sl_zigbee_af_contains_client_with_mfg_code#
bool sl_zigbee_af_contains_client_with_mfg_code (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint16_t manufacturerCode)
Return true if the endpoint contains the cluster client.
N/A | endpoint | Zigbee endpoint number. |
N/A | clusterId | Cluster ID of the sought cluster. |
N/A | manufacturerCode | Manufacturer code of the sought cluster. |
This function returns true if the endpoint contains client of a given cluster. For standard library clusters (when ClusterId < FC00), the manufacturerCode is ignored.
243
of file app/framework/include/af.h
sl_zigbee_af_contains_client#
bool sl_zigbee_af_contains_client (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId)
Return true if the endpoint contains the ZCL client with a specified ID.
N/A | endpoint | Zigbee endpoint number. |
N/A | clusterId | Cluster ID of the sought cluster. |
This function returns true if the endpoint contains client of a given cluster. It wraps sl_zigbee_af_contains_client with manufacturerCode = SL_ZIGBEE_AF_NULL_MANUFACTURER_CODE If this function is used with a manufacturer-specific clusterId, it returns the first cluster that it finds in the Cluster table. It does not return any other clusters that share that ID.
259
of file app/framework/include/af.h
sl_zigbee_af_write_attribute#
sl_zigbee_af_status_t sl_zigbee_af_write_attribute (uint8_t endpoint, sl_zigbee_af_cluster_id_t cluster, sl_zigbee_af_attribute_id_t attributeID, uint8_t mask, uint8_t * dataPtr, sl_zigbee_af_attribute_type_t dataType)
Write an attribute performing all checks.
N/A | endpoint | Zigbee endpoint number. |
N/A | cluster | Cluster ID of the sought cluster. |
N/A | attributeID | Attribute ID of the sought attribute. |
N/A | mask | CLUSTER_MASK_SERVER or CLUSTER_MASK_CLIENT. |
N/A | dataPtr | Pointer to the ZCL attribute. |
N/A | dataType | ZCL attribute type. |
This function attempts to write the attribute value from the provided pointer. It only checks that the attribute exists. If it does, it writes the value into the attribute table for the given attribute.
This function does not check if the attribute is writable since the read only / writable characteristic of an attribute only pertains to external devices writing over the air. Because this function is called locally, it assumes that the device knows what it is doing and has permission to perform the given operation.
See Also
sl_zigbee_af_write_client_attribute, sl_zigbee_af_write_server_attribute, sl_zigbee_af_write_manufacturer_specific_client_attribute, sl_zigbee_af_write_manufacturer_specific_server_attribute
287
of file app/framework/include/af.h
sl_zigbee_af_write_server_attribute#
sl_zigbee_af_status_t sl_zigbee_af_write_server_attribute (uint8_t endpoint, sl_zigbee_af_cluster_id_t cluster, sl_zigbee_af_attribute_id_t attributeID, uint8_t * dataPtr, sl_zigbee_af_attribute_type_t dataType)
Write a cluster server attribute.
N/A | endpoint | Zigbee endpoint number. |
N/A | cluster | Cluster ID of the sought cluster. |
N/A | attributeID | Attribute ID of the sought attribute. |
N/A | dataPtr | Pointer to the ZCL attribute. |
N/A | dataType | ZCL attribute type. |
This function is the same as sl_zigbee_af_write_attribute except that it saves having to pass the cluster mask. This is useful for code saving because the write attribute is used frequently throughout the framework
See Also
sl_zigbee_af_write_client_attribute, sl_zigbee_af_write_manufacturer_specific_client_attribute, sl_zigbee_af_write_manufacturer_specific_server_attribute
312
of file app/framework/include/af.h
sl_zigbee_af_write_client_attribute#
sl_zigbee_af_status_t sl_zigbee_af_write_client_attribute (uint8_t endpoint, sl_zigbee_af_cluster_id_t cluster, sl_zigbee_af_attribute_id_t attributeID, uint8_t * dataPtr, sl_zigbee_af_attribute_type_t dataType)
Write a cluster client attribute.
N/A | endpoint | Zigbee endpoint number. |
N/A | cluster | Cluster ID of the sought cluster. |
N/A | attributeID | Attribute ID of the sought attribute. |
N/A | dataPtr | Pointer to the ZCL attribute. |
N/A | dataType | ZCL attribute type. |
This function is the same as sl_zigbee_af_write_attribute except that it saves having to pass the cluster mask. This is useful for code saving because the write attribute is used frequently throughout the framework.
See Also
sl_zigbee_af_write_server_attribute, sl_zigbee_af_write_manufacturer_specific_client_attribute, sl_zigbee_af_write_manufacturer_specific_server_attribute
336
of file app/framework/include/af.h
sl_zigbee_af_write_manufacturer_specific_server_attribute#
sl_zigbee_af_status_t sl_zigbee_af_write_manufacturer_specific_server_attribute (uint8_t endpoint, sl_zigbee_af_cluster_id_t cluster, sl_zigbee_af_attribute_id_t attributeID, uint16_t manufacturerCode, uint8_t * dataPtr, sl_zigbee_af_attribute_type_t dataType)
Write a manufacturer-specific server attribute.
N/A | endpoint | Zigbee endpoint number. |
N/A | cluster | Cluster ID of the sought cluster. |
N/A | attributeID | Attribute ID of the sought attribute. |
N/A | manufacturerCode | Manufacturer code of the sought cluster. |
N/A | dataPtr | Pointer to the ZCL attribute. |
N/A | dataType | ZCL attribute type. |
This function is the same as sl_zigbee_af_write_attribute except that it saves having to pass the cluster mask and allows passing a manufacturer code. This is useful for code saving because the write attribute is used frequently throughout the framework.
See Also
sl_zigbee_af_write_client_attribute, sl_zigbee_af_write_server_attribute, sl_zigbee_af_write_manufacturer_specific_client_attribute
361
of file app/framework/include/af.h
sl_zigbee_af_write_manufacturer_specific_client_attribute#
sl_zigbee_af_status_t sl_zigbee_af_write_manufacturer_specific_client_attribute (uint8_t endpoint, sl_zigbee_af_cluster_id_t cluster, sl_zigbee_af_attribute_id_t attributeID, uint16_t manufacturerCode, uint8_t * dataPtr, sl_zigbee_af_attribute_type_t dataType)
Write a manufacturer-specific client attribute.
N/A | endpoint | Zigbee endpoint number. |
N/A | cluster | Cluster ID of the sought cluster. |
N/A | attributeID | Attribute ID of the sought attribute. |
N/A | manufacturerCode | Manufacturer code of the sought cluster. |
N/A | dataPtr | Pointer to the ZCL attribute. |
N/A | dataType | ZCL attribute type. |
This function is the same as sl_zigbee_af_write_attribute except that it saves having to pass the cluster mask and allows passing of a manufacturer code. This is useful for code saving because the write attribute is used frequently throughout the framework.
See Also
sl_zigbee_af_write_client_attribute, sl_zigbee_af_write_server_attribute, sl_zigbee_af_write_manufacturer_specific_server_attribute
387
of file app/framework/include/af.h
sl_zigbee_af_verify_attribute_write#
sl_zigbee_af_status_t sl_zigbee_af_verify_attribute_write (uint8_t endpoint, sl_zigbee_af_cluster_id_t cluster, sl_zigbee_af_attribute_id_t attributeID, uint8_t mask, uint16_t manufacturerCode, uint8_t * dataPtr, sl_zigbee_af_attribute_type_t dataType)
Test the success of attribute write.
N/A | endpoint | Zigbee endpoint number |
N/A | cluster | Cluster ID of the sought cluster. |
N/A | attributeID | Attribute ID of the sought attribute. |
N/A | mask | CLUSTER_MASK_SERVER or CLUSTER_MASK_CLIENT |
N/A | manufacturerCode | Location where attribute will be written from. |
N/A | dataPtr | ZCL attribute type. |
N/A | dataType |
This function returns success if the attribute write is successful. It does not actually write anything, just validates for read-only and data-type.
408
of file app/framework/include/af.h
sl_zigbee_af_read_attribute#
sl_zigbee_af_status_t sl_zigbee_af_read_attribute (uint8_t endpoint, sl_zigbee_af_cluster_id_t cluster, sl_zigbee_af_attribute_id_t attributeID, uint8_t mask, uint8_t * dataPtr, uint8_t readLength, sl_zigbee_af_attribute_type_t * dataType)
Read the attribute value performing all the checks.
N/A | endpoint | Zigbee endpoint number |
N/A | cluster | Cluster ID of the sought cluster. |
N/A | attributeID | Attribute ID of the sought attribute. |
N/A | mask | CLUSTER_MASK_SERVER or CLUSTER_MASK_CLIENT |
N/A | dataPtr | Pointer to the ZCL attribute. |
N/A | readLength | Length of the attribute to be read. |
N/A | dataType | ZCL attribute type. |
This function attempts to read the attribute and store it into the pointer. It also reads the data type. Both dataPtr and dataType may be NULL, signifying that either value or type is not desired.
See Also
sl_zigbee_af_read_client_attribute, sl_zigbee_af_read_server_attribute, sl_zigbee_af_read_manufacturer_specific_client_attribute, sl_zigbee_af_read_manufacturer_specific_server_attribute
436
of file app/framework/include/af.h
sl_zigbee_af_read_server_attribute#
sl_zigbee_af_status_t sl_zigbee_af_read_server_attribute (uint8_t endpoint, sl_zigbee_af_cluster_id_t cluster, sl_zigbee_af_attribute_id_t attributeID, uint8_t * dataPtr, uint8_t readLength)
Read the server attribute value performing all the checks.
N/A | endpoint | Zigbee endpoint number |
N/A | cluster | Cluster ID of the sought cluster. |
N/A | attributeID | Attribute ID of the sought attribute. |
N/A | dataPtr | Pointer to the server attribute. |
N/A | readLength | Length of the attribute to be read. |
This function attempts to read the attribute and store it into the pointer. It also reads the data type. Both dataPtr and dataType may be NULL, signifying that either value or type is not desired.
See Also
sl_zigbee_af_read_client_attribute, sl_zigbee_af_read_manufacturer_specific_client_attribute, sl_zigbee_af_read_manufacturer_specific_server_attribute
462
of file app/framework/include/af.h
sl_zigbee_af_read_client_attribute#
sl_zigbee_af_status_t sl_zigbee_af_read_client_attribute (uint8_t endpoint, sl_zigbee_af_cluster_id_t cluster, sl_zigbee_af_attribute_id_t attributeID, uint8_t * dataPtr, uint8_t readLength)
Read the client attribute value, performing all the checks.
N/A | endpoint | Zigbee endpoint number |
N/A | cluster | Cluster ID of the sought cluster. |
N/A | attributeID | Attribute ID of the sought attribute. |
N/A | dataPtr | Pointer to the client attribute. |
N/A | readLength | Length of the attribute to be read. |
This function attempts to read the attribute and store it into the pointer. It also reads the data type. Both dataPtr and dataType may be NULL, signifying that either value or type is not desired.
See Also
sl_zigbee_af_read_server_attribute, sl_zigbee_af_read_manufacturer_specific_client_attribute, sl_zigbee_af_read_manufacturer_specific_server_attribute
486
of file app/framework/include/af.h
sl_zigbee_af_read_manufacturer_specific_server_attribute#
sl_zigbee_af_status_t sl_zigbee_af_read_manufacturer_specific_server_attribute (uint8_t endpoint, sl_zigbee_af_cluster_id_t cluster, sl_zigbee_af_attribute_id_t attributeID, uint16_t manufacturerCode, uint8_t * dataPtr, uint8_t readLength)
Read the manufacturer-specific server attribute value, performing all checks.
N/A | endpoint | Zigbee endpoint number |
N/A | cluster | Cluster ID of the sought cluster. |
N/A | attributeID | Attribute ID of the sought attribute. |
N/A | manufacturerCode | Manufacturer code of the sought cluster. |
N/A | dataPtr | Pointer to the server attribute. |
N/A | readLength | Length of the attribute to be read. |
This function attempts to read the attribute and store it into the pointer. It also reads the data type. Both dataPtr and dataType may be NULL, signifying that either value or type is not desired.
See Also
sl_zigbee_af_read_client_attribute, sl_zigbee_af_read_server_attribute, sl_zigbee_af_read_manufacturer_specific_client_attribute
510
of file app/framework/include/af.h
sl_zigbee_af_read_manufacturer_specific_client_attribute#
sl_zigbee_af_status_t sl_zigbee_af_read_manufacturer_specific_client_attribute (uint8_t endpoint, sl_zigbee_af_cluster_id_t cluster, sl_zigbee_af_attribute_id_t attributeID, uint16_t manufacturerCode, uint8_t * dataPtr, uint8_t readLength)
Read the manufacturer-specific client attribute value, performing all checks.
N/A | endpoint | Zigbee endpoint number |
N/A | cluster | Cluster ID of the sought cluster. |
N/A | attributeID | Attribute ID of the sought attribute. |
N/A | manufacturerCode | Manufacturer code of the sought cluster. |
N/A | dataPtr | Pointer to the server attribute. |
N/A | readLength | Length of the attribute to be read. |
This function attempts to read the attribute and store it into the pointer. It also reads the data type. Both dataPtr and dataType may be NULL, signifying that either value or type is not desired.
See Also
sl_zigbee_af_read_client_attribute, sl_zigbee_af_read_server_attribute, sl_zigbee_af_read_manufacturer_specific_server_attribute
535
of file app/framework/include/af.h
sl_zigbee_af_get_data_size#
uint8_t sl_zigbee_af_get_data_size (uint8_t dataType)
Return the size of the ZCL data in bytes.
N/A | dataType | ZCL data type |
Returns
Size in bytes or 0 if invalid data type
548
of file app/framework/include/af.h
sl_zigbee_af_get_open_network_duration_sec#
uint8_t sl_zigbee_af_get_open_network_duration_sec (void )
Return the number of seconds the network remains open.
N/A |
Returns
A return value of 0 indicates that the network is closed.
555
of file app/framework/include/af.h
sl_zigbee_af_endpoint_from_index#
uint8_t sl_zigbee_af_endpoint_from_index (uint8_t index)
Take an index of an endpoint and return the Zigbee endpoint.
N/A | index | Index of an endpoint. |
Returns
Zigbee endpoint.
642
of file app/framework/include/af.h
sl_zigbee_af_index_from_endpoint#
uint8_t sl_zigbee_af_index_from_endpoint (uint8_t endpoint)
N/A | endpoint | Zigbee endpoint. |
Return the index of a given endpoint.
Returns
Index of a Zigbee endpoint.
650
of file app/framework/include/af.h
sl_zigbee_af_index_from_endpoint_including_disabled_endpoints#
uint8_t sl_zigbee_af_index_from_endpoint_including_disabled_endpoints (uint8_t endpoint)
N/A | endpoint | Zigbee endpoint. |
Return the index of a given endpoint. It does not ignore disabled endpoints.
Returns
Index of a Zigbee endpoint.
658
of file app/framework/include/af.h
sl_zigbee_af_find_cluster_client_endpoint_index#
uint8_t sl_zigbee_af_find_cluster_client_endpoint_index (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId)
N/A | endpoint | Zigbee endpoint. |
N/A | clusterId | Cluster ID of a sought cluster. |
Return the endpoint index within a given cluster (Client-side), looking only for standard clusters.
Returns
Index of a Zigbee endpoint.
668
of file app/framework/include/af.h
sl_zigbee_af_find_cluster_server_endpoint_index#
uint8_t sl_zigbee_af_find_cluster_server_endpoint_index (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId)
N/A | endpoint | Zigbee endpoint. |
N/A | clusterId | Cluster ID of a sought cluster. |
Return the endpoint index within a given cluster (Server-side), looking only for standard clusters.
Returns
Index of a Zigbee endpoint.
678
of file app/framework/include/af.h
sl_zigbee_af_network_index_from_endpoint#
uint8_t sl_zigbee_af_network_index_from_endpoint (uint8_t endpoint)
Return the network index of a given endpoint.
N/A | endpoint | Zigbee endpoint. |
Returns
Network index of a Zigbee endpoint.
706
of file app/framework/include/af.h
sl_zigbee_af_endpoint_count#
uint8_t sl_zigbee_af_endpoint_count (void )
Return the total number of endpoints (dynamic and pre-compiled).
N/A |
724
of file app/framework/include/af.h
sl_zigbee_af_fixed_endpoint_count#
uint8_t sl_zigbee_af_fixed_endpoint_count (void )
Return the number of pre-compiled endpoints.
N/A |
729
of file app/framework/include/af.h
sl_zigbee_af_get_attribute_analog_or_discrete_type#
uint8_t sl_zigbee_af_get_attribute_analog_or_discrete_type (uint8_t dataType)
Return the type of the attribute, either ANALOG, DISCRETE, or NONE.
N/A | dataType |
776
of file app/framework/include/af.h
sl_zigbee_af_is_type_signed#
bool sl_zigbee_af_is_type_signed (sl_zigbee_af_attribute_type_t dataType)
Return true if type is signed, false otherwise.
N/A | dataType |
781
of file app/framework/include/af.h
sl_zigbee_af_get_int32u#
uint32_t sl_zigbee_af_get_int32u (const uint8_t * message, uint16_t currentIndex, uint16_t msgLen)
Extract a 32-bit integer from the message buffer.
N/A | message | |
N/A | currentIndex | |
N/A | msgLen |
786
of file app/framework/include/af.h
sl_zigbee_af_get_int24u#
uint32_t sl_zigbee_af_get_int24u (const uint8_t * message, uint16_t currentIndex, uint16_t msgLen)
Extract a 24-bit integer from the message buffer.
N/A | message | |
N/A | currentIndex | |
N/A | msgLen |
791
of file app/framework/include/af.h
sl_zigbee_af_get_int16u#
uint16_t sl_zigbee_af_get_int16u (const uint8_t * message, uint16_t currentIndex, uint16_t msgLen)
Extract a 16-bit integer from the message buffer.
N/A | message | |
N/A | currentIndex | |
N/A | msgLen |
796
of file app/framework/include/af.h
sl_zigbee_af_get_string#
uint8_t * sl_zigbee_af_get_string (uint8_t * message, uint16_t currentIndex, uint16_t msgLen)
Extract a ZCL string from the message buffer.
N/A | message | |
N/A | currentIndex | |
N/A | msgLen |
800
of file app/framework/include/af.h
sl_zigbee_af_get_long_string#
uint8_t * sl_zigbee_af_get_long_string (uint8_t * message, uint16_t currentIndex, uint16_t msgLen)
Extract a ZCL long string from the message buffer.
N/A | message | |
N/A | currentIndex | |
N/A | msgLen |
804
of file app/framework/include/af.h
sl_zigbee_af_get_date#
uint8_t sl_zigbee_af_get_date (uint8_t * message, uint16_t currentIndex, uint16_t msgLen, sl_zigbee_af_date_t * destination)
Return true if the cluster is in the manufacturer-specific range.
N/A | message | sl_zigbee_af_cluster_t* to consider |
N/A | currentIndex | |
N/A | msgLen | |
N/A | destination |
809
of file app/framework/include/af.h
sl_zigbee_af_copy_int16u#
void sl_zigbee_af_copy_int16u (uint8_t * data, uint16_t index, uint16_t x)
Copy a uint16_t value into a buffer.
N/A | data | |
N/A | index | |
N/A | x |
823
of file app/framework/include/af.h
sl_zigbee_af_copy_int24u#
void sl_zigbee_af_copy_int24u (uint8_t * data, uint16_t index, uint32_t x)
Copy a uint24_t value into a buffer.
N/A | data | |
N/A | index | |
N/A | x |
827
of file app/framework/include/af.h
sl_zigbee_af_copy_int32u#
void sl_zigbee_af_copy_int32u (uint8_t * data, uint16_t index, uint32_t x)
Copy a uint32_t value into a buffer.
N/A | data | |
N/A | index | |
N/A | x |
831
of file app/framework/include/af.h
sl_zigbee_af_copy_string#
void sl_zigbee_af_copy_string (uint8_t * dest, uint8_t * src, uint8_t size)
Return true if the cluster is in the manufacturer-specific range.
N/A | dest | sl_zigbee_af_cluster_t* to consider |
N/A | src | |
N/A | size |
837
of file app/framework/include/af.h
sl_zigbee_af_copy_long_string#
void sl_zigbee_af_copy_long_string (uint8_t * dest, uint8_t * src, uint16_t size)
Return true if the cluster is in the manufacturer-specific range.
N/A | dest | sl_zigbee_af_cluster_t* to consider |
N/A | src | |
N/A | size |
843
of file app/framework/include/af.h
sl_zigbee_af_string_length#
uint8_t sl_zigbee_af_string_length (const uint8_t * buffer)
Return true if the cluster is in the manufacturer-specific range.
N/A | buffer | sl_zigbee_af_cluster_t* to consider |
848
of file app/framework/include/af.h
sl_zigbee_af_long_string_length#
uint16_t sl_zigbee_af_long_string_length (const uint8_t * buffer)
Return true if the cluster is in the manufacturer-specific range.
N/A | buffer | sl_zigbee_af_cluster_t* to consider |
853
of file app/framework/include/af.h
sl_zigbee_af_attribute_value_size#
uint16_t sl_zigbee_af_attribute_value_size (sl_zigbee_af_attribute_type_t dataType, const uint8_t * buffer, const uint16_t bufferSize)
Return true if the cluster is in the manufacturer-specific range.
N/A | dataType | sl_zigbee_af_cluster_t* to consider |
N/A | buffer | |
N/A | bufferSize |
873
of file app/framework/include/af.h
sl_zigbee_af_is_device_enabled#
bool sl_zigbee_af_is_device_enabled (uint8_t endpoint)
Check whether the endpoint is enabled.
N/A | endpoint | Zigbee endpoint number |
This function returns true if device at a given endpoint is enabled. At startup, all endpoints are enabled.
906
of file app/framework/include/af.h
sl_zigbee_af_is_device_identifying#
bool sl_zigbee_af_is_device_identifying (uint8_t endpoint)
Check whether the endpoint is identifying.
N/A | endpoint | Zigbee endpoint number |
This function returns true if the device at a given endpoint is identifying.
916
of file app/framework/include/af.h
sl_zigbee_af_set_device_enabled#
void sl_zigbee_af_set_device_enabled (uint8_t endpoint, bool enabled)
Enable or disable an endpoint.
N/A | endpoint | Zigbee endpoint number |
N/A | enabled |
By calling this function, you turn off all processing of incoming traffic for a given endpoint.
926
of file app/framework/include/af.h
sl_zigbee_wakeup_common_task#
void sl_zigbee_wakeup_common_task (void )
Set the Zigbee stack task to ready when running on an OS.
N/A |
952
of file app/framework/include/af.h
sl_zigbee_af_endpoint_enable_disable#
bool sl_zigbee_af_endpoint_enable_disable (uint8_t endpoint, bool enable)
Enable/disable endpoints.
N/A | endpoint | |
N/A | enable |
957
of file app/framework/include/af.h
sl_zigbee_af_endpoint_index_is_enabled#
bool sl_zigbee_af_endpoint_index_is_enabled (uint8_t index)
Determine if an endpoint at the specified index is enabled or disabled.
N/A | index |
962
of file app/framework/include/af.h
sl_zigbee_af_is_this_data_type_a_string_type#
bool sl_zigbee_af_is_this_data_type_a_string_type (sl_zigbee_af_attribute_type_t dataType)
Return true if a given ZCL data type is a string type.
N/A | dataType |
Use this function to perform a different memory operation on a certain attribute because it is a string type. Since ZCL strings carry length as the first byte(s), it is often required to treat them differently than regular data types.
Returns
true if data type is a string.
993
of file app/framework/include/af.h
sl_zigbee_af_is_string_attribute_type#
bool sl_zigbee_af_is_string_attribute_type (sl_zigbee_af_attribute_type_t attributeType)
Return true if the given attribute type is a string.
N/A | attributeType |
996
of file app/framework/include/af.h
sl_zigbee_af_is_long_string_attribute_type#
bool sl_zigbee_af_is_long_string_attribute_type (sl_zigbee_af_attribute_type_t attributeType)
Return true if the given attribute type is a long string.
N/A | attributeType |
999
of file app/framework/include/af.h
sl_zigbee_af_next_sequence#
uint8_t sl_zigbee_af_next_sequence (void )
Increment the ZCL sequence number and return the value.
N/A |
ZCL messages have sequence numbers so that they can be matched up with other messages in the transaction. To avoid conflicts with sequence numbers generated independently by the application, this API returns sequence numbers with the high bit clear. If the application generates its own sequence numbers, it should use numbers with the high bit set.
Returns
The next ZCL sequence number.
1024
of file app/framework/include/af.h
sl_zigbee_af_get_last_sequence_number#
uint8_t sl_zigbee_af_get_last_sequence_number (void )
Retrieve the last sequence number that was used.
N/A |
1030
of file app/framework/include/af.h
sl_zigbee_af_compare_values#
int8_t sl_zigbee_af_compare_values (uint8_t * val1, uint8_t * val2, uint8_t len, bool signedNumber)
Compare two values of known length as integers.Simple integer comparison function. Signed integer comparison are supported for numbers with length of 4 (bytes) or less. The integers are in native endianness.
N/A | val1 | |
N/A | val2 | |
N/A | len | |
N/A | signedNumber |
Returns
-1, if val1 is smaller 0, if they are the same or if two negative numbers with length greater than 4 is being compared 1, if val2 is smaller.
1045
of file app/framework/include/af.h
sl_zigbee_af_get_eui64#
void sl_zigbee_af_get_eui64 (sl_802154_long_addr_t returnEui64)
Populate the passed EUI64 with the local EUI64 MAC address.
N/A | returnEui64 |
1050
of file app/framework/include/af.h
sl_zigbee_af_get_node_id#
sl_802154_short_addr_t sl_zigbee_af_get_node_id (void )
Return the node ID of the local node.
N/A |
1068
of file app/framework/include/af.h
sl_zigbee_af_generate_random_key#
sl_status_t sl_zigbee_af_generate_random_key (sl_zigbee_key_data_t * result)
Generate a random key (link, network, or master).
N/A | result |
1074
of file app/framework/include/af.h
sl_zigbee_af_get_pan_id#
sl_802154_pan_id_t sl_zigbee_af_get_pan_id (void )
Return the PAN ID of the local node.
N/A |
1082
of file app/framework/include/af.h
sl_zigbee_af_get_radio_channel#
uint8_t sl_zigbee_af_get_radio_channel (void )
Return the radioChannel of the current network.
N/A |
1087
of file app/framework/include/af.h
sl_zigbee_af_network_state#
sl_zigbee_network_status_t sl_zigbee_af_network_state (void )
Return the current network state. This call caches the results on the host to prevent frequent EZSP transactions.
N/A |
1093
of file app/framework/include/af.h
sl_zigbee_af_get_network_parameters#
sl_status_t sl_zigbee_af_get_network_parameters (sl_zigbee_node_type_t * nodeType, sl_zigbee_network_parameters_t * parameters)
Return the current network parameters.
N/A | nodeType | |
N/A | parameters |
1098
of file app/framework/include/af.h
sl_zigbee_af_get_node_type#
sl_status_t sl_zigbee_af_get_node_type (sl_zigbee_node_type_t * nodeType)
Return the current node type.
N/A | nodeType |
1104
of file app/framework/include/af.h
sl_zigbee_af_permit_join#
sl_status_t sl_zigbee_af_permit_join (uint8_t duration, bool broadcastMgmtPermitJoin)
Enable local permit join and optionally broadcast the ZDO Mgmt_Permit_Join_req message. This API can be called from any device type and still return SL_STATUS_OK. If the API is called from an end device, the permit association bit will just be left off.
N/A | duration | The duration that the permit join bit will remain on and other devices will be able to join the current network. |
N/A | broadcastMgmtPermitJoin | whether or not to broadcast the ZDO Mgmt_Permit_Join_req message. |
Returns
status of whether or not permit join was enabled.
1129
of file app/framework/include/af.h
sl_zigbee_af_broadcast_permit_join#
sl_status_t sl_zigbee_af_broadcast_permit_join (uint8_t duration)
Enable local permit join and broadcast the ZDO Mgmt_Permit_Join_req message. This API can be called from any device type and still return SL_STATUS_OK. If the API is called from an end device, the permit association bit will just be left off.
N/A | duration | The duration that the permit join bit will remain on and other devices will be able to join the current network. |
Returns
status of whether or not permit join was enabled.
1144
of file app/framework/include/af.h
sl_zigbee_af_acquire_lock#
void sl_zigbee_af_acquire_lock (void )
Acquire the app framework mutex (for RTOS builds). This should be done if code run from outside of the app framework (callback) context in RTOS builds needs to call app framework APIs, as interactions between app framework and other application tasks are not otherwise designed to be thread-safe. Note that APIs relating to app framework events are included in this category of app framework APIs (so thread-safe interactions with the event queue from other tasks require the acquisition of this lock).
N/A |
1160
of file app/framework/include/af.h
sl_zigbee_af_release_lock#
void sl_zigbee_af_release_lock (void )
Release the app framework mutex (for RTOS builds), allowing other application tasks (like the app framework task) waiting on this mutex to run. This should be done once the application code has finished its calls to app framework data or APIs.
N/A |
1168
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_tick_extended#
sl_status_t sl_zigbee_zcl_schedule_tick_extended (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, bool isClient, uint32_t delayMs, sl_zigbee_af_event_poll_control_t pollControl, sl_zigbee_af_event_sleep_control_t sleepControl)
Schedule a cluster-related event inside the application framework's event mechanism. This function provides a wrapper for the Ember stack event mechanism which allows the cluster code to access its events by their endpoint, cluster ID, and client/server identity. The passed poll and sleep controls allow the cluster to indicate whether it needs to long or short poll and whether it needs to stay awake or if it can sleep.
N/A | endpoint | The endpoint of the event to be scheduled. |
N/A | clusterId | The cluster id of the event to be scheduled. |
N/A | isClient | SL_ZIGBEE_AF_CLIENT_CLUSTER_TICK if the event to be scheduled is associated with a client cluster or SL_ZIGBEE_AF_SERVER_CLUSTER_TICK otherwise. |
N/A | delayMs | The number of milliseconds until the event should be called. |
N/A | pollControl | SL_ZIGBEE_AF_SHORT_POLL if the cluster needs to short poll or SL_ZIGBEE_AF_LONG_POLL otherwise. |
N/A | sleepControl | SL_ZIGBEE_AF_STAY_AWAKE if the cluster needs to stay awake or SL_ZIGBEE_AF_OK_TO_SLEEP otherwise. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1227
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_cluster_tick#
sl_status_t sl_zigbee_zcl_schedule_cluster_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, bool isClient, uint32_t delayMs, sl_zigbee_af_event_sleep_control_t sleepControl)
Schedule a cluster-related event inside the application framework's event mechanism. This function is a wrapper for ::sl_zigbee_af_schedule_tick_extended. The cluster on the given endpoint will be set to long poll if sleepControl is set to SL_ZIGBEE_AF_OK_TO_HIBERNATE or will be set to short poll otherwise. It will stay awake if sleepControl is SL_ZIGBEE_AF_STAY_AWAKE and will sleep otherwise.
N/A | endpoint | The endpoint of the event to be scheduled. |
N/A | clusterId | The cluster id of the event to be scheduled. |
N/A | isClient | SL_ZIGBEE_AF_CLIENT_CLUSTER_TICK if the event to be scheduled is associated with a client cluster or SL_ZIGBEE_AF_SERVER_CLUSTER_TICK otherwise. |
N/A | delayMs | The number of milliseconds until the event should be called. |
N/A | sleepControl | the priority of the event, what the processor should be allowed to do in terms of sleeping while the event is active. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1254
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_client_tick_extended#
sl_status_t sl_zigbee_zcl_schedule_client_tick_extended (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint32_t delayMs, sl_zigbee_af_event_poll_control_t pollControl, sl_zigbee_af_event_sleep_control_t sleepControl)
Schedule a cluster client event. This function is a wrapper for sl_zigbee_zcl_schedule_tick_extended.
N/A | endpoint | The endpoint of the event to be scheduled |
N/A | clusterId | The cluster id of the event to be scheduled |
N/A | delayMs | The number of milliseconds until the event should be called. |
N/A | pollControl | SL_ZIGBEE_AF_SHORT_POLL if the cluster needs to short poll or SL_ZIGBEE_AF_LONG_POLL otherwise. |
N/A | sleepControl | SL_ZIGBEE_AF_STAY_AWAKE if the cluster needs to stay awake or SL_ZIGBEE_AF_OK_TO_SLEEP otherwise. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1274
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_client_tick#
sl_status_t sl_zigbee_zcl_schedule_client_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint32_t delayMs)
Schedule a cluster client event. This function is a wrapper for sl_zigbee_zcl_schedule_client_tick_extended. It indicates that the cluster client on the given endpoint can long poll and can sleep.
N/A | endpoint | The endpoint of the event to be scheduled. |
N/A | clusterId | The cluster id of the event to be scheduled. |
N/A | delayMs | The number of milliseconds until the event should be called. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1291
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_server_tick_extended#
sl_status_t sl_zigbee_zcl_schedule_server_tick_extended (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint32_t delayMs, sl_zigbee_af_event_poll_control_t pollControl, sl_zigbee_af_event_sleep_control_t sleepControl)
Schedule a cluster server event. This function is a wrapper for sl_zigbee_zcl_schedule_tick_extended.
N/A | endpoint | The endpoint of the event to be scheduled. |
N/A | clusterId | The cluster id of the event to be scheduled. |
N/A | delayMs | The number of milliseconds until the event should be called. |
N/A | pollControl | SL_ZIGBEE_AF_SHORT_POLL if the cluster needs to short poll or SL_ZIGBEE_AF_LONG_POLL otherwise. |
N/A | sleepControl | SL_ZIGBEE_AF_STAY_AWAKE if the cluster needs to stay awake or SL_ZIGBEE_AF_OK_TO_SLEEP otherwise. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1309
of file app/framework/include/af.h
sl_zigbee_zcl_schedule_server_tick#
sl_status_t sl_zigbee_zcl_schedule_server_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, uint32_t delayMs)
Schedule a cluster server event. This function is a wrapper for sl_zigbee_zcl_schedule_server_tick_extended. It indicates that the cluster server on the given endpoint can long poll and can sleep.
N/A | endpoint | The endpoint of the event to be scheduled |
N/A | clusterId | The cluster id of the event to be scheduled. |
N/A | delayMs | The number of milliseconds until the event should be called. |
Returns
SL_STATUS_OK if the event was scheduled or an error otherwise.
1326
of file app/framework/include/af.h
sl_zigbee_zcl_deactivate_cluster_tick#
sl_status_t sl_zigbee_zcl_deactivate_cluster_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId, bool isClient)
Deactivate a cluster-related event. This function provides a wrapper for the Ember stack's event mechanism, which allows an event to be accessed by its endpoint, cluster ID, and client/server identity.
N/A | endpoint | The endpoint of the event to be deactivated. |
N/A | clusterId | The cluster id of the event to be deactivated. |
N/A | isClient | SL_ZIGBEE_AF_CLIENT_CLUSTER_TICK if the event to be deactivated is a client cluster SL_ZIGBEE_AF_SERVER_CLUSTER_TICK otherwise. |
Returns
SL_STATUS_OK if the event was deactivated or an error otherwise.
1344
of file app/framework/include/af.h
sl_zigbee_zcl_deactivate_client_tick#
sl_status_t sl_zigbee_zcl_deactivate_client_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId)
Deactivate a cluster client event. This function is a wrapper for sl_zigbee_zcl_deactivate_cluster_tick.
N/A | endpoint | The endpoint of the event to be deactivated. |
N/A | clusterId | The cluster id of the event to be deactivated. |
Returns
SL_STATUS_OK if the event was deactivated or an error otherwise.
1357
of file app/framework/include/af.h
sl_zigbee_zcl_deactivate_server_tick#
sl_status_t sl_zigbee_zcl_deactivate_server_tick (uint8_t endpoint, sl_zigbee_af_cluster_id_t clusterId)
Deactivate a cluster server event. This function is a wrapper for sl_zigbee_zcl_deactivate_cluster_tick.
N/A | endpoint | The endpoint of the event to be deactivated. |
N/A | clusterId | The cluster ID of the event to be deactivated. |
Returns
SL_STATUS_OK if the event was deactivated or an error otherwise.
1369
of file app/framework/include/af.h
sl_zigbee_af_send_response#
sl_status_t sl_zigbee_af_send_response (void )
Send a ZCL response, based on the information that is currently in the outgoing buffer. It is expected that a complete ZCL message is present, including header. The application may use this method directly from within the message handling function and associated callbacks. However, this will result in the response being sent before the APS ACK is sent, which is not ideal.
N/A |
NOTE: This will overwrite the ZCL sequence number of the message to use the LAST received sequence number.
1466
of file app/framework/include/af.h
sl_zigbee_af_send_response_with_cb#
sl_status_t sl_zigbee_af_send_response_with_cb (sl_zigbee_af_message_sent_function_t callback)
Send ZCL response with attached message sent callback.
N/A | callback |
1471
of file app/framework/include/af.h
sl_zigbee_af_send_multicast#
sl_status_t sl_zigbee_af_send_multicast (sl_zigbee_multicast_id_t multicastId, sl_802154_short_addr_t alias, uint8_t sequence, sl_zigbee_aps_frame_t * apsFrame, uint16_t messageLength, uint8_t * message)
Send a multicast message to all endpoints that share a specific multicast ID and are within a specified number of hops of the sender.
N/A | multicastId | The multicastId |
N/A | alias | The alias from which to send the multicast. If not needed use SL_ZIGBEE_NULL_NODE_ID |
N/A | sequence | The aliased NWK sequence number for the message. Only used if there is an alias source. |
N/A | apsFrame | The aps frame |
N/A | messageLength | The mmessageLength |
N/A | message | A message. |
Returns
An sl_status_t value. For any result other than SL_STATUS_OK, the message will not be sent.
1492
of file app/framework/include/af.h
sl_zigbee_af_send_multicast_to_bindings#
sl_status_t sl_zigbee_af_send_multicast_to_bindings (sl_zigbee_aps_frame_t * apsFrame, uint16_t messageLength, uint8_t * message)
Multicast the message to the group in the binding table that match the cluster and source endpoint in the APS frame. Note: if the binding table contains many matching entries, calling this API cause a significant amount of network traffic. Care should be taken when considering the effects of broadcasts in a network.
N/A | apsFrame | |
N/A | messageLength | |
N/A | message |
1506
of file app/framework/include/af.h
sl_zigbee_af_send_multicast_with_cb#
sl_status_t sl_zigbee_af_send_multicast_with_cb (sl_zigbee_multicast_id_t multicastId, sl_802154_short_addr_t alias, uint8_t sequence, sl_zigbee_aps_frame_t * apsFrame, uint16_t messageLength, uint8_t * message, sl_zigbee_af_message_sent_function_t callback)
Send multicast with attached message sent callback.
N/A | multicastId | |
N/A | alias | |
N/A | sequence | |
N/A | apsFrame | |
N/A | messageLength | |
N/A | message | |
N/A | callback |
1513
of file app/framework/include/af.h
sl_zigbee_af_send_broadcast#
sl_status_t sl_zigbee_af_send_broadcast (sl_802154_short_addr_t alias, sl_802154_short_addr_t destination, uint8_t sequence, sl_zigbee_aps_frame_t * apsFrame, uint16_t messageLength, uint8_t * message)
Send a broadcast message as per the ZigBee specification.
N/A | alias | The aliased source from which to send the broadcast. SL_ZIGBEE__NULL_NODE_ID could be used if this is a simple broadcast message, and not aliased/proxied |
N/A | destination | The destination to which to send the broadcast. This must be one of three ZigBee broadcast addresses. |
N/A | sequence | The NWK sequence number for the message, if there is a non-null alias source |
N/A | apsFrame | The APS frame data to be included in the message. |
N/A | messageLength | messageLength |
N/A | message | The actual message to be sent. |
The message will be delivered to all nodes within radius
hops of the sender. A radius of zero is converted to ::SL_ZIGBEE_MAX_HOPS.
Returns
An sl_status_t value.
1542
of file app/framework/include/af.h
sl_zigbee_af_send_broadcast_with_cb#
sl_status_t sl_zigbee_af_send_broadcast_with_cb (sl_802154_short_addr_t destination, sl_zigbee_aps_frame_t * apsFrame, uint16_t messageLength, uint8_t * message, sl_802154_short_addr_t alias, uint8_t sequence, sl_zigbee_af_message_sent_function_t callback)
Send broadcast with attached message sent callback.
N/A | destination | |
N/A | apsFrame | |
N/A | messageLength | |
N/A | message | |
N/A | alias | |
N/A | sequence | |
N/A | callback |
1552
of file app/framework/include/af.h
sl_zigbee_af_send_unicast#
sl_status_t sl_zigbee_af_send_unicast (sl_zigbee_outgoing_message_type_t type, uint16_t indexOrDestination, sl_zigbee_aps_frame_t * apsFrame, uint16_t messageLength, uint8_t * message)
Send unicast.
N/A | type | |
N/A | indexOrDestination | |
N/A | apsFrame | |
N/A | messageLength | |
N/A | message |
1563
of file app/framework/include/af.h
sl_zigbee_af_send_unicast_with_cb#
sl_status_t sl_zigbee_af_send_unicast_with_cb (sl_zigbee_outgoing_message_type_t type, uint16_t indexOrDestination, sl_zigbee_aps_frame_t * apsFrame, uint16_t messageLength, uint8_t * message, sl_zigbee_af_message_sent_function_t callback)
Send unicast with attached message sent callback.
N/A | type | |
N/A | indexOrDestination | |
N/A | apsFrame | |
N/A | messageLength | |
N/A | message | |
N/A | callback |
1572
of file app/framework/include/af.h
sl_zigbee_af_send_unicast_to_bindings#
sl_status_t sl_zigbee_af_send_unicast_to_bindings (sl_zigbee_aps_frame_t * apsFrame, uint16_t messageLength, uint8_t * message)
Unicast the message to each remote node in the binding table that matches the cluster and source endpoint in the APS frame. Note: if the binding table contains many matching entries, calling this API cause a significant amount of network traffic.
N/A | apsFrame | |
N/A | messageLength | |
N/A | message |
1585
of file app/framework/include/af.h
sl_zigbee_af_send_unicast_to_bindings_with_cb#
sl_status_t sl_zigbee_af_send_unicast_to_bindings_with_cb (sl_zigbee_aps_frame_t * apsFrame, uint16_t messageLength, uint8_t * message, sl_zigbee_af_message_sent_function_t callback)
sl_zigbee_af_send_unicast_to_bindings with attached message sent callback.
N/A | apsFrame | |
N/A | messageLength | |
N/A | message | |
N/A | callback |
1592
of file app/framework/include/af.h
sl_zigbee_af_send_inter_pan#
sl_status_t sl_zigbee_af_send_inter_pan (sl_802154_pan_id_t panId, const sl_802154_long_addr_t destinationLongId, sl_802154_short_addr_t destinationShortId, sl_zigbee_multicast_id_t multicastId, sl_zigbee_af_cluster_id_t clusterId, sl_zigbee_af_profile_id_t profileId, uint16_t messageLength, uint8_t * messageBytes)
Send interpan message.
N/A | panId | |
N/A | destinationLongId | |
N/A | destinationShortId | |
N/A | multicastId | |
N/A | clusterId | |
N/A | profileId | |
N/A | messageLength | |
N/A | messageBytes |
1600
of file app/framework/include/af.h
sl_zigbee_af_send_command_unicast_to_bindings#
sl_status_t sl_zigbee_af_send_command_unicast_to_bindings (void )
Send the command prepared with sl_zigbee_af_fill.... macro.
N/A |
This function is used to send a command that was previously prepared using the sl_zigbee_af_fill... macros from the client command API. It will be sent as unicast to each remote node in the binding table that matches the cluster and source endpoint in the APS frame. Note: if the binding table contains many matching entries, calling this API cause a significant amount of network traffic.
1619
of file app/framework/include/af.h
sl_zigbee_af_send_command_unicast_to_bindings_with_cb#
sl_status_t sl_zigbee_af_send_command_unicast_to_bindings_with_cb (sl_zigbee_af_message_sent_function_t callback)
sl_zigbee_af_send_command_unicast_to_bindings with attached message sent callback.
N/A | callback |
1624
of file app/framework/include/af.h
sl_zigbee_af_send_command_multicast#
sl_status_t sl_zigbee_af_send_command_multicast (sl_zigbee_multicast_id_t multicastId, sl_802154_short_addr_t alias, uint8_t sequence)
Send the command prepared with sl_zigbee_af_fill.... macro.
N/A | multicastId | |
N/A | alias | |
N/A | sequence |
This function is used to send a command that was previously prepared using the sl_zigbee_af_fill... macros from the client command API. It will be sent as multicast.
1633
of file app/framework/include/af.h
sl_zigbee_af_send_command_multicast_with_cb#
sl_status_t sl_zigbee_af_send_command_multicast_with_cb (sl_zigbee_multicast_id_t multicastId, sl_802154_short_addr_t alias, uint8_t sequence, sl_zigbee_af_message_sent_function_t callback)
sl_zigbee_af_send_command_multicast with attached message sent callback.
N/A | multicastId | |
N/A | alias | |
N/A | sequence | |
N/A | callback |
1638
of file app/framework/include/af.h
sl_zigbee_af_send_command_multicast_to_bindings#
sl_status_t sl_zigbee_af_send_command_multicast_to_bindings (void )
Send the command prepared with sl_zigbee_af_fill.... macro.
N/A |
This function is used to send a command that was previously prepared using the sl_zigbee_af_fill... macros from the client command API. It will be sent as multicast to the group specified in the binding table that matches the cluster and source endpoint in the APS frame. Note: if the binding table contains many matching entries, calling this API cause a significant amount of network traffic.
1651
of file app/framework/include/af.h
sl_zigbee_af_send_command_unicast#
sl_status_t sl_zigbee_af_send_command_unicast (sl_zigbee_outgoing_message_type_t type, uint16_t indexOrDestination)
Send the command prepared with sl_zigbee_af_fill.... macro.
N/A | type | |
N/A | indexOrDestination |
This function is used to send a command that was previously prepared using the sl_zigbee_af_fill... macros from the client command API. It will be sent as unicast.
1659
of file app/framework/include/af.h
sl_zigbee_af_send_command_unicast_with_cb#
sl_status_t sl_zigbee_af_send_command_unicast_with_cb (sl_zigbee_outgoing_message_type_t type, uint16_t indexOrDestination, sl_zigbee_af_message_sent_function_t callback)
sl_zigbee_af_send_command_unicast with attached message sent callback.
N/A | type | |
N/A | indexOrDestination | |
N/A | callback |
1665
of file app/framework/include/af.h
sl_zigbee_af_send_command_broadcast#
sl_status_t sl_zigbee_af_send_command_broadcast (sl_802154_short_addr_t destination, sl_802154_short_addr_t alias, uint8_t sequence)
Send the command prepared with sl_zigbee_af_fill.... macro.
N/A | destination | |
N/A | alias | |
N/A | sequence |
This function is used to send a command that was previously prepared using the sl_zigbee_af_fill... macros from the client command API.
1675
of file app/framework/include/af.h
sl_zigbee_af_send_command_broadcast_with_cb#
sl_status_t sl_zigbee_af_send_command_broadcast_with_cb (sl_802154_short_addr_t destination, sl_802154_short_addr_t alias, uint8_t sequence, sl_zigbee_af_message_sent_function_t callback)
sl_zigbee_af_send_command_broadcast with attached message sent callback.
N/A | destination | |
N/A | alias | |
N/A | sequence | |
N/A | callback |
1682
of file app/framework/include/af.h
sl_zigbee_af_send_command_inter_pan#
sl_status_t sl_zigbee_af_send_command_inter_pan (sl_802154_pan_id_t panId, const sl_802154_long_addr_t destinationLongId, sl_802154_short_addr_t destinationShortId, sl_zigbee_multicast_id_t multicastId, sl_zigbee_af_profile_id_t profileId)
Send the command prepared with sl_zigbee_af_fill.... macro.
N/A | panId | |
N/A | destinationLongId | |
N/A | destinationShortId | |
N/A | multicastId | |
N/A | profileId |
This function is used to send a command that was previously prepared using the sl_zigbee_af_fill... macros from the client command API. It will be sent via inter-PAN. If destinationLongId is not NULL, the message will be sent to that long address using long addressing mode; otherwise, the message will be sent to destinationShortId using short address mode. IF multicastId is not zero, the message will be sent using multicast mode.
1697
of file app/framework/include/af.h
sl_zigbee_af_send_default_response#
sl_status_t sl_zigbee_af_send_default_response (const sl_zigbee_af_cluster_command_t * cmd, sl_zigbee_af_status_t status)
Send a default response to a cluster command.
N/A | cmd | The cluster command to which to respond. |
N/A | status | Status code for the default response command. |
This function is used to prepare and send a default response to a cluster command.
Returns
An sl_status_t value that indicates the success or failure of sending the response.
1714
of file app/framework/include/af.h
sl_zigbee_af_send_default_response_with_cb#
sl_status_t sl_zigbee_af_send_default_response_with_cb (const sl_zigbee_af_cluster_command_t * cmd, sl_zigbee_af_status_t status, sl_zigbee_af_message_sent_function_t callback)
sl_zigbee_af_send_default_response with attached message sent callback.
N/A | cmd | |
N/A | status | |
N/A | callback |
1720
of file app/framework/include/af.h
sl_zigbee_af_send_immediate_default_response#
sl_status_t sl_zigbee_af_send_immediate_default_response (sl_zigbee_af_status_t status)
Send a default response to a cluster command using the current command.
N/A | status | Status code for the default response command. |
This function is used to prepare and send a default response to a cluster command.
Returns
An sl_status_t value that indicates the success or failure of sending the response.
1735
of file app/framework/include/af.h
sl_zigbee_af_send_immediate_default_response_with_cb#
sl_status_t sl_zigbee_af_send_immediate_default_response_with_cb (sl_zigbee_af_status_t status, sl_zigbee_af_message_sent_function_t callback)
sl_zigbee_af_send_immediate_default_response with attached message sent callback.
N/A | status | |
N/A | callback |
1740
of file app/framework/include/af.h
sl_zigbee_af_maximum_aps_payload_length#
uint8_t sl_zigbee_af_maximum_aps_payload_length (sl_zigbee_outgoing_message_type_t type, uint16_t indexOrDestination, sl_zigbee_aps_frame_t * apsFrame)
Return the maximum size of the payload that the Application Support sub-layer will accept for the given message type, destination, and APS frame.
N/A | type | The outgoing message type. |
N/A | indexOrDestination | Depending on the message type, this is either the sl_802154_short_addr_t of the destination, an index into the address table, an index into the binding table, the multicast identifier, or a broadcast address. |
N/A | apsFrame | The APS frame for the message. |
The size depends on multiple factors, including the security level in use and additional information added to the message to support the various options.
Returns
The maximum APS payload length for the given message.
1759
of file app/framework/include/af.h
sl_zigbee_af_get_command_aps_frame#
sl_zigbee_aps_frame_t * sl_zigbee_af_get_command_aps_frame (void )
Access to client API APS frame.
N/A |
1766
of file app/framework/include/af.h
sl_zigbee_af_set_command_endpoints#
void sl_zigbee_af_set_command_endpoints (uint8_t sourceEndpoint, uint8_t destinationEndpoint)
Set the source and destination endpoints in the client API APS frame.
N/A | sourceEndpoint | |
N/A | destinationEndpoint |
1771
of file app/framework/include/af.h
sl_zigbee_af_find_devices_by_profile_and_cluster#
sl_status_t sl_zigbee_af_find_devices_by_profile_and_cluster (sl_802154_short_addr_t target, sl_zigbee_af_profile_id_t profileId, sl_zigbee_af_cluster_id_t clusterId, bool serverCluster, sl_zigbee_af_service_discovery_callback_t * callback)
Find devices in the network with endpoints matching a given profile ID and cluster ID in their descriptors. Target may either be a specific device, or the broadcast address SL_ZIGBEE_RX_ON_WHEN_IDLE_BROADCAST_ADDRESS.
N/A | target | The destination node ID for the discovery; either a specific node's ID or SL_ZIGBEE_RX_ON_WHEN_IDLE_BROADCAST_ADDRESS. |
N/A | profileId | The application profile for the cluster being discovered. |
N/A | clusterId | The cluster being discovered. |
N/A | serverCluster | SL_ZIGBEE_AF_SERVER_CLUSTER_DISCOVERY (true) if discovering servers for the target cluster; SL_ZIGBEE_AF_CLIENT_CLUSTER_DISCOVERY (false) if discovering clients for that cluster. |
N/A | callback | Function pointer for the callback function triggered when a match is discovered. (For broadcast discoveries, this is called once per matching node, even if a node has multiple matching endpoints.) |
This function initiates a service discovery. Received responses are returned by executing the callback function passed in. For unicast discoveries, the callback will be executed only once. Either the target will return a result or a timeout will occur. For broadcast discoveries, the callback may be called multiple times and after a period of time the discovery will be finished with a final call to the callback.
1810
of file app/framework/include/af.h
sl_zigbee_af_find_clusters_by_device_and_endpoint#
sl_status_t sl_zigbee_af_find_clusters_by_device_and_endpoint (sl_802154_short_addr_t target, uint8_t targetEndpoint, sl_zigbee_af_service_discovery_callback_t * callback)
Find all of the given in and out clusters implemented on a devices given endpoint. Target should only be the short address of a specific device.
N/A | target | The destination node ID for the discovery. This should be a specific node's ID and should not be a broadcast address. |
N/A | targetEndpoint | The endpoint to target with the discovery process. |
N/A | callback | Function pointer for the callback function triggered when the discovery is returned. |
This function initiates a single service discovery and the response is passed back to the passed callback.
1830
of file app/framework/include/af.h
sl_zigbee_af_find_ieee_address#
sl_status_t sl_zigbee_af_find_ieee_address (sl_802154_short_addr_t shortAddress, sl_zigbee_af_service_discovery_callback_t * callback)
Initiate a discovery for the IEEE address of the specified node ID. This will send a unicast sent to the target node ID.
N/A | shortAddress | |
N/A | callback |
1839
of file app/framework/include/af.h
sl_zigbee_af_find_node_id#
sl_status_t sl_zigbee_af_find_node_id (sl_802154_long_addr_t longAddress, sl_zigbee_af_service_discovery_callback_t * callback)
Initiate a discovery for the short ID of the specified long address. This will send a broadcast to all RX-on-when-idle devices (non-sleepies).
N/A | longAddress | |
N/A | callback |
1847
of file app/framework/include/af.h
sl_zigbee_af_find_active_endpoints#
sl_status_t sl_zigbee_af_find_active_endpoints (sl_802154_short_addr_t target, sl_zigbee_af_service_discovery_callback_t * callback)
Initiate an Active Endpoint request ZDO message to the target node ID.
N/A | target | |
N/A | callback |
1853
of file app/framework/include/af.h
sl_zigbee_af_add_address_table_entry#
uint8_t sl_zigbee_af_add_address_table_entry (sl_802154_long_addr_t longId, sl_802154_short_addr_t shortId)
Add an entry for a remote device to the address table.
N/A | longId | The EUI64 of the remote device. |
N/A | shortId | The node ID of the remote device or ::SL_ZIGBEE_UNKNOWN_NODE_ID if the node ID is currently unknown. |
If the EUI64 already exists in the address table, the index of the existing entry will be returned. Otherwise, a new entry will be created and the new new index will be returned. The framework will remember how many times the returned index has been referenced. When the address table entry is no longer needed, the application should remove its reference by calling sl_zigbee_af_remove_address_table_entry.
Returns
The index of the address table entry for this remove device or ::SL_ZIGBEE_NULL_ADDRESS_TABLE_INDEX if an error occurred (e.g., the address table is full).
1874
of file app/framework/include/af.h
sl_zigbee_af_set_address_table_entry#
sl_status_t sl_zigbee_af_set_address_table_entry (uint8_t index, sl_802154_long_addr_t longId, sl_802154_short_addr_t shortId)
Add an entry for a remote device to the address table at a specific location.
N/A | index | The index of the address table entry. |
N/A | longId | The EUI64 of the remote device. |
N/A | shortId | The node id of the remote device or ::SL_ZIGBEE_UNKNOWN_NODE_ID if the node id is currently unknown. |
The framework will remember how many times an address table index has been referenced through sl_zigbee_af_add_address_table_entry. If the reference count for the index passed to this function is not zero, the entry will be not changed. When the address table entry is no longer needed, the application should remove its reference by calling sl_zigbee_af_remove_address_table_entry.
Returns
SL_STATUS_OK if the address table entry was successfully set, SL_STATUS_ZIGBEE_ADDRESS_TABLE_ENTRY_IS_ACTIVE if any messages are being sent using the existing entry at that index or the entry is still referenced in the framework, or SL_STATUS_INVALID_RANGE if the index is out of range.
1896
of file app/framework/include/af.h
sl_zigbee_af_remove_address_table_entry#
sl_status_t sl_zigbee_af_remove_address_table_entry (uint8_t index)
Remove a specific entry from the address table.
N/A | index | The index of the address table entry. |
The framework will remember how many times an address table index has been referenced through sl_zigbee_af_add_address_table_entry and sl_zigbee_af_set_address_table_entry. The address table entry at this index will not actually be removed until its reference count reaches zero.
Returns
SL_STATUS_OK if the address table entry was successfully removed or SL_STATUS_INVALID_RANGE if the index is out of range.
1912
of file app/framework/include/af.h
sl_zigbee_af_initiate_key_establishment#
sl_status_t sl_zigbee_af_initiate_key_establishment (sl_802154_short_addr_t nodeId, uint8_t endpoint)
Initiate key establishment with a remote node. sl_zigbee_af_key_establishment_cb will be called as events occur and when key establishment completes.
N/A | nodeId | The node ID of the remote device. |
N/A | endpoint | The endpoint on the remote device. |
Returns
SL_STATUS_OK if key establishment was initiated successfully
1943
of file app/framework/include/af.h
sl_zigbee_af_initiate_inter_pan_key_establishment#
sl_status_t sl_zigbee_af_initiate_inter_pan_key_establishment (sl_802154_pan_id_t panId, const sl_802154_long_addr_t eui64)
Initiate key establishment with a remote node on a different PAN. sl_zigbee_af_inter_pan_key_establishment_cb will be called as events occur and when key establishment completes.
N/A | panId | The PAN ID of the remote device. |
N/A | eui64 | The EUI64 of the remote device. |
Returns
SL_STATUS_OK if key establishment was initiated successfully
1953
of file app/framework/include/af.h
sl_zigbee_af_performing_key_establishment#
bool sl_zigbee_af_performing_key_establishment (void )
Indicate whether the device is in the process of performing key establishment.
N/A |
Returns
::true if key establishment is in progress.
1961
of file app/framework/include/af.h
sl_zigbee_af_initiate_partner_link_key_exchange#
sl_status_t sl_zigbee_af_initiate_partner_link_key_exchange (sl_802154_short_addr_t target, uint8_t endpoint, sl_zigbee_af_partner_link_key_exchange_callback_t * callback)
Initiate partner link key exchange with a remote node.
N/A | target | The node ID of the remote device. |
N/A | endpoint | The key establishment endpoint of the remote device. |
N/A | callback | The callback that should be called when the partner link key exchange completes. |
Returns
SL_STATUS_OK if the partner link key exchange was initiated successfully.
1973
of file app/framework/include/af.h
sl_zigbee_af_is_current_security_profile_smart_energy#
bool sl_zigbee_af_is_current_security_profile_smart_energy (void )
Use this function to determine if the security profile of the current network was set to Smart Energy. The security profile is configured in AppBuilder. @ return true if the security profile is Smart Energy or false otherwise.
N/A |
1992
of file app/framework/include/af.h
sl_zigbee_subscribe_to_zcl_commands#
sl_status_t sl_zigbee_subscribe_to_zcl_commands (uint16_t cluster_id, uint16_t manufacturer_id, uint8_t direction, sl_service_function_t service_function)
Runtime subscription to specific incoming ZCL commands.
N/A | cluster_id | The cluster ID of the ZCL messages to subscribe to. |
N/A | manufacturer_id | The manufacturer ID if any. If not set, a value of 0xFFFF should be passed in. |
N/A | direction | A value of ZCL_DIRECTION_CLIENT_TO_SERVER or ZCL_DIRECTION_SERVER_TO_CLIENT specifying the side (client or server) of the ZCL messages to subscribe to. |
N/A | service_function | A sl_service_function_t function pointer specifying the function to be invoked when an incoming ZCL command matches the criteria specified in this API. |
Returns
A sl_status_t value of:
SL_STATUS_OK - If the subscription was successful.
SL_STATUS_INVALID_PARAMETER - If one or more passed parameters are invalid.
SL_STATUS_ALLOCATION_FAILED - If the system failed to allocate the necessary data structures.
2085
of file app/framework/include/af.h
sl_zigbee_af_form_network#
sl_status_t sl_zigbee_af_form_network (sl_zigbee_network_parameters_t * parameters)
Form a new network using the specified network parameters.
N/A | parameters | Specification of the new network. |
Returns
An sl_status_t value that indicates either the successful formation of the new network or the reason that the network formation failed.
2165
of file app/framework/include/af.h
sl_zigbee_af_join_network#
sl_status_t sl_zigbee_af_join_network (sl_zigbee_network_parameters_t * parameters)
Associate with the network using the specified network parameters.
N/A | parameters | Specification of the network with which the node should associate. |
Returns
An sl_status_t value that indicates either that the association process began successfully or the reason for failure.
2175
of file app/framework/include/af.h
sl_zigbee_af_find_unused_pan_id_and_form#
sl_status_t sl_zigbee_af_find_unused_pan_id_and_form (void )
Find an unused PAN ID and form a new network.
N/A |
Returns
An sl_status_t value that indicates either the process begin successfully or the reason for failure.
2183
of file app/framework/include/af.h
sl_zigbee_af_start_search_for_joinable_network#
sl_status_t sl_zigbee_af_start_search_for_joinable_network (void )
Find a joinable network and join it.
N/A |
Returns
An sl_status_t value that indicates either the process begin successfully or the reason for failure.
2189
of file app/framework/include/af.h
sl_zigbee_af_push_network_index#
sl_status_t sl_zigbee_af_push_network_index (uint8_t networkIndex)
Set the current network to that of the given index and add it to the stack of networks maintained by the framework. Every call to this API must be paired with a subsequent call to sl_zigbee_af_pop_network_index.
N/A | networkIndex |
2200
of file app/framework/include/af.h
sl_zigbee_af_push_callback_network_index#
sl_status_t sl_zigbee_af_push_callback_network_index (void )
Set the current network to the callback network and adds it to the stack of networks maintained by the framework. Every call to this API must be paired with a subsequent call to sl_zigbee_af_pop_network_index.
N/A |
2206
of file app/framework/include/af.h
sl_zigbee_af_push_endpoint_network_index#
sl_status_t sl_zigbee_af_push_endpoint_network_index (uint8_t endpoint)
Set the current network to that of the given endpoint and adds it to the stack of networks maintained by the framework. Every call to this API must be paired with a subsequent call to sl_zigbee_af_pop_network_index.
N/A | endpoint |
2212
of file app/framework/include/af.h
sl_zigbee_af_pop_network_index#
sl_status_t sl_zigbee_af_pop_network_index (void )
Remove the topmost network from the stack of networks maintained by the framework and sets the current network to the new topmost network. Every call to this API must be paired with a prior call to sl_zigbee_af_push_network_index, sl_zigbee_af_push_callback_network_index, or sl_zigbee_af_push_endpoint_network_index.
N/A |
2220
of file app/framework/include/af.h
sl_zigbee_af_primary_endpoint_for_network_index#
uint8_t sl_zigbee_af_primary_endpoint_for_network_index (uint8_t networkIndex)
Return the primary endpoint of the given network index or 0xFF if no endpoints belong to the network.sl_zigbee_af_status.
N/A | networkIndex |
2225
of file app/framework/include/af.h
sl_zigbee_af_primary_endpoint_for_current_network_index#
uint8_t sl_zigbee_af_primary_endpoint_for_current_network_index (void )
Return the primary endpoint of the current network index or 0xFF if no endpoints belong to the current network.
N/A |
2230
of file app/framework/include/af.h
Macro Definition Documentation#
CONFIGURATION_HEADER#
#define CONFIGURATION_HEADERValue:
"app/framework/util/config.h"
29
of file app/framework/include/af.h
ZCL_ATTRIBUTE_MAX_DATA_SIZE#
#define ZCL_ATTRIBUTE_MAX_DATA_SIZEValue:
MIN(ZCL_ATTRIBUTE_LARGEST, 253)
43
of file app/framework/include/af.h
SL_CLI_COMMAND_ARG#
#define SL_CLI_COMMAND_ARGValue:
void
90
of file app/framework/include/af.h
ZCL_FRAME_CONTROL_FRAME_TYPE_MASK#
#define ZCL_FRAME_CONTROL_FRAME_TYPE_MASKValue:
(BIT(0) | BIT(1))
2109
of file app/framework/include/af.h
ZCL_CLUSTER_SPECIFIC_COMMAND#
#define ZCL_CLUSTER_SPECIFIC_COMMANDValue:
BIT(0)
2110
of file app/framework/include/af.h
ZCL_PROFILE_WIDE_COMMAND#
#define ZCL_PROFILE_WIDE_COMMANDValue:
0u
2111
of file app/framework/include/af.h
ZCL_GLOBAL_COMMAND#
#define ZCL_GLOBAL_COMMANDValue:
(ZCL_PROFILE_WIDE_COMMAND)
2112
of file app/framework/include/af.h
ZCL_MANUFACTURER_SPECIFIC_MASK#
#define ZCL_MANUFACTURER_SPECIFIC_MASKValue:
BIT(2)
2114
of file app/framework/include/af.h
ZCL_FRAME_CONTROL_DIRECTION_MASK#
#define ZCL_FRAME_CONTROL_DIRECTION_MASKValue:
BIT(3)
2116
of file app/framework/include/af.h
ZCL_FRAME_CONTROL_SERVER_TO_CLIENT#
#define ZCL_FRAME_CONTROL_SERVER_TO_CLIENTValue:
BIT(3)
2117
of file app/framework/include/af.h
ZCL_FRAME_CONTROL_CLIENT_TO_SERVER#
#define ZCL_FRAME_CONTROL_CLIENT_TO_SERVERValue:
0u
2118
of file app/framework/include/af.h
ZCL_DISABLE_DEFAULT_RESPONSE_MASK#
#define ZCL_DISABLE_DEFAULT_RESPONSE_MASKValue:
BIT(4)
2120
of file app/framework/include/af.h
ZCL_DIRECTION_CLIENT_TO_SERVER#
#define ZCL_DIRECTION_CLIENT_TO_SERVERValue:
0u
2123
of file app/framework/include/af.h
ZCL_DIRECTION_SERVER_TO_CLIENT#
#define ZCL_DIRECTION_SERVER_TO_CLIENTValue:
1u
2124
of file app/framework/include/af.h
SL_ZIGBEE_AF_ZCL_OVERHEAD#
#define SL_ZIGBEE_AF_ZCL_OVERHEADValue:
3
2130
of file app/framework/include/af.h
SL_ZIGBEE_AF_ZCL_MANUFACTURER_SPECIFIC_OVERHEAD#
#define SL_ZIGBEE_AF_ZCL_MANUFACTURER_SPECIFIC_OVERHEADValue:
5
2131
of file app/framework/include/af.h
FIND_AND_JOIN_MODE_ALLOW_2_4_GHZ#
#define FIND_AND_JOIN_MODE_ALLOW_2_4_GHZValue:
BIT(0)
2134
of file app/framework/include/af.h
FIND_AND_JOIN_MODE_ALLOW_SUB_GHZ#
#define FIND_AND_JOIN_MODE_ALLOW_SUB_GHZValue:
BIT(1)
2135
of file app/framework/include/af.h
FIND_AND_JOIN_MODE_ALLOW_BOTH#
#define FIND_AND_JOIN_MODE_ALLOW_BOTHValue:
(FIND_AND_JOIN_MODE_ALLOW_2_4_GHZ | FIND_AND_JOIN_MODE_ALLOW_SUB_GHZ)
2136
of file app/framework/include/af.h
sl_zigbee_af_max_power_level#
#define sl_zigbee_af_max_power_levelValue:
()
The maximum power level that can be used by the chip.
2257
of file app/framework/include/af.h