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
// 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
#ifdef EZSP_HOST
// Includes needed for ember related functions for the EZSP host
#include "stack/include/error.h"
#include "stack/include/ember-types.h"
#include "stack/include/ember-random-api.h"
#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/ember.h"
#endif // EZSP_HOST
// HAL - hardware abstraction layer
#include "hal/hal.h"
#include "plugin/serial/serial.h" // Serial utility APIs
#include "event_control/event.h"
#include "stack/include/error.h"
#include "af-types.h"
#include "app/framework/util/print.h"
#include "app/framework/util/time-util.h"
#include "af-structs.h"
#include "attribute-id.h"
#include "att-storage.h"
#include "attribute-type.h"
#include "call-command-handler.h"
#include "callback.h"
#include "client-command-macro.h"
#include "cluster-id.h"
#include "command-id.h"
#include "debug-printing.h"
#include "enums.h"
#include "print-cluster.h"
#include "app/framework/util/client-api.h"
#include "app/util/serial/command-interpreter2.h"
#include "app/framework/cli/zcl-cli.h"
// @{
EmberAfAttributeMetadata *emberAfLocateAttributeMetadata(uint8_t endpoint,
EmberAfClusterId clusterId,
EmberAfAttributeId attributeId,
uint8_t mask,
uint16_t manufacturerCode);
#ifdef DOXYGEN_SHOULD_SKIP_THIS
bool emberAfContainsAttribute(uint8_t endpoint,
EmberAfClusterId clusterId,
EmberAfAttributeId attributeId,
uint8_t mask,
uint16_t manufacturerCode);
#else
#define emberAfContainsAttribute(endpoint, clusterId, attributeId, mask, manufacturerCode) \
(emberAfLocateAttributeMetadata(endpoint, clusterId, attributeId, mask, manufacturerCode) != NULL)
#endif
bool emberAfContainsClusterWithMfgCode(uint8_t endpoint, EmberAfClusterId clusterId, uint16_t manufacturerCode);
bool emberAfContainsCluster(uint8_t endpoint, EmberAfClusterId clusterId);
bool emberAfContainsServerWithMfgCode(uint8_t endpoint, EmberAfClusterId clusterId, uint16_t manufacturerCode);
bool emberAfContainsServer(uint8_t endpoint, EmberAfClusterId clusterId);
bool emberAfContainsClientWithMfgCode(uint8_t endpoint, EmberAfClusterId clusterId, uint16_t manufacturerCode);
bool emberAfContainsClient(uint8_t endpoint, EmberAfClusterId clusterId);
EmberAfStatus emberAfWriteAttribute(uint8_t endpoint,
EmberAfClusterId cluster,
EmberAfAttributeId attributeID,
uint8_t mask,
uint8_t* dataPtr,
EmberAfAttributeType dataType);
EmberAfStatus emberAfWriteServerAttribute(uint8_t endpoint,
EmberAfClusterId cluster,
EmberAfAttributeId attributeID,
uint8_t* dataPtr,
EmberAfAttributeType dataType);
EmberAfStatus emberAfWriteClientAttribute(uint8_t endpoint,
EmberAfClusterId cluster,
EmberAfAttributeId attributeID,
uint8_t* dataPtr,
EmberAfAttributeType dataType);
EmberAfStatus emberAfWriteManufacturerSpecificServerAttribute(uint8_t endpoint,
EmberAfClusterId cluster,
EmberAfAttributeId attributeID,
uint16_t manufacturerCode,
uint8_t* dataPtr,
EmberAfAttributeType dataType);
EmberAfStatus emberAfWriteManufacturerSpecificClientAttribute(uint8_t endpoint,
EmberAfClusterId cluster,
EmberAfAttributeId attributeID,
uint16_t manufacturerCode,
uint8_t* dataPtr,
EmberAfAttributeType dataType);
EmberAfStatus emberAfVerifyAttributeWrite(uint8_t endpoint,
EmberAfClusterId cluster,
EmberAfAttributeId attributeID,
uint8_t mask,
uint16_t manufacturerCode,
uint8_t* dataPtr,
EmberAfAttributeType dataType);
EmberAfStatus emberAfReadAttribute(uint8_t endpoint,
EmberAfClusterId cluster,
EmberAfAttributeId attributeID,
uint8_t mask,
uint8_t* dataPtr,
uint8_t readLength,
EmberAfAttributeType* dataType);
EmberAfStatus emberAfReadServerAttribute(uint8_t endpoint,
EmberAfClusterId cluster,
EmberAfAttributeId attributeID,
uint8_t* dataPtr,
uint8_t readLength);
EmberAfStatus emberAfReadClientAttribute(uint8_t endpoint,
EmberAfClusterId cluster,
EmberAfAttributeId attributeID,
uint8_t* dataPtr,
uint8_t readLength);
EmberAfStatus emberAfReadManufacturerSpecificServerAttribute(uint8_t endpoint,
EmberAfClusterId cluster,
EmberAfAttributeId attributeID,
uint16_t manufacturerCode,
uint8_t* dataPtr,
uint8_t readLength);
EmberAfStatus emberAfReadManufacturerSpecificClientAttribute(uint8_t endpoint,
EmberAfClusterId cluster,
EmberAfAttributeId attributeID,
uint16_t manufacturerCode,
uint8_t* dataPtr,
uint8_t readLength);
uint8_t emberAfGetDataSize(uint8_t dataType);
uint8_t emberAfGetOpenNetworkDurationSec(void);
#define emberAfClusterIsManufacturerSpecific(cluster) ((cluster)->clusterId >= 0xFC00u)
#define emberAfAttributeIsReadOnly(metadata) (((metadata)->mask & ATTRIBUTE_MASK_WRITABLE) == 0)
#define emberAfAttributeIsClient(metadata) (((metadata)->mask & ATTRIBUTE_MASK_CLIENT) != 0)
#define emberAfAttributeIsTokenized(metadata) (((metadata)->mask & ATTRIBUTE_MASK_TOKENIZE) != 0)
#define emberAfAttributeIsExternal(metadata) (((metadata)->mask & ATTRIBUTE_MASK_EXTERNAL_STORAGE) != 0)
#define emberAfAttributeIsSingleton(metadata) (((metadata)->mask & ATTRIBUTE_MASK_SINGLETON) != 0)
#define emberAfAttributeIsManufacturerSpecific(metadata) (((metadata)->mask & ATTRIBUTE_MASK_MANUFACTURER_SPECIFIC) != 0)
#define emberAfAttributeSize(metadata) ((metadata)->size)
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
// master array of all defined endpoints
extern EmberAfDefinedEndpoint emAfEndpoints[];
// Master array of all zigbee PRO networks.
extern const EmAfZigbeeProNetwork emAfZigbeeProNetworks[];
// The current zigbee PRO network or NULL.
extern const EmAfZigbeeProNetwork *emAfCurrentZigbeeProNetwork;
// true if the current network is a zigbee PRO network.
#define emAfProIsCurrentNetwork() (emAfCurrentZigbeeProNetwork != NULL)
#endif
uint8_t emberAfEndpointFromIndex(uint8_t index);
uint8_t emberAfIndexFromEndpoint(uint8_t endpoint);
uint8_t emberAfIndexFromEndpointIncludingDisabledEndpoints(uint8_t endpoint);
uint8_t emberAfFindClusterClientEndpointIndex(uint8_t endpoint, EmberAfClusterId clusterId);
uint8_t emberAfFindClusterServerEndpointIndex(uint8_t endpoint, EmberAfClusterId clusterId);
#define emberAfProfileIdFromIndex(index) (emAfEndpoints[(index)].profileId)
#define emberAfDeviceIdFromIndex(index) (emAfEndpoints[(index)].deviceId)
#define emberAfDeviceVersionFromIndex(index) (emAfEndpoints[(index)].deviceVersion)
#define emberAfNetworkIndexFromEndpointIndex(index) (emAfEndpoints[(index)].networkIndex)
uint8_t emberAfNetworkIndexFromEndpoint(uint8_t endpoint);
#define emberAfPrimaryProfileId() emberAfProfileIdFromIndex(0)
#define emberAfPrimaryEndpoint() (emAfEndpoints[0].endpoint)
uint8_t emberAfEndpointCount(void);
uint8_t emberAfFixedEndpointCount(void);
enum {
EMBER_AF_DATA_TYPE_ANALOG = 0,
EMBER_AF_DATA_TYPE_DISCRETE = 1,
EMBER_AF_DATA_TYPE_NONE = 2
};
uint8_t emberAfGetAttributeAnalogOrDiscreteType(uint8_t dataType);
bool emberAfIsTypeSigned(EmberAfAttributeType dataType);
uint32_t emberAfGetInt32u(const uint8_t* message, uint16_t currentIndex, uint16_t msgLen);
uint32_t emberAfGetInt24u(const uint8_t* message, uint16_t currentIndex, uint16_t msgLen);
uint16_t emberAfGetInt16u(const uint8_t* message, uint16_t currentIndex, uint16_t msgLen);
uint8_t* emberAfGetString(uint8_t* message, uint16_t currentIndex, uint16_t msgLen);
uint8_t* emberAfGetLongString(uint8_t* message, uint16_t currentIndex, uint16_t msgLen);
/*
* @brief Function that extracts a ZCL Date from the message buffer and returns it
* in the given destination. Returns the number of bytes copied.
*/
uint8_t emberAfGetDate(uint8_t* message, uint16_t currentIndex, uint16_t msgLen, EmberAfDate *destination);
#define emberAfGetInt8u(message, currentIndex, msgLen) message[currentIndex]
#define emberAfCopyInt8u(data, index, x) (data[index] = (x))
void emberAfCopyInt16u(uint8_t *data, uint16_t index, uint16_t x);
void emberAfCopyInt24u(uint8_t *data, uint16_t index, uint32_t x);
void emberAfCopyInt32u(uint8_t *data, uint16_t index, uint32_t x);
/*
* @brief Function that copies 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 emberAfCopyString(uint8_t *dest, uint8_t *src, uint8_t size);
/*
* @brief Function that copies 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 emberAfCopyLongString(uint8_t *dest, uint8_t *src, uint16_t size);
/*
* @brief Function that determines the length of a zigbee Cluster Library string
* (where the first byte is assumed to be the length).
*/
uint8_t emberAfStringLength(const uint8_t *buffer);
/*
* @brief Function that determines the length of a zigbee Cluster Library long string.
* (where the first two bytes are assumed to be the length).
*/
uint16_t emberAfLongStringLength(const uint8_t *buffer);
/*
* @brief Function that determines 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 emberAfAttributeValueSize(EmberAfAttributeType dataType,
const uint8_t *buffer,
const uint16_t bufferSize);
// @{
bool emberAfIsDeviceEnabled(uint8_t endpoint);
bool emberAfIsDeviceIdentifying(uint8_t endpoint);
void emberAfSetDeviceEnabled(uint8_t endpoint, bool enabled);
// @{
bool emberAfEndpointEnableDisable(uint8_t endpoint, bool enable);
bool emberAfEndpointIndexIsEnabled(uint8_t index);
#define EMBER_AF_NEW_IMAGE_VERIFICATION true
#define EMBER_AF_CONTINUE_IMAGE_VERIFY false
extern const EmberAfOtaImageId emberAfInvalidImageId;
bool emberAfIsThisDataTypeAStringType(EmberAfAttributeType dataType);
bool emberAfIsStringAttributeType(EmberAfAttributeType attributeType);
bool emberAfIsLongStringAttributeType(EmberAfAttributeType attributeType);
#define EMBER_AF_ZCL_SEQUENCE_MASK 0x7Fu
#define EMBER_AF_MESSAGE_TAG_MASK 0x7Fu
uint8_t emberAfNextSequence(void);
uint8_t emberAfGetLastSequenceNumber(void);
int8_t emberAfCompareValues(uint8_t* val1, uint8_t* val2, uint8_t len, bool signedNumber);
void emberAfGetEui64(EmberEUI64 returnEui64);
#ifdef EZSP_HOST
// Normally this is provided by the stack code, but on the host
// it is provided by the application code.
void emberReverseMemCopy(uint8_t* dest, const uint8_t* src, uint16_t length);
#endif
EmberNodeId emberAfGetNodeId(void);
#if defined(DOXYGEN_SHOULD_SKIP_THIS) || defined(EZSP_HOST)
EmberStatus emberAfGenerateRandomKey(EmberKeyData *result);
#else
#define emberAfGenerateRandomKey(result) emberGenerateRandomKey(result)
#endif
EmberPanId emberAfGetPanId(void);
uint8_t emberAfGetRadioChannel(void);
/*
* @brief Returns a binding index that matches the current incoming message, if
* known.
*/
uint8_t emberAfGetBindingIndex(void);
/*
* @brief Returns an address index that matches the current incoming message,
* if known.
*/
uint8_t emberAfGetAddressIndex(void);
EmberNetworkStatus emberAfNetworkState(void);
uint8_t emberAfGetRadioChannel(void);
EmberStatus emberAfGetNetworkParameters(EmberNodeType *nodeType,
EmberNetworkParameters *parameters);
EmberStatus emberAfGetNodeType(EmberNodeType *nodeType);
#define EMBER_AF_REJOIN_DUE_TO_END_DEVICE_MOVE 0xA0u
#define EMBER_AF_REJOIN_DUE_TO_TC_KEEPALIVE_FAILURE 0xA1u
#define EMBER_AF_REJOIN_DUE_TO_CLI_COMMAND 0xA2u
#define EMBER_AF_REJOIN_DUE_TO_WWAH_CONNECTIVITY_MANAGER 0xA3u
#define EMBER_AF_REJOIN_FIRST_REASON EMBER_AF_REJOIN_DUE_TO_END_DEVICE_MOVE
#define EMBER_AF_REJOIN_LAST_REASON EMBER_AF_REJOIN_DUE_TO_END_DEVICE_MOVE
EmberStatus emberAfPermitJoin(uint8_t duration,
bool broadcastMgmtPermitJoin);
#ifdef DOXYGEN_SHOULD_SKIP_THIS
EmberStatus emberAfBroadcastPermitJoin(uint8_t duration);
#else
#define emberAfBroadcastPermitJoin(duration) \
emberAfPermitJoin((duration), true)
#endif
#define emberAfAddToCurrentAppTasks(x) \
emberAfAddToCurrentAppTasksCallback(x)
#define emberAfRemoveFromCurrentAppTasks(x) \
emberAfRemoveFromCurrentAppTasksCallback(x)
#define emberAfCurrentAppTasks() emberAfGetCurrentAppTasksCallback()
void emberAfRunEvents(void);
#define EMBER_AF_CLIENT_CLUSTER_TICK true
#define EMBER_AF_SERVER_CLUSTER_TICK false
EmberStatus emberAfScheduleTickExtended(uint8_t endpoint,
EmberAfClusterId clusterId,
bool isClient,
uint32_t delayMs,
EmberAfEventPollControl pollControl,
EmberAfEventSleepControl sleepControl);
EmberStatus emberAfScheduleClusterTick(uint8_t endpoint,
EmberAfClusterId clusterId,
bool isClient,
uint32_t delayMs,
EmberAfEventSleepControl sleepControl);
EmberStatus emberAfScheduleClientTickExtended(uint8_t endpoint,
EmberAfClusterId clusterId,
uint32_t delayMs,
EmberAfEventPollControl pollControl,
EmberAfEventSleepControl sleepControl);
EmberStatus emberAfScheduleClientTick(uint8_t endpoint,
EmberAfClusterId clusterId,
uint32_t delayMs);
EmberStatus emberAfScheduleServerTickExtended(uint8_t endpoint,
EmberAfClusterId clusterId,
uint32_t delayMs,
EmberAfEventPollControl pollControl,
EmberAfEventSleepControl sleepControl);
EmberStatus emberAfScheduleServerTick(uint8_t endpoint,
EmberAfClusterId clusterId,
uint32_t delayMs);
EmberStatus emberAfDeactivateClusterTick(uint8_t endpoint,
EmberAfClusterId clusterId,
bool isClient);
EmberStatus emberAfDeactivateClientTick(uint8_t endpoint,
EmberAfClusterId clusterId);
EmberStatus emberAfDeactivateServerTick(uint8_t endpoint,
EmberAfClusterId clusterId);
EmberStatus emberAfEventControlSetDelayMS(EmberEventControl *control,
uint32_t delayMs);
#ifdef DOXYGEN_SHOULD_SKIP_THIS
EmberStatus emberAfEventControlSetDelay(EmberEventControl *eventControl,
uint32_t delayMs);
#else
#define emberAfEventControlSetDelay(control, delayMs) \
emberAfEventControlSetDelayMS(control, delayMs)
#endif
EmberStatus emberAfEventControlSetDelayQS(EmberEventControl *control,
uint32_t delayQs);
EmberStatus emberAfEventControlSetDelayMinutes(EmberEventControl *control,
uint16_t delayM);
void emberAfNetworkEventControlSetInactive(EmberEventControl *controls);
bool emberAfNetworkEventControlGetActive(EmberEventControl *controls);
void emberAfNetworkEventControlSetActive(EmberEventControl *controls);
EmberStatus emberAfNetworkEventControlSetDelayMS(EmberEventControl *controls,
uint32_t delayMs);
#ifdef DOXYGEN_SHOULD_SKIP_THIS
EmberStatus emberAfNetworkEventControlSetDelay(EmberEventControl *controls,
uint32_t delayMs);
#else
#define emberAfNetworkEventControlSetDelay(controls, delayMs) \
emberAfNetworkEventControlSetDelayMS(controls, delayMs);
#endif
EmberStatus emberAfNetworkEventControlSetDelayQS(EmberEventControl *controls,
uint32_t delayQs);
EmberStatus emberAfNetworkEventControlSetDelayMinutes(EmberEventControl *controls,
uint16_t delayM);
EmberStatus emberAfEndpointEventControlSetInactive(EmberEventControl *controls,
uint8_t endpoint);
bool emberAfEndpointEventControlGetActive(EmberEventControl *controls,
uint8_t endpoint);
EmberStatus emberAfEndpointEventControlSetActive(EmberEventControl *controls,
uint8_t endpoint);
EmberStatus emberAfEndpointEventControlSetDelayMS(EmberEventControl *controls,
uint8_t endpoint,
uint32_t delayMs);
#ifdef DOXYGEN_SHOULD_SKIP_THIS
EmberStatus emberAfEndpointEventControlSetDelay(EmberEventControl *controls,
uint8_t endpoint,
uint32_t delayMs);
#else
#define emberAfEndpointEventControlSetDelay(controls, endpoint, delayMs) \
emberAfEndpointEventControlSetDelayMS(controls, endpoint, delayMs);
#endif
EmberStatus emberAfEndpointEventControlSetDelayQS(EmberEventControl *controls,
uint8_t endpoint,
uint32_t delayQs);
EmberStatus emberAfEndpointEventControlSetDelayMinutes(EmberEventControl *controls,
uint8_t endpoint,
uint16_t delayM);
uint32_t emberAfMsToNextEvent(uint32_t maxMs);
uint32_t emberAfMsToNextEventExtended(uint32_t maxMs, uint8_t* returnIndex);
#define emberAfQSToNextEvent(maxQS) \
(emberAfMsToNextEvent(maxQS * MILLISECOND_TICKS_PER_QUARTERSECOND) \
/ MILLISECOND_TICKS_PER_QUARTERSECOND)
#define emberAfGetCurrentSleepControl() \
emberAfGetCurrentSleepControlCallback()
#define emberAfSetDefaultSleepControl(x) \
emberAfSetDefaultSleepControlCallback(x)
#define emberAfGetDefaultSleepControl() \
emberAfGetDefaultSleepControlCallback()
// @{
EmberStatus emberAfSendResponse(void);
EmberStatus emberAfSendResponseWithCallback(EmberAfMessageSentFunction callback);
EmberStatus emberAfSendMulticast(EmberMulticastId multicastId,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t* message);
EmberStatus emberAfSendMulticastToBindings(EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t* message);
EmberStatus emberAfSendMulticastWithAliasWithCallback(EmberMulticastId multicastId,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t *message,
EmberNodeId alias,
uint8_t sequence,
EmberAfMessageSentFunction callback);
EmberStatus emberAfSendMulticastWithCallback(EmberMulticastId multicastId,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t* message,
EmberAfMessageSentFunction callback);
EmberStatus emberAfSendBroadcast(EmberNodeId destination,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t* message);
EmberStatus emberAfSendBroadcastWithCallback(EmberNodeId destination,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t* message,
EmberAfMessageSentFunction callback);
EmberStatus emberAfSendBroadcastWithAliasWithCallback(EmberNodeId destination,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t *message,
EmberNodeId alias,
uint8_t sequence,
EmberAfMessageSentFunction callback);
EmberStatus emberAfSendUnicast(EmberOutgoingMessageType type,
uint16_t indexOrDestination,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t* message);
EmberStatus emberAfSendUnicastWithCallback(EmberOutgoingMessageType type,
uint16_t indexOrDestination,
EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t* message,
EmberAfMessageSentFunction callback);
EmberStatus emberAfSendUnicastToBindings(EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t* message);
EmberStatus emberAfSendUnicastToBindingsWithCallback(EmberApsFrame *apsFrame,
uint16_t messageLength,
uint8_t* message,
EmberAfMessageSentFunction callback);
EmberStatus emberAfSendInterPan(EmberPanId panId,
const EmberEUI64 destinationLongId,
EmberNodeId destinationShortId,
EmberMulticastId multicastId,
EmberAfClusterId clusterId,
EmberAfProfileId profileId,
uint16_t messageLength,
uint8_t* messageBytes);
EmberStatus emberAfSendEndDeviceBind(uint8_t endpoint);
EmberStatus emberAfSendCommandUnicastToBindings(void);
EmberStatus emberAfSendCommandUnicastToBindingsWithCallback(EmberAfMessageSentFunction callback);
EmberStatus emberAfSendCommandMulticast(EmberMulticastId multicastId);
EmberStatus emberAfSendCommandMulticastWithAlias(EmberMulticastId multicastId, EmberNodeId alias, uint8_t sequence);
EmberStatus emberAfSendCommandMulticastWithCallback(EmberMulticastId multicastId,
EmberAfMessageSentFunction callback);
EmberStatus emberAfSendCommandMulticastToBindings(void);
EmberStatus emberAfSendCommandUnicast(EmberOutgoingMessageType type,
uint16_t indexOrDestination);
EmberStatus emberAfSendCommandUnicastWithCallback(EmberOutgoingMessageType type,
uint16_t indexOrDestination,
EmberAfMessageSentFunction callback);
EmberStatus emberAfSendCommandBroadcast(EmberNodeId destination);
EmberStatus emberAfSendCommandBroadcastWithCallback(EmberNodeId destination,
EmberAfMessageSentFunction callback);
EmberStatus emberAfSendCommandBroadcastWithAliasWithCallback(EmberNodeId destination,
EmberNodeId alias,
uint8_t sequence,
EmberAfMessageSentFunction callback);
EmberStatus emberAfSendCommandBroadcastWithAlias(EmberNodeId destination,
EmberNodeId alias,
uint8_t sequence);
EmberStatus emberAfSendCommandInterPan(EmberPanId panId,
const EmberEUI64 destinationLongId,
EmberNodeId destinationShortId,
EmberMulticastId multicastId,
EmberAfProfileId profileId);
EmberStatus emberAfSendDefaultResponse(const EmberAfClusterCommand *cmd,
EmberAfStatus status);
EmberStatus emberAfSendDefaultResponseWithCallback(const EmberAfClusterCommand *cmd,
EmberAfStatus status,
EmberAfMessageSentFunction callback);
EmberStatus emberAfSendImmediateDefaultResponse(EmberAfStatus status);
EmberStatus emberAfSendImmediateDefaultResponseWithCallback(EmberAfStatus status,
EmberAfMessageSentFunction callback);
uint8_t emberAfMaximumApsPayloadLength(EmberOutgoingMessageType type,
uint16_t indexOrDestination,
EmberApsFrame *apsFrame);
EmberApsFrame *emberAfGetCommandApsFrame(void);
void emberAfSetCommandEndpoints(uint8_t sourceEndpoint, uint8_t destinationEndpoint);
#define EMBER_AF_CLIENT_CLUSTER_DISCOVERY false
#define EMBER_AF_SERVER_CLUSTER_DISCOVERY true
EmberStatus emberAfFindDevicesByProfileAndCluster(EmberNodeId target,
EmberAfProfileId profileId,
EmberAfClusterId clusterId,
bool serverCluster,
EmberAfServiceDiscoveryCallback *callback);
EmberStatus emberAfFindClustersByDeviceAndEndpoint(EmberNodeId target,
uint8_t targetEndpoint,
EmberAfServiceDiscoveryCallback *callback);
EmberStatus emberAfFindIeeeAddress(EmberNodeId shortAddress,
EmberAfServiceDiscoveryCallback *callback);
EmberStatus emberAfFindNodeId(EmberEUI64 longAddress,
EmberAfServiceDiscoveryCallback *callback);
EmberStatus emberAfFindActiveEndpoints(EmberNodeId target,
EmberAfServiceDiscoveryCallback *callback);
uint8_t emberAfAddAddressTableEntry(EmberEUI64 longId, EmberNodeId shortId);
EmberStatus emberAfSetAddressTableEntry(uint8_t index,
EmberEUI64 longId,
EmberNodeId shortId);
EmberStatus emberAfRemoveAddressTableEntry(uint8_t index);
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
#define emberAfCurrentCommand() (emAfCurrentCommand)
extern EmberAfClusterCommand *emAfCurrentCommand;
#endif
#define emberAfCurrentEndpoint() (emberAfCurrentCommand()->apsFrame->destinationEndpoint)
#ifdef DOXYGEN_SHOULD_SKIP_THIS
EmberStatus emberAfInitiateKeyEstablishment(EmberNodeId nodeId, uint8_t endpoint);
EmberStatus emberAfInitiateInterPanKeyEstablishment(EmberPanId panId,
const EmberEUI64 eui64);
bool emberAfPerformingKeyEstablishment(void);
EmberStatus emberAfInitiatePartnerLinkKeyExchange(EmberNodeId target,
uint8_t endpoint,
EmberAfPartnerLinkKeyExchangeCallback *callback);
#else
#define emberAfInitiateKeyEstablishment(nodeId, endpoint) \
emberAfInitiateKeyEstablishmentCallback(nodeId, endpoint)
#define emberAfInitiateInterPanKeyEstablishment(panId, eui64) \
emberAfInitiateInterPanKeyEstablishmentCallback(panId, eui64)
#define emberAfPerformingKeyEstablishment() \
emberAfPerformingKeyEstablishmentCallback()
#define emberAfInitiatePartnerLinkKeyExchange(target, endpoint, callback) \
emberAfInitiatePartnerLinkKeyExchangeCallback(target, endpoint, callback)
#endif
bool emberAfIsCurrentSecurityProfileSmartEnergy(void);
// @{
// 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 EMBER_AF_ZCL_OVERHEAD 3
#define EMBER_AF_ZCL_MANUFACTURER_SPECIFIC_OVERHEAD 5
// Permitted values for emberAfSetFormAndJoinMode
#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)
// ${
EmberStatus emberAfFormNetwork(EmberNetworkParameters *parameters);
EmberStatus emberAfJoinNetwork(EmberNetworkParameters *parameters);
#ifdef DOXYGEN_SHOULD_SKIP_THIS
EmberStatus emberAfFindUnusedPanIdAndForm(void);
EmberStatus emberAfStartSearchForJoinableNetwork(void);
#else
#define emberAfFindUnusedPanIdAndForm() emberAfFindUnusedPanIdAndFormCallback()
#define emberAfStartSearchForJoinableNetwork() emberAfStartSearchForJoinableNetworkCallback()
#endif
EmberStatus emberAfPushNetworkIndex(uint8_t networkIndex);
EmberStatus emberAfPushCallbackNetworkIndex(void);
EmberStatus emberAfPushEndpointNetworkIndex(uint8_t endpoint);
EmberStatus emberAfPopNetworkIndex(void);
uint8_t emberAfPrimaryEndpointForNetworkIndex(uint8_t networkIndex);
uint8_t emberAfPrimaryEndpointForCurrentNetworkIndex(void);
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
EmberStatus emAfInitializeNetworkIndexStack(void);
void emAfAssertNetworkIndexStackIsEmpty(void);
#endif
void emberAfMainInit(void);
int emberAfMain(MAIN_FUNCTION_PARAMETERS);
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
#if defined(EMBER_TEST)
#define EMBER_TEST_ASSERT(x) assert(x)
#else
#define EMBER_TEST_ASSERT(x)
#endif
#endif
// Note: This is a #define for now but could be a real function call in the future.
#define emberAfMaxPowerLevel() (3)
#endif // SILABS_AF_API
Attribute Storage#
macro that returns true if the cluster is in the manufacturer specific range
macro that returns true if attribute is read only.
macro that returns true if client attribute, and false if server.
macro that returns true if attribute is saved to token.
macro that returns true if attribute is saved in external storage.
macro that returns true if attribute is a singleton
macro that returns true if attribute is manufacturer specific
macro that returns size of attribute in bytes.
Macro that takes index of endpoint, and returns profile Id for it.
Macro that takes index of endpoint, and returns device Id for it.
Macro that takes index of endpoint, and returns device version for it.
Macro that takes index of endpoint, and returns network index for it.
Macro that returns primary profile ID.
Macro that returns the primary endpoint.
Macro for consistency, that extracts single byte out of the message.
Macro for consistency that copies a uint8_t from variable into buffer.
locate attribute metadata
Returns true if the attribute exists.
Returns true if endpoint contains a cluster, checking for mfg code.
Returns true if endpoint contains the ZCL cluster with specified id.
Returns true if endpoint has cluster server, checking for mfg code.
Returns true if endpoint contains the ZCL server with specified id.
Returns true if endpoint contains cluster client.
Returns true if endpoint contains the ZCL client with specified id.
write an attribute, performing all the checks.
write a cluster server attribute.
write a cluster client attribute.
write a manufacturer specific server attribute.
write a manufacturer specific client attribute.
Function that 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.
this function returns the size of the ZCL data in bytes.
this function returns the number of seconds the network will remain open.
Macro that takes index of endpoint, and returns Zigbee endpoint.
Returns the network index of a given endpoint.
Returns the total number of endpoints (dynamic and pre-compiled).
Returns the number of pre-compiled endpoints.
Returns the type of the attribute, either ANALOG, DISCRETE or NONE.
Returns true if type is signed, false otherwise.
Function that extracts a 32-bit integer from the message buffer.
Function that extracts a 24-bit integer from the message buffer.
Function that extracts a 16-bit integer from the message buffer.
Function that extracts a ZCL string from the message buffer.
Function that extracts a ZCL long string from the message buffer.
macro that returns true if the cluster is in the manufacturer specific range
function that copies a uint16_t value into a buffer
function that copies a uint24_t value into a buffer
function that copies a uint32_t value into a buffer
macro that returns true if the cluster is in the manufacturer specific range
macro that returns true if the cluster is in the manufacturer specific range
macro that returns true if the cluster is in the manufacturer specific range
macro that returns true if the cluster is in the manufacturer specific range
macro that returns true if the cluster is in the manufacturer specific range
Device Control#
Function that checks if endpoint is enabled.
Function that checks if endpoint is identifying.
Function that enables or disables an endpoint.
Miscellaneous#
This indicates a new image verification is taking place.
This indicates the continuation of an image verification already in progress.
The mask applied by emberAfNextSequence 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.
This indicates a new image verification is taking place.
This indicates a new image verification is taking place.
This indicates a new image verification is taking place.
This indicates a new image verification is taking place.
This indicates a new image verification is taking place.
This indicates a new image verification is taking place.
This variable defines an invalid image id. It is used to determine if a returned EmberAfOtaImageId is valid or not. This is done by passing the data to the function emberAfIsOtaImageIdValid().
Enable/disable endpoints.
Determine if an endpoint at the specified index is enabled or disabled.
Returns true if a given ZCL data type is a string type.
Returns true if the given attribute type is a string.
Returns true if the given attribute type is a long string.
Increments the ZCL sequence number and returns the value.
Retrieves the last sequence number that was used.
Simple integer comparison function. Compares two values of a known length as integers. Signed integer comparison are supported for numbers with length of 4 (bytes) or less. The integers are in native endianness.
populates the passed EUI64 with the local EUI64 MAC address.
Returns the node ID of the local node.
Generates a random key (link, network, or master).
Returns the PAN ID of the local node.
Returns the radioChannel of the current network.
This indicates a new image verification is taking place.
This indicates a new image verification is taking place.
Returns the current network state. This call caches the results on the host to prevent frequent EZSP transactions.
Returns the current network parameters.
Returns the current node type.
Enables local permit join and optionally broadcasts the ZDO Mgmt_Permit_Join_req message. This API can be called from any device type and still return EMBER_SUCCESS. If the API is called from an end device, the permit association bit will just be left off.
Enables local permit join and broadcasts the ZDO Mgmt_Permit_Join_req message. This API can be called from any device type and still return EMBER_SUCCESS. If the API is called from an end device, the permit association bit will just be left off.
Sleep Control#
A function used to add a task to the task register.
A function used to remove a task from the task register.
A macro used to retrieve the bitmask of all application frameowrk tasks currently in progress. This can be useful for debugging if some task is holding the device out of hibernation.
Friendly define for use in the scheduling or canceling client events with emberAfScheduleClusterTick() and emberAfDeactivateClusterTick().
Friendly define for use in the scheduling or canceling server events with emberAfScheduleClusterTick() and emberAfDeactivateClusterTick().
A function used to retrieve the number of quarter seconds until the next event scheduled in the application framework's event mechanism. This function will round down and will return 0 if the next event must fire within a quarter second.
A function for retrieving the most restrictive sleep control value for all scheduled events. This function is used by emberAfOkToNap and emberAfOkToHibernate to makes sure that there are no events scheduled which will keep the device from hibernating or napping.
A function for setting 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 EMBER_AF_STAY_AWAKE and then resetting the value to EMBER_AF_OK_TO_HIBERNATE once the wake period is complete.
A function used to retrieve the default sleep control against which all event sleep control values are evaluated. The default sleep control value is initialized to EMBER_AF_OK_TO_HIBERNATE but can be changed by the application at any time using the emberAfSetDefaultSleepControl() function.
a function used to run the application framework's event mechanism. This function passes the application framework's event tables to the ember stack's event processing code.
This function is used to 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.
This function is used to schedule a cluster-related event inside the This function is a wrapper for emberAfScheduleTickExtended. The cluster on the given endpoint will be set to long poll if sleepControl is set to EMBER_AF_OK_TO_HIBERNATE or will be set to short poll otherwise. It will stay awake if sleepControl is EMBER_AF_STAY_AWAKE and will sleep otherwise.
A function used to schedule a cluster client event. This function is a wrapper for emberAfScheduleTickExtended.
A function used to schedule a cluster client event. This function is a wrapper for emberAfScheduleClientTickExtended. It indicates that the cluster client on the given endpoint can long poll and can sleep.
A function used to schedule a cluster server event. This function is a wrapper for emberAfScheduleTickExtended.
A function used to schedule a cluster server event. This function is a wrapper for emberAfScheduleServerTickExtended. It indicates that the cluster server on the given endpoint can long poll and can sleep.
A function used to 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.
A function used to deactivate a cluster client event. This function is a wrapper for emberAfDeactivateClusterTick.
A function used to deactivate a cluster server event. This function is a wrapper for emberAfDeactivateClusterTick.
Sets the EmberEventControl to run "delayMs" milliseconds in the future. This function first verifies that the delay is within the acceptable range before scheduling the event.
Sets the EmberEventControl to run "delayMs" milliseconds in the future. See emberAfEventControlSetDelayMS.
Sets the EmberEventControl to run "delayQs" quarter seconds in the future. The 'quarter seconds' are actually 256 milliseconds long. This function first verifies that the delay is within the acceptable range before scheduling the event.
Sets the EmberEventControl to run "delayM" minutes in the future. The 'minutes' are actually 65536 (0x10000) milliseconds long. This function first verifies that the delay is within the acceptable range before scheduling the event.
Sets the EmberEventControl for the current network, and only the current network, as inactive. See ::emberEventControlSetInactive.
Returns true if the event for the current network, and only the current network, is active. See ::emberEventControlGetActive.
Sets the EmberEventControl for the current network, and only current network, to run at the next available opportunity. See ::emberEventControlSetActive.
Sets the EmberEventControl for the current network, and only the current network, to run "delayMs" milliseconds in the future. See emberAfEventControlSetDelayMS.
Sets the EmberEventControl for the current network, and only the current network, to run "delayMs" milliseconds in the future. See emberAfEventControlSetDelayMS.
Sets the EmberEventControl for the current network, and only the current network, to run "delayQs" quarter seconds in the future. See emberAfEventControlSetDelayQS.
Sets the EmberEventControl for the current network, and only the current network, to run "delayM" minutes in the future. See emberAfEventControlSetDelayMinutes.
Sets the EmberEventControl for the specified endpoint as inactive. See ::emberEventControlSetInactive.
Returns true if the event for the current number is active. See ::emberEventControlGetActive.
Sets the EmberEventControl for the specified endpoint to run at the next available opportunity. See ::emberEventControlSetActive.
Sets the EmberEventControl for the specified endpoint to run "delayMs" milliseconds in the future. See emberAfEventControlSetDelayMS.
Sets the EmberEventControl for the specified endpoint to run "delayMs" milliseconds in the future. See emberAfEventControlSetDelayMS.
Sets the EmberEventControl for the specified endpoint to run "delayQs" quarter seconds in the future. See emberAfEventControlSetDelayQS.
Sets the EmberEventControl for the specified endpoint to run "delayM" minutes in the future. See emberAfEventControlSetDelayMinutes.
A function used to retrieve the number of milliseconds until the next event scheduled in the application framework's event mechanism.
This is the same as the function emberAfMsToNextEvent() with the following addition. If returnIndex is non-NULL it returns the index of the event that is ready to fire next.
Messaging#
Friendly define for use in discovering client clusters with emberAfFindDevicesByProfileAndCluster().
Friendly define for use in discovering server clusters with emberAfFindDevicesByProfileAndCluster().
returns the current endpoint that is being served.
This function sends 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.
Sends multicast.
Multicasts the message to the group 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. Care should be taken when considering the effects of broadcasts in a network.
Sends Multicast with alias with attached message sent callback.
Sends multicast with attached message sent callback.
Sends broadcast.
Sends broadcast with attached message sent callback.
Sends broadcast with alias with attached message sent callback.
Sends unicast.
Sends unicast with attached message sent callback.
Unicasts 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.
emberAfSendUnicastToBindings with attached message sent callback.
Sends interpan message.
Sends end device binding request.
Sends the command prepared with emberAfFill.... macro.
emberAfSendCommandUnicastToBindings with attached message sent callback.
Sends the command prepared with emberAfFill.... macro.
Sends the command prepared with emberAfFill.... macro.
emberAfSendCommandMulticast with attached message sent callback.
Sends the command prepared with emberAfFill.... macro.
Sends the command prepared with emberAfFill.... macro.
emberAfSendCommandUnicast with attached message sent callback.
Sends the command prepared with emberAfFill.... macro.
emberAfSendCommandBroadcast with attached message sent callback.
emberAfSendCommandBroadcast from alias with attached message sent callback.
Sends the command prepared with emberAfFill.... macro.
Sends the command prepared with emberAfFill.... macro.
Sends a default response to a cluster command.
emberAfSendDefaultResponse with attached message sent callback.
Sends a default response to a cluster command using the current command.
emberAfSendImmediateDefaultResponse with attached message sent callback.
Returns 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.
Use this function to 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 EMBER_RX_ON_WHEN_IDLE_BROADCAST_ADDRESS.
Use this function to 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.
Use this function to initiate a discovery for the IEEE address of the specified node id. This will send a unicast sent to the target node ID.
Use this function to 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.
Use this function to add an entry for a remote device to the address table.
Use this function to add an entry for a remote device to the address table at a specific location.
Use this function to remove a specific entry from the address table.
Use this function to initiate key establishment with a remote node. emberAfKeyEstablishmentCallback will be called as events occur and when key establishment completes.
Use this function to initiate key establishment with a remote node on a different PAN. emberAfInterPanKeyEstablishmentCallback will be called as events occur and when key establishment completes.
Use this function to tell if the device is in the process of performing key establishment.
Use this function to 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.
ZCL macros#
Network utility functions#
Use this function to form a new network using the specified network parameters.
Use this function to associate with the network using the specified network parameters.
Use this function to find an unused PAN id and form a new network.
Use this function to find a joinable network and join it.
Sets the current network to that of the given index 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 emberAfPopNetworkIndex.
Sets 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 emberAfPopNetworkIndex.
Sets 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 emberAfPopNetworkIndex.
Removes 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 emberAfPushNetworkIndex, emberAfPushCallbackNetworkIndex, or emberAfPushEndpointNetworkIndex.
Returns the primary endpoint of the given network index or 0xFF if no endpoints belong to the network.
Returns the primary endpoint of the current network index or 0xFF if no endpoints belong to the current network.
Basic initialization API to be invoked before emberAfMain.
This function effectively serves as the application main.
Macros#
The maximum power level that can be used by the chip.
Attribute Storage Documentation#
@0#
@0
Data types are either analog or discrete. This makes a difference for some of the ZCL global commands
Enumerator | |
---|---|
EMBER_AF_IMAGE_BLOCK_REQUEST_OPTIONS_NONE | |
EMBER_AF_IMAGE_BLOCK_REQUEST_MIN_BLOCK_REQUEST_SUPPORTED_BY_CLIENT | |
EMBER_AF_IMAGE_BLOCK_REQUEST_MIN_BLOCK_REQUEST_SUPPORTED_BY_SERVER | |
EMBER_AF_IMAGE_BLOCK_REQUEST_SIMULATED_FROM_PAGE_REQUEST | |
EMBER_AF_DATA_TYPE_ANALOG | |
EMBER_AF_DATA_TYPE_DISCRETE | |
EMBER_AF_DATA_TYPE_NONE | |
PRIORITIZE_BEACONS_BASED_ON_PARENT_CLASSIFICATION | |
PRIORITIZE_BEACONS_BASED_ON_TC_CONNECTVITY | |
TC_CONNECTIVITY | |
LONG_UPTIME | |
BAD_PARENT_CONNECTIVITY |
emberAfLocateAttributeMetadata#
EmberAfAttributeMetadata* emberAfLocateAttributeMetadata (uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId, uint8_t mask, uint16_t manufacturerCode)
locate attribute metadata
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | Zigbee endpoint number. |
EmberAfClusterId | N/A | clusterId | Cluster ID of the sought cluster. |
EmberAfAttributeId | N/A | attributeId | Attribute ID of the sought attribute. |
uint8_t | N/A | mask | CLUSTER_MASK_SERVER or CLUSTER_MASK_CLIENT |
uint16_t | N/A | manufacturerCode |
Function returns pointer to the attribute metadata structure, or NULL if attribute was not found.
Returns
Returns pointer to the attribute metadata location.
emberAfContainsAttribute#
bool emberAfContainsAttribute (uint8_t endpoint, EmberAfClusterId clusterId, EmberAfAttributeId attributeId, uint8_t mask, uint16_t manufacturerCode)
Returns true if the attribute exists.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | clusterId | |
EmberAfAttributeId | N/A | attributeId | |
uint8_t | N/A | mask | |
uint16_t | N/A | manufacturerCode |
emberAfContainsClusterWithMfgCode#
bool emberAfContainsClusterWithMfgCode (uint8_t endpoint, EmberAfClusterId clusterId, uint16_t manufacturerCode)
Returns true if endpoint contains a cluster, checking for mfg code.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | clusterId | |
uint16_t | N/A | manufacturerCode |
This function returns true regardless of whether the endpoint contains server, client or both. For standard libraries (when ClusterId < FC00), the manufacturerCode is ignored.
emberAfContainsCluster#
bool emberAfContainsCluster (uint8_t endpoint, EmberAfClusterId clusterId)
Returns true if endpoint contains the ZCL cluster with specified id.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | clusterId |
This function returns true regardless of whether the endpoint contains server, client or both in the Zigbee cluster Library. This wraps emberAfContainsClusterWithMfgCode with manufacturerCode = EMBER_AF_NULL_MANUFACTURER_CODE If this function is used with a manufacturer specific clusterId then this will return the first cluster that it finds in the Cluster table. and will not return any other clusters that share that id.
emberAfContainsServerWithMfgCode#
bool emberAfContainsServerWithMfgCode (uint8_t endpoint, EmberAfClusterId clusterId, uint16_t manufacturerCode)
Returns true if endpoint has cluster server, checking for mfg code.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | clusterId | |
uint16_t | N/A | manufacturerCode |
This function returns true if the endpoint contains server of a given cluster. For standard librarys (when ClusterId < FC00), the manufacturerCode is ignored.
emberAfContainsServer#
bool emberAfContainsServer (uint8_t endpoint, EmberAfClusterId clusterId)
Returns true if endpoint contains the ZCL server with specified id.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | clusterId |
This function returns true if the endpoint contains server of a given cluster. This wraps emberAfContainsServer with manufacturerCode = EMBER_AF_NULL_MANUFACTURER_CODE If this function is used with a manufacturer specific clusterId then this will return the first cluster that it finds in the Cluster table. and will not return any other clusters that share that id.
emberAfContainsClientWithMfgCode#
bool emberAfContainsClientWithMfgCode (uint8_t endpoint, EmberAfClusterId clusterId, uint16_t manufacturerCode)
Returns true if endpoint contains cluster client.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | clusterId | |
uint16_t | N/A | manufacturerCode |
This function returns true if the endpoint contains client of a given cluster. For standard library clusters (when ClusterId < FC00), the manufacturerCode is ignored.
emberAfContainsClient#
bool emberAfContainsClient (uint8_t endpoint, EmberAfClusterId clusterId)
Returns true if endpoint contains the ZCL client with specified id.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | clusterId |
This function returns true if the endpoint contains client of a given cluster. This wraps emberAfContainsClient with manufacturerCode = EMBER_AF_NULL_MANUFACTURER_CODE If this function is used with a manufacturer specific clusterId then this will return the first cluster that it finds in the Cluster table. and will not return any other clusters that share that id.
emberAfWriteAttribute#
EmberAfStatus emberAfWriteAttribute (uint8_t endpoint, EmberAfClusterId cluster, EmberAfAttributeId attributeID, uint8_t mask, uint8_t * dataPtr, EmberAfAttributeType dataType)
write an attribute, performing all the checks.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | cluster | |
EmberAfAttributeId | N/A | attributeID | |
uint8_t | N/A | mask | |
uint8_t * | N/A | dataPtr | |
EmberAfAttributeType | N/A | dataType |
This function will attempt to write the attribute value from the provided pointer. This function will only check that the attribute exists. If it does it will write the value into the attribute table for the given attribute.
This function will not check to see 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 being called locally it assumes that the device knows what it is doing and has permission to perform the given operation.
See Also
emberAfWriteClientAttribute, emberAfWriteServerAttribute, emberAfWriteManufacturerSpecificClientAttribute, emberAfWriteManufacturerSpecificServerAttribute
emberAfWriteServerAttribute#
EmberAfStatus emberAfWriteServerAttribute (uint8_t endpoint, EmberAfClusterId cluster, EmberAfAttributeId attributeID, uint8_t * dataPtr, EmberAfAttributeType dataType)
write a cluster server attribute.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | cluster | |
EmberAfAttributeId | N/A | attributeID | |
uint8_t * | N/A | dataPtr | |
EmberAfAttributeType | N/A | dataType |
This function is the same as emberAfWriteAttribute except that it saves having to pass the cluster mask. This is useful for code savings since write attribute is used frequently throughout the framework
See Also
emberAfWriteClientAttribute, emberAfWriteManufacturerSpecificClientAttribute, emberAfWriteManufacturerSpecificServerAttribute
emberAfWriteClientAttribute#
EmberAfStatus emberAfWriteClientAttribute (uint8_t endpoint, EmberAfClusterId cluster, EmberAfAttributeId attributeID, uint8_t * dataPtr, EmberAfAttributeType dataType)
write a cluster client attribute.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | cluster | |
EmberAfAttributeId | N/A | attributeID | |
uint8_t * | N/A | dataPtr | |
EmberAfAttributeType | N/A | dataType |
This function is the same as emberAfWriteAttribute except that it saves having to pass the cluster mask. This is useful for code savings since write attribute is used frequently throughout the framework
See Also
emberAfWriteServerAttribute, emberAfWriteManufacturerSpecificClientAttribute, emberAfWriteManufacturerSpecificServerAttribute
emberAfWriteManufacturerSpecificServerAttribute#
EmberAfStatus emberAfWriteManufacturerSpecificServerAttribute (uint8_t endpoint, EmberAfClusterId cluster, EmberAfAttributeId attributeID, uint16_t manufacturerCode, uint8_t * dataPtr, EmberAfAttributeType dataType)
write a manufacturer specific server attribute.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | cluster | |
EmberAfAttributeId | N/A | attributeID | |
uint16_t | N/A | manufacturerCode | |
uint8_t * | N/A | dataPtr | |
EmberAfAttributeType | N/A | dataType |
This function is the same as emberAfWriteAttribute except that it saves having to pass the cluster mask and allows passing of a manufacturer code. This is useful for code savings since write attribute is used frequently throughout the framework
See Also
emberAfWriteClientAttribute, emberAfWriteServerAttribute, emberAfWriteManufacturerSpecificClientAttribute
emberAfWriteManufacturerSpecificClientAttribute#
EmberAfStatus emberAfWriteManufacturerSpecificClientAttribute (uint8_t endpoint, EmberAfClusterId cluster, EmberAfAttributeId attributeID, uint16_t manufacturerCode, uint8_t * dataPtr, EmberAfAttributeType dataType)
write a manufacturer specific client attribute.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | cluster | |
EmberAfAttributeId | N/A | attributeID | |
uint16_t | N/A | manufacturerCode | |
uint8_t * | N/A | dataPtr | |
EmberAfAttributeType | N/A | dataType |
This function is the same as emberAfWriteAttribute except that it saves having to pass the cluster mask. and allows passing of a manufacturer code. This is useful for code savings since write attribute is used frequently throughout the framework
See Also
emberAfWriteClientAttribute, emberAfWriteServerAttribute, emberAfWriteManufacturerSpecificServerAttribute
emberAfVerifyAttributeWrite#
EmberAfStatus emberAfVerifyAttributeWrite (uint8_t endpoint, EmberAfClusterId cluster, EmberAfAttributeId attributeID, uint8_t mask, uint16_t manufacturerCode, uint8_t * dataPtr, EmberAfAttributeType dataType)
Function that test the success of attribute write.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | Zigbee endpoint number |
EmberAfClusterId | N/A | cluster | Cluster ID of the sought cluster. |
EmberAfAttributeId | N/A | attributeID | Attribute ID of the sought attribute. |
uint8_t | N/A | mask | CLUSTER_MASK_SERVER or CLUSTER_MASK_CLIENT |
uint16_t | N/A | manufacturerCode | Location where attribute will be written from. |
uint8_t * | N/A | dataPtr | ZCL attribute type. |
EmberAfAttributeType | N/A | dataType |
This function returns success if attribute write would be successful. It does not actually write anything, just validates for read-only and data-type.
emberAfReadAttribute#
EmberAfStatus emberAfReadAttribute (uint8_t endpoint, EmberAfClusterId cluster, EmberAfAttributeId attributeID, uint8_t mask, uint8_t * dataPtr, uint8_t readLength, EmberAfAttributeType * dataType)
Read the attribute value, performing all the checks.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | cluster | |
EmberAfAttributeId | N/A | attributeID | |
uint8_t | N/A | mask | |
uint8_t * | N/A | dataPtr | |
uint8_t | N/A | readLength | |
EmberAfAttributeType * | N/A | dataType |
This function will attempt to read the attribute and store it into the pointer. It will also read the data type. Both dataPtr and dataType may be NULL, signifying that either value or type is not desired.
See Also
emberAfReadClientAttribute, emberAfReadServerAttribute, emberAfReadManufacturerSpecificClientAttribute, emberAfReadManufacturerSpecificServerAttribute
emberAfReadServerAttribute#
EmberAfStatus emberAfReadServerAttribute (uint8_t endpoint, EmberAfClusterId cluster, EmberAfAttributeId attributeID, uint8_t * dataPtr, uint8_t readLength)
Read the server attribute value, performing all the checks.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | cluster | |
EmberAfAttributeId | N/A | attributeID | |
uint8_t * | N/A | dataPtr | |
uint8_t | N/A | readLength |
This function will attempt to read the attribute and store it into the pointer. It will also read the data type. Both dataPtr and dataType may be NULL, signifying that either value or type is not desired.
See Also
emberAfReadClientAttribute, emberAfReadManufacturerSpecificClientAttribute, emberAfReadManufacturerSpecificServerAttribute
emberAfReadClientAttribute#
EmberAfStatus emberAfReadClientAttribute (uint8_t endpoint, EmberAfClusterId cluster, EmberAfAttributeId attributeID, uint8_t * dataPtr, uint8_t readLength)
Read the client attribute value, performing all the checks.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | cluster | |
EmberAfAttributeId | N/A | attributeID | |
uint8_t * | N/A | dataPtr | |
uint8_t | N/A | readLength |
This function will attempt to read the attribute and store it into the pointer. It will also read the data type. Both dataPtr and dataType may be NULL, signifying that either value or type is not desired.
See Also
emberAfReadServerAttribute, emberAfReadManufacturerSpecificClientAttribute, emberAfReadManufacturerSpecificServerAttribute
emberAfReadManufacturerSpecificServerAttribute#
EmberAfStatus emberAfReadManufacturerSpecificServerAttribute (uint8_t endpoint, EmberAfClusterId cluster, EmberAfAttributeId attributeID, uint16_t manufacturerCode, uint8_t * dataPtr, uint8_t readLength)
Read the manufacturer-specific server attribute value, performing all checks.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | cluster | |
EmberAfAttributeId | N/A | attributeID | |
uint16_t | N/A | manufacturerCode | |
uint8_t * | N/A | dataPtr | |
uint8_t | N/A | readLength |
This function will attempt to read the attribute and store it into the pointer. It will also read the data type. Both dataPtr and dataType may be NULL, signifying that either value or type is not desired.
See Also
emberAfReadClientAttribute, emberAfReadServerAttribute, emberAfReadManufacturerSpecificClientAttribute
emberAfReadManufacturerSpecificClientAttribute#
EmberAfStatus emberAfReadManufacturerSpecificClientAttribute (uint8_t endpoint, EmberAfClusterId cluster, EmberAfAttributeId attributeID, uint16_t manufacturerCode, uint8_t * dataPtr, uint8_t readLength)
Read the manufacturer-specific client attribute value, performing all checks.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | cluster | |
EmberAfAttributeId | N/A | attributeID | |
uint16_t | N/A | manufacturerCode | |
uint8_t * | N/A | dataPtr | |
uint8_t | N/A | readLength |
This function will attempt to read the attribute and store it into the pointer. It will also read the data type. Both dataPtr and dataType may be NULL, signifying that either value or type is not desired.
See Also
emberAfReadClientAttribute, emberAfReadServerAttribute, emberAfReadManufacturerSpecificServerAttribute
emberAfGetDataSize#
uint8_t emberAfGetDataSize (uint8_t dataType)
this function returns the size of the ZCL data in bytes.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | dataType | Zcl data type |
Returns
size in bytes or 0 if invalid data type
emberAfGetOpenNetworkDurationSec#
uint8_t emberAfGetOpenNetworkDurationSec (void )
this function returns the number of seconds the network will remain open.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
A return value of 0 indicates that the network is closed.
emberAfEndpointFromIndex#
uint8_t emberAfEndpointFromIndex (uint8_t index)
Macro that takes index of endpoint, and returns Zigbee endpoint.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | index |
emberAfIndexFromEndpoint#
uint8_t emberAfIndexFromEndpoint (uint8_t endpoint)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint |
Returns the index of a given endpoint
emberAfIndexFromEndpointIncludingDisabledEndpoints#
uint8_t emberAfIndexFromEndpointIncludingDisabledEndpoints (uint8_t endpoint)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint |
Returns the index of a given endpoint; Does not ignore disabled endpoints
emberAfFindClusterClientEndpointIndex#
uint8_t emberAfFindClusterClientEndpointIndex (uint8_t endpoint, EmberAfClusterId clusterId)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | clusterId |
Returns the endpoint index within a given cluster (Client-side), looking only for standard clusters.
emberAfFindClusterServerEndpointIndex#
uint8_t emberAfFindClusterServerEndpointIndex (uint8_t endpoint, EmberAfClusterId clusterId)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
EmberAfClusterId | N/A | clusterId |
Returns the endpoint index within a given cluster (Server-side), looking only for standard clusters.
emberAfNetworkIndexFromEndpoint#
uint8_t emberAfNetworkIndexFromEndpoint (uint8_t endpoint)
Returns the network index of a given endpoint.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint |
emberAfEndpointCount#
uint8_t emberAfEndpointCount (void )
Returns the total number of endpoints (dynamic and pre-compiled).
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfFixedEndpointCount#
uint8_t emberAfFixedEndpointCount (void )
Returns the number of pre-compiled endpoints.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfGetAttributeAnalogOrDiscreteType#
uint8_t emberAfGetAttributeAnalogOrDiscreteType (uint8_t dataType)
Returns the type of the attribute, either ANALOG, DISCRETE or NONE.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | dataType |
emberAfIsTypeSigned#
bool emberAfIsTypeSigned (EmberAfAttributeType dataType)
Returns true if type is signed, false otherwise.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberAfAttributeType | N/A | dataType |
emberAfGetInt32u#
uint32_t emberAfGetInt32u (const uint8_t * message, uint16_t currentIndex, uint16_t msgLen)
Function that extracts a 32-bit integer from the message buffer.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint8_t * | N/A | message | |
uint16_t | N/A | currentIndex | |
uint16_t | N/A | msgLen |
emberAfGetInt24u#
uint32_t emberAfGetInt24u (const uint8_t * message, uint16_t currentIndex, uint16_t msgLen)
Function that extracts a 24-bit integer from the message buffer.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint8_t * | N/A | message | |
uint16_t | N/A | currentIndex | |
uint16_t | N/A | msgLen |
emberAfGetInt16u#
uint16_t emberAfGetInt16u (const uint8_t * message, uint16_t currentIndex, uint16_t msgLen)
Function that extracts a 16-bit integer from the message buffer.
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint8_t * | N/A | message | |
uint16_t | N/A | currentIndex | |
uint16_t | N/A | msgLen |
emberAfGetString#
uint8_t* emberAfGetString (uint8_t * message, uint16_t currentIndex, uint16_t msgLen)
Function that extracts a ZCL string from the message buffer.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | N/A | message | |
uint16_t | N/A | currentIndex | |
uint16_t | N/A | msgLen |
emberAfGetLongString#
uint8_t* emberAfGetLongString (uint8_t * message, uint16_t currentIndex, uint16_t msgLen)
Function that extracts a ZCL long string from the message buffer.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | N/A | message | |
uint16_t | N/A | currentIndex | |
uint16_t | N/A | msgLen |
emberAfGetDate#
uint8_t emberAfGetDate (uint8_t * message, uint16_t currentIndex, uint16_t msgLen, EmberAfDate * destination)
macro that returns true if the cluster is in the manufacturer specific range
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | N/A | message | EmberAfCluster* to consider |
uint16_t | N/A | currentIndex | |
uint16_t | N/A | msgLen | |
EmberAfDate * | N/A | destination |
emberAfCopyInt16u#
void emberAfCopyInt16u (uint8_t * data, uint16_t index, uint16_t x)
function that copies a uint16_t value into a buffer
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | N/A | data | |
uint16_t | N/A | index | |
uint16_t | N/A | x |
emberAfCopyInt24u#
void emberAfCopyInt24u (uint8_t * data, uint16_t index, uint32_t x)
function that copies a uint24_t value into a buffer
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | N/A | data | |
uint16_t | N/A | index | |
uint32_t | N/A | x |
emberAfCopyInt32u#
void emberAfCopyInt32u (uint8_t * data, uint16_t index, uint32_t x)
function that copies a uint32_t value into a buffer
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | N/A | data | |
uint16_t | N/A | index | |
uint32_t | N/A | x |
emberAfCopyString#
void emberAfCopyString (uint8_t * dest, uint8_t * src, uint8_t size)
macro that returns true if the cluster is in the manufacturer specific range
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | N/A | dest | EmberAfCluster* to consider |
uint8_t * | N/A | src | |
uint8_t | N/A | size |
emberAfCopyLongString#
void emberAfCopyLongString (uint8_t * dest, uint8_t * src, uint16_t size)
macro that returns true if the cluster is in the manufacturer specific range
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | N/A | dest | EmberAfCluster* to consider |
uint8_t * | N/A | src | |
uint16_t | N/A | size |
emberAfStringLength#
uint8_t emberAfStringLength (const uint8_t * buffer)
macro that returns true if the cluster is in the manufacturer specific range
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint8_t * | N/A | buffer | EmberAfCluster* to consider |
emberAfLongStringLength#
uint16_t emberAfLongStringLength (const uint8_t * buffer)
macro that returns true if the cluster is in the manufacturer specific range
Type | Direction | Argument Name | Description |
---|---|---|---|
const uint8_t * | N/A | buffer | EmberAfCluster* to consider |
emberAfAttributeValueSize#
uint16_t emberAfAttributeValueSize (EmberAfAttributeType dataType, const uint8_t * buffer, const uint16_t bufferSize)
macro that returns true if the cluster is in the manufacturer specific range
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberAfAttributeType | N/A | dataType | EmberAfCluster* to consider |
const uint8_t * | N/A | buffer | |
const uint16_t | N/A | bufferSize |
Device Control Documentation#
emberAfIsDeviceEnabled#
bool emberAfIsDeviceEnabled (uint8_t endpoint)
Function that checks if endpoint is enabled.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | Zigbee endpoint number |
This function returns true if device at a given endpoint is enabled. At startup all endpoints are enabled.
emberAfIsDeviceIdentifying#
bool emberAfIsDeviceIdentifying (uint8_t endpoint)
Function that checks if endpoint is identifying.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | Zigbee endpoint number |
This function returns true if device at a given endpoint is identifying.
emberAfSetDeviceEnabled#
void emberAfSetDeviceEnabled (uint8_t endpoint, bool enabled)
Function that enables or disables an endpoint.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | Zigbee endpoint number |
bool | N/A | enabled |
By calling this function, you turn off all processing of incoming traffic for a given endpoint.
Miscellaneous Documentation#
emberAfInvalidImageId#
const EmberAfOtaImageId emberAfInvalidImageId
This variable defines an invalid image id. It is used to determine if a returned EmberAfOtaImageId is valid or not. This is done by passing the data to the function emberAfIsOtaImageIdValid().
emberAfEndpointEnableDisable#
bool emberAfEndpointEnableDisable (uint8_t endpoint, bool enable)
Enable/disable endpoints.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | |
bool | N/A | enable |
emberAfEndpointIndexIsEnabled#
bool emberAfEndpointIndexIsEnabled (uint8_t index)
Determine if an endpoint at the specified index is enabled or disabled.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | index |
emberAfIsThisDataTypeAStringType#
bool emberAfIsThisDataTypeAStringType (EmberAfAttributeType dataType)
Returns true if a given ZCL data type is a string type.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberAfAttributeType | N/A | dataType |
You should use this function if you need 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.
emberAfIsStringAttributeType#
bool emberAfIsStringAttributeType (EmberAfAttributeType attributeType)
Returns true if the given attribute type is a string.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberAfAttributeType | N/A | attributeType |
emberAfIsLongStringAttributeType#
bool emberAfIsLongStringAttributeType (EmberAfAttributeType attributeType)
Returns true if the given attribute type is a long string.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberAfAttributeType | N/A | attributeType |
emberAfNextSequence#
uint8_t emberAfNextSequence (void )
Increments the ZCL sequence number and returns the value.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | 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.
emberAfGetLastSequenceNumber#
uint8_t emberAfGetLastSequenceNumber (void )
Retrieves the last sequence number that was used.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfCompareValues#
int8_t emberAfCompareValues (uint8_t * val1, uint8_t * val2, uint8_t len, bool signedNumber)
Simple integer comparison function. Compares two values of a known length as integers. Signed integer comparison are supported for numbers with length of 4 (bytes) or less. The integers are in native endianness.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | N/A | val1 | |
uint8_t * | N/A | val2 | |
uint8_t | N/A | len | |
bool | 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.
emberAfGetEui64#
void emberAfGetEui64 (EmberEUI64 returnEui64)
populates the passed EUI64 with the local EUI64 MAC address.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEUI64 | N/A | returnEui64 |
emberAfGetNodeId#
EmberNodeId emberAfGetNodeId (void )
Returns the node ID of the local node.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfGenerateRandomKey#
EmberStatus emberAfGenerateRandomKey (EmberKeyData * result)
Generates a random key (link, network, or master).
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberKeyData * | N/A | result |
emberAfGetPanId#
EmberPanId emberAfGetPanId (void )
Returns the PAN ID of the local node.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfGetRadioChannel#
uint8_t emberAfGetRadioChannel (void )
Returns the radioChannel of the current network.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Get this node's radio channel for the current network.
emberAfGetBindingIndex#
uint8_t emberAfGetBindingIndex (void )
This indicates a new image verification is taking place.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfGetAddressIndex#
uint8_t emberAfGetAddressIndex (void )
This indicates a new image verification is taking place.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfNetworkState#
EmberNetworkStatus emberAfNetworkState (void )
Returns the current network state. This call caches the results on the host to prevent frequent EZSP transactions.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfGetNetworkParameters#
EmberStatus emberAfGetNetworkParameters (EmberNodeType * nodeType, EmberNetworkParameters * parameters)
Returns the current network parameters.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeType * | N/A | nodeType | |
EmberNetworkParameters * | N/A | parameters |
emberAfGetNodeType#
EmberStatus emberAfGetNodeType (EmberNodeType * nodeType)
Returns the current node type.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeType * | N/A | nodeType |
emberAfPermitJoin#
EmberStatus emberAfPermitJoin (uint8_t duration, bool broadcastMgmtPermitJoin)
Enables local permit join and optionally broadcasts the ZDO Mgmt_Permit_Join_req message. This API can be called from any device type and still return EMBER_SUCCESS. If the API is called from an end device, the permit association bit will just be left off.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | duration | the duration that the permit join bit will remain on and other devices will be able to join the current network. |
bool | 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.
emberAfBroadcastPermitJoin#
EmberStatus emberAfBroadcastPermitJoin (uint8_t duration)
Enables local permit join and broadcasts the ZDO Mgmt_Permit_Join_req message. This API can be called from any device type and still return EMBER_SUCCESS. If the API is called from an end device, the permit association bit will just be left off.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | 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.
Sleep Control Documentation#
emberAfRunEvents#
void emberAfRunEvents (void )
a function used to run the application framework's event mechanism. This function passes the application framework's event tables to the ember stack's event processing code.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfScheduleTickExtended#
EmberStatus emberAfScheduleTickExtended (uint8_t endpoint, EmberAfClusterId clusterId, bool isClient, uint32_t delayMs, EmberAfEventPollControl pollControl, EmberAfEventSleepControl sleepControl)
This function is used to 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.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | the endpoint of the event to be scheduled. |
EmberAfClusterId | N/A | clusterId | the cluster id of the event to be scheduled. |
bool | N/A | isClient | EMBER_AF_CLIENT_CLUSTER_TICK if the event to be scheduled is associated with a client cluster or EMBER_AF_SERVER_CLUSTER_TICK otherwise. |
uint32_t | N/A | delayMs | the number of milliseconds until the event should be called. |
EmberAfEventPollControl | N/A | pollControl | EMBER_AF_SHORT_POLL if the cluster needs to short poll or EMBER_AF_LONG_POLL otherwise. |
EmberAfEventSleepControl | N/A | sleepControl | EMBER_AF_STAY_AWAKE if the cluster needs to stay awake or EMBER_AF_OK_TO_SLEEP otherwise. |
Returns
EMBER_SUCCESS if the event was scheduled or an error otherwise.
emberAfScheduleClusterTick#
EmberStatus emberAfScheduleClusterTick (uint8_t endpoint, EmberAfClusterId clusterId, bool isClient, uint32_t delayMs, EmberAfEventSleepControl sleepControl)
This function is used to schedule a cluster-related event inside the This function is a wrapper for emberAfScheduleTickExtended. The cluster on the given endpoint will be set to long poll if sleepControl is set to EMBER_AF_OK_TO_HIBERNATE or will be set to short poll otherwise. It will stay awake if sleepControl is EMBER_AF_STAY_AWAKE and will sleep otherwise.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | the endpoint of the event to be scheduled. |
EmberAfClusterId | N/A | clusterId | the cluster id of the event to be scheduled. |
bool | N/A | isClient | EMBER_AF_CLIENT_CLUSTER_TICK if the event to be scheduled is associated with a client cluster or EMBER_AF_SERVER_CLUSTER_TICK otherwise. |
uint32_t | N/A | delayMs | the number of milliseconds until the event should be called. |
EmberAfEventSleepControl | 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
EMBER_SUCCESS if the event was scheduled or an error otherwise.
emberAfScheduleClientTickExtended#
EmberStatus emberAfScheduleClientTickExtended (uint8_t endpoint, EmberAfClusterId clusterId, uint32_t delayMs, EmberAfEventPollControl pollControl, EmberAfEventSleepControl sleepControl)
A function used to schedule a cluster client event. This function is a wrapper for emberAfScheduleTickExtended.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | the endpoint of the event to be scheduled |
EmberAfClusterId | N/A | clusterId | the cluster id of the event to be scheduled |
uint32_t | N/A | delayMs | the number of milliseconds until the event should be called. |
EmberAfEventPollControl | N/A | pollControl | EMBER_AF_SHORT_POLL if the cluster needs to short poll or EMBER_AF_LONG_POLL otherwise. |
EmberAfEventSleepControl | N/A | sleepControl | EMBER_AF_STAY_AWAKE if the cluster needs to stay awake or EMBER_AF_OK_TO_SLEEP otherwise. |
Returns
EMBER_SUCCESS if the event was scheduled or an error otherwise.
emberAfScheduleClientTick#
EmberStatus emberAfScheduleClientTick (uint8_t endpoint, EmberAfClusterId clusterId, uint32_t delayMs)
A function used to schedule a cluster client event. This function is a wrapper for emberAfScheduleClientTickExtended. It indicates that the cluster client on the given endpoint can long poll and can sleep.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | the endpoint of the event to be scheduled. |
EmberAfClusterId | N/A | clusterId | the cluster id of the event to be scheduled. |
uint32_t | N/A | delayMs | the number of milliseconds until the event should be called. |
Returns
EMBER_SUCCESS if the event was scheduled or an error otherwise.
emberAfScheduleServerTickExtended#
EmberStatus emberAfScheduleServerTickExtended (uint8_t endpoint, EmberAfClusterId clusterId, uint32_t delayMs, EmberAfEventPollControl pollControl, EmberAfEventSleepControl sleepControl)
A function used to schedule a cluster server event. This function is a wrapper for emberAfScheduleTickExtended.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | the endpoint of the event to be scheduled. |
EmberAfClusterId | N/A | clusterId | the cluster id of the event to be scheduled. |
uint32_t | N/A | delayMs | the number of milliseconds until the event should be called. |
EmberAfEventPollControl | N/A | pollControl | EMBER_AF_SHORT_POLL if the cluster needs to short poll or EMBER_AF_LONG_POLL otherwise. |
EmberAfEventSleepControl | N/A | sleepControl | EMBER_AF_STAY_AWAKE if the cluster needs to stay awake or EMBER_AF_OK_TO_SLEEP otherwise. |
Returns
EMBER_SUCCESS if the event was scheduled or an error otherwise.
emberAfScheduleServerTick#
EmberStatus emberAfScheduleServerTick (uint8_t endpoint, EmberAfClusterId clusterId, uint32_t delayMs)
A function used to schedule a cluster server event. This function is a wrapper for emberAfScheduleServerTickExtended. It indicates that the cluster server on the given endpoint can long poll and can sleep.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | the endpoint of the event to be scheduled |
EmberAfClusterId | N/A | clusterId | the cluster id of the event to be scheduled. |
uint32_t | N/A | delayMs | the number of milliseconds until the event should be called. |
Returns
EMBER_SUCCESS if the event was scheduled or an error otherwise.
emberAfDeactivateClusterTick#
EmberStatus emberAfDeactivateClusterTick (uint8_t endpoint, EmberAfClusterId clusterId, bool isClient)
A function used to 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.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | the endpoint of the event to be deactivated. |
EmberAfClusterId | N/A | clusterId | the cluster id of the event to be deactivated. |
bool | N/A | isClient | EMBER_AF_CLIENT_CLUSTER_TICK if the event to be deactivated is a client cluster EMBER_AF_SERVER_CLUSTER_TICK otherwise. |
Returns
EMBER_SUCCESS if the event was deactivated or an error otherwise.
emberAfDeactivateClientTick#
EmberStatus emberAfDeactivateClientTick (uint8_t endpoint, EmberAfClusterId clusterId)
A function used to deactivate a cluster client event. This function is a wrapper for emberAfDeactivateClusterTick.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | the endpoint of the event to be deactivated. |
EmberAfClusterId | N/A | clusterId | the cluster id of the event to be deactivated. |
Returns
EMBER_SUCCESS if the event was deactivated or an error otherwise.
emberAfDeactivateServerTick#
EmberStatus emberAfDeactivateServerTick (uint8_t endpoint, EmberAfClusterId clusterId)
A function used to deactivate a cluster server event. This function is a wrapper for emberAfDeactivateClusterTick.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint | the endpoint of the event to be deactivated. |
EmberAfClusterId | N/A | clusterId | the cluster id of the event to be deactivated. |
Returns
EMBER_SUCCESS if the event was deactivated or an error otherwise.
emberAfEventControlSetDelayMS#
EmberStatus emberAfEventControlSetDelayMS (EmberEventControl * control, uint32_t delayMs)
Sets the EmberEventControl to run "delayMs" milliseconds in the future. This function first verifies that the delay is within the acceptable range before scheduling the event.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | control | a pointer to the event control. |
uint32_t | N/A | delayMs | the number of milliseconds until the next event. |
Returns
If delayMs is less than or equal to ::EMBER_MAX_EVENT_CONTROL_DELAY_MS, this function will schedule the event and return EMBER_SUCCESS. Otherwise it will return EMBER_BAD_ARGUMENT.
emberAfEventControlSetDelay#
EmberStatus emberAfEventControlSetDelay (EmberEventControl * eventControl, uint32_t delayMs)
Sets the EmberEventControl to run "delayMs" milliseconds in the future. See emberAfEventControlSetDelayMS.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | eventControl | |
uint32_t | N/A | delayMs |
emberAfEventControlSetDelayQS#
EmberStatus emberAfEventControlSetDelayQS (EmberEventControl * control, uint32_t delayQs)
Sets the EmberEventControl to run "delayQs" quarter seconds in the future. The 'quarter seconds' are actually 256 milliseconds long. This function first verifies that the delay is within the acceptable range before scheduling the event.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | control | a pointer to the event control. |
uint32_t | N/A | delayQs | the number of quarter seconds until the next event. |
Returns
If delayQs is less than or equal to ::EMBER_MAX_EVENT_CONTROL_DELAY_QS, this function will schedule the event and return EMBER_SUCCESS. Otherwise it will return EMBER_BAD_ARGUMENT.
emberAfEventControlSetDelayMinutes#
EmberStatus emberAfEventControlSetDelayMinutes (EmberEventControl * control, uint16_t delayM)
Sets the EmberEventControl to run "delayM" minutes in the future. The 'minutes' are actually 65536 (0x10000) milliseconds long. This function first verifies that the delay is within the acceptable range before scheduling the event.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | control | a pointer to the event control. |
uint16_t | N/A | delayM | the number of minutes until the next event. |
Returns
If delayM is less than or equal to ::EMBER_MAX_EVENT_CONTROL_DELAY_MINUTES, this function will schedule the event and return EMBER_SUCCESS. Otherwise it will return EMBER_BAD_ARGUMENT.
emberAfNetworkEventControlSetInactive#
void emberAfNetworkEventControlSetInactive (EmberEventControl * controls)
Sets the EmberEventControl for the current network, and only the current network, as inactive. See ::emberEventControlSetInactive.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls |
emberAfNetworkEventControlGetActive#
bool emberAfNetworkEventControlGetActive (EmberEventControl * controls)
Returns true if the event for the current network, and only the current network, is active. See ::emberEventControlGetActive.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls |
emberAfNetworkEventControlSetActive#
void emberAfNetworkEventControlSetActive (EmberEventControl * controls)
Sets the EmberEventControl for the current network, and only current network, to run at the next available opportunity. See ::emberEventControlSetActive.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls |
emberAfNetworkEventControlSetDelayMS#
EmberStatus emberAfNetworkEventControlSetDelayMS (EmberEventControl * controls, uint32_t delayMs)
Sets the EmberEventControl for the current network, and only the current network, to run "delayMs" milliseconds in the future. See emberAfEventControlSetDelayMS.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls | |
uint32_t | N/A | delayMs |
emberAfNetworkEventControlSetDelay#
EmberStatus emberAfNetworkEventControlSetDelay (EmberEventControl * controls, uint32_t delayMs)
Sets the EmberEventControl for the current network, and only the current network, to run "delayMs" milliseconds in the future. See emberAfEventControlSetDelayMS.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls | |
uint32_t | N/A | delayMs |
emberAfNetworkEventControlSetDelayQS#
EmberStatus emberAfNetworkEventControlSetDelayQS (EmberEventControl * controls, uint32_t delayQs)
Sets the EmberEventControl for the current network, and only the current network, to run "delayQs" quarter seconds in the future. See emberAfEventControlSetDelayQS.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls | |
uint32_t | N/A | delayQs |
emberAfNetworkEventControlSetDelayMinutes#
EmberStatus emberAfNetworkEventControlSetDelayMinutes (EmberEventControl * controls, uint16_t delayM)
Sets the EmberEventControl for the current network, and only the current network, to run "delayM" minutes in the future. See emberAfEventControlSetDelayMinutes.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls | |
uint16_t | N/A | delayM |
emberAfEndpointEventControlSetInactive#
EmberStatus emberAfEndpointEventControlSetInactive (EmberEventControl * controls, uint8_t endpoint)
Sets the EmberEventControl for the specified endpoint as inactive. See ::emberEventControlSetInactive.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls | |
uint8_t | N/A | endpoint |
emberAfEndpointEventControlGetActive#
bool emberAfEndpointEventControlGetActive (EmberEventControl * controls, uint8_t endpoint)
Returns true if the event for the current number is active. See ::emberEventControlGetActive.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls | |
uint8_t | N/A | endpoint |
emberAfEndpointEventControlSetActive#
EmberStatus emberAfEndpointEventControlSetActive (EmberEventControl * controls, uint8_t endpoint)
Sets the EmberEventControl for the specified endpoint to run at the next available opportunity. See ::emberEventControlSetActive.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls | |
uint8_t | N/A | endpoint |
emberAfEndpointEventControlSetDelayMS#
EmberStatus emberAfEndpointEventControlSetDelayMS (EmberEventControl * controls, uint8_t endpoint, uint32_t delayMs)
Sets the EmberEventControl for the specified endpoint to run "delayMs" milliseconds in the future. See emberAfEventControlSetDelayMS.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls | |
uint8_t | N/A | endpoint | |
uint32_t | N/A | delayMs |
emberAfEndpointEventControlSetDelay#
EmberStatus emberAfEndpointEventControlSetDelay (EmberEventControl * controls, uint8_t endpoint, uint32_t delayMs)
Sets the EmberEventControl for the specified endpoint to run "delayMs" milliseconds in the future. See emberAfEventControlSetDelayMS.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls | |
uint8_t | N/A | endpoint | |
uint32_t | N/A | delayMs |
emberAfEndpointEventControlSetDelayQS#
EmberStatus emberAfEndpointEventControlSetDelayQS (EmberEventControl * controls, uint8_t endpoint, uint32_t delayQs)
Sets the EmberEventControl for the specified endpoint to run "delayQs" quarter seconds in the future. See emberAfEventControlSetDelayQS.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls | |
uint8_t | N/A | endpoint | |
uint32_t | N/A | delayQs |
emberAfEndpointEventControlSetDelayMinutes#
EmberStatus emberAfEndpointEventControlSetDelayMinutes (EmberEventControl * controls, uint8_t endpoint, uint16_t delayM)
Sets the EmberEventControl for the specified endpoint to run "delayM" minutes in the future. See emberAfEventControlSetDelayMinutes.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEventControl * | N/A | controls | |
uint8_t | N/A | endpoint | |
uint16_t | N/A | delayM |
emberAfMsToNextEvent#
uint32_t emberAfMsToNextEvent (uint32_t maxMs)
A function used to retrieve the number of milliseconds until the next event scheduled in the application framework's event mechanism.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | N/A | maxMs | maximum number of milliseconds until the next event. |
Returns
The number of milliseconds until the next event or maxMs if no event is scheduled before then.
emberAfMsToNextEventExtended#
uint32_t emberAfMsToNextEventExtended (uint32_t maxMs, uint8_t * returnIndex)
This is the same as the function emberAfMsToNextEvent() with the following addition. If returnIndex is non-NULL it returns the index of the event that is ready to fire next.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | N/A | maxMs | |
uint8_t * | N/A | returnIndex |
Messaging Documentation#
emberAfSendResponse#
EmberStatus emberAfSendResponse (void )
This function sends 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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
NOTE: This will overwrite the ZCL sequence number of the message to use the LAST received sequence number.
emberAfSendResponseWithCallback#
EmberStatus emberAfSendResponseWithCallback (EmberAfMessageSentFunction callback)
Send ZCL response with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberAfMessageSentFunction | N/A | callback |
emberAfSendMulticast#
EmberStatus emberAfSendMulticast (EmberMulticastId multicastId, EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message)
Sends multicast.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberMulticastId | N/A | multicastId | |
EmberApsFrame * | N/A | apsFrame | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | message |
emberAfSendMulticastToBindings#
EmberStatus emberAfSendMulticastToBindings (EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message)
Multicasts the message to the group 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. Care should be taken when considering the effects of broadcasts in a network.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberApsFrame * | N/A | apsFrame | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | message |
emberAfSendMulticastWithAliasWithCallback#
EmberStatus emberAfSendMulticastWithAliasWithCallback (EmberMulticastId multicastId, EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message, EmberNodeId alias, uint8_t sequence, EmberAfMessageSentFunction callback)
Sends Multicast with alias with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberMulticastId | N/A | multicastId | |
EmberApsFrame * | N/A | apsFrame | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | message | |
EmberNodeId | N/A | alias | |
uint8_t | N/A | sequence | |
EmberAfMessageSentFunction | N/A | callback |
emberAfSendMulticastWithCallback#
EmberStatus emberAfSendMulticastWithCallback (EmberMulticastId multicastId, EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message, EmberAfMessageSentFunction callback)
Sends multicast with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberMulticastId | N/A | multicastId | |
EmberApsFrame * | N/A | apsFrame | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | message | |
EmberAfMessageSentFunction | N/A | callback |
emberAfSendBroadcast#
EmberStatus emberAfSendBroadcast (EmberNodeId destination, EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message)
Sends broadcast.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | destination | |
EmberApsFrame * | N/A | apsFrame | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | message |
emberAfSendBroadcastWithCallback#
EmberStatus emberAfSendBroadcastWithCallback (EmberNodeId destination, EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message, EmberAfMessageSentFunction callback)
Sends broadcast with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | destination | |
EmberApsFrame * | N/A | apsFrame | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | message | |
EmberAfMessageSentFunction | N/A | callback |
emberAfSendBroadcastWithAliasWithCallback#
EmberStatus emberAfSendBroadcastWithAliasWithCallback (EmberNodeId destination, EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message, EmberNodeId alias, uint8_t sequence, EmberAfMessageSentFunction callback)
Sends broadcast with alias with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | destination | |
EmberApsFrame * | N/A | apsFrame | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | message | |
EmberNodeId | N/A | alias | |
uint8_t | N/A | sequence | |
EmberAfMessageSentFunction | N/A | callback |
emberAfSendUnicast#
EmberStatus emberAfSendUnicast (EmberOutgoingMessageType type, uint16_t indexOrDestination, EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message)
Sends unicast.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberOutgoingMessageType | N/A | type | |
uint16_t | N/A | indexOrDestination | |
EmberApsFrame * | N/A | apsFrame | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | message |
emberAfSendUnicastWithCallback#
EmberStatus emberAfSendUnicastWithCallback (EmberOutgoingMessageType type, uint16_t indexOrDestination, EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message, EmberAfMessageSentFunction callback)
Sends unicast with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberOutgoingMessageType | N/A | type | |
uint16_t | N/A | indexOrDestination | |
EmberApsFrame * | N/A | apsFrame | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | message | |
EmberAfMessageSentFunction | N/A | callback |
emberAfSendUnicastToBindings#
EmberStatus emberAfSendUnicastToBindings (EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message)
Unicasts 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.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberApsFrame * | N/A | apsFrame | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | message |
emberAfSendUnicastToBindingsWithCallback#
EmberStatus emberAfSendUnicastToBindingsWithCallback (EmberApsFrame * apsFrame, uint16_t messageLength, uint8_t * message, EmberAfMessageSentFunction callback)
emberAfSendUnicastToBindings with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberApsFrame * | N/A | apsFrame | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | message | |
EmberAfMessageSentFunction | N/A | callback |
emberAfSendInterPan#
EmberStatus emberAfSendInterPan (EmberPanId panId, const EmberEUI64 destinationLongId, EmberNodeId destinationShortId, EmberMulticastId multicastId, EmberAfClusterId clusterId, EmberAfProfileId profileId, uint16_t messageLength, uint8_t * messageBytes)
Sends interpan message.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberPanId | N/A | panId | |
const EmberEUI64 | N/A | destinationLongId | |
EmberNodeId | N/A | destinationShortId | |
EmberMulticastId | N/A | multicastId | |
EmberAfClusterId | N/A | clusterId | |
EmberAfProfileId | N/A | profileId | |
uint16_t | N/A | messageLength | |
uint8_t * | N/A | messageBytes |
emberAfSendEndDeviceBind#
EmberStatus emberAfSendEndDeviceBind (uint8_t endpoint)
Sends end device binding request.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint |
emberAfSendCommandUnicastToBindings#
EmberStatus emberAfSendCommandUnicastToBindings (void )
Sends the command prepared with emberAfFill.... macro.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
This function is used to send a command that was previously prepared using the emberAfFill... 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.
emberAfSendCommandUnicastToBindingsWithCallback#
EmberStatus emberAfSendCommandUnicastToBindingsWithCallback (EmberAfMessageSentFunction callback)
emberAfSendCommandUnicastToBindings with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberAfMessageSentFunction | N/A | callback |
emberAfSendCommandMulticast#
EmberStatus emberAfSendCommandMulticast (EmberMulticastId multicastId)
Sends the command prepared with emberAfFill.... macro.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberMulticastId | N/A | multicastId |
This function is used to send a command that was previously prepared using the emberAfFill... macros from the client command API. It will be sent as multicast.
emberAfSendCommandMulticastWithAlias#
EmberStatus emberAfSendCommandMulticastWithAlias (EmberMulticastId multicastId, EmberNodeId alias, uint8_t sequence)
Sends the command prepared with emberAfFill.... macro.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberMulticastId | N/A | multicastId | |
EmberNodeId | N/A | alias | |
uint8_t | N/A | sequence |
This function is used to send a command that was previously prepared using the emberAfFill... macros from the client command API. It will be sent as multicast.
emberAfSendCommandMulticastWithCallback#
EmberStatus emberAfSendCommandMulticastWithCallback (EmberMulticastId multicastId, EmberAfMessageSentFunction callback)
emberAfSendCommandMulticast with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberMulticastId | N/A | multicastId | |
EmberAfMessageSentFunction | N/A | callback |
emberAfSendCommandMulticastToBindings#
EmberStatus emberAfSendCommandMulticastToBindings (void )
Sends the command prepared with emberAfFill.... macro.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
This function is used to send a command that was previously prepared using the emberAfFill... 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.
emberAfSendCommandUnicast#
EmberStatus emberAfSendCommandUnicast (EmberOutgoingMessageType type, uint16_t indexOrDestination)
Sends the command prepared with emberAfFill.... macro.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberOutgoingMessageType | N/A | type | |
uint16_t | N/A | indexOrDestination |
This function is used to send a command that was previously prepared using the emberAfFill... macros from the client command API. It will be sent as unicast.
emberAfSendCommandUnicastWithCallback#
EmberStatus emberAfSendCommandUnicastWithCallback (EmberOutgoingMessageType type, uint16_t indexOrDestination, EmberAfMessageSentFunction callback)
emberAfSendCommandUnicast with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberOutgoingMessageType | N/A | type | |
uint16_t | N/A | indexOrDestination | |
EmberAfMessageSentFunction | N/A | callback |
emberAfSendCommandBroadcast#
EmberStatus emberAfSendCommandBroadcast (EmberNodeId destination)
Sends the command prepared with emberAfFill.... macro.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | destination |
This function is used to send a command that was previously prepared using the emberAfFill... macros from the client command API.
emberAfSendCommandBroadcastWithCallback#
EmberStatus emberAfSendCommandBroadcastWithCallback (EmberNodeId destination, EmberAfMessageSentFunction callback)
emberAfSendCommandBroadcast with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | destination | |
EmberAfMessageSentFunction | N/A | callback |
emberAfSendCommandBroadcastWithAliasWithCallback#
EmberStatus emberAfSendCommandBroadcastWithAliasWithCallback (EmberNodeId destination, EmberNodeId alias, uint8_t sequence, EmberAfMessageSentFunction callback)
emberAfSendCommandBroadcast from alias with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | destination | |
EmberNodeId | N/A | alias | |
uint8_t | N/A | sequence | |
EmberAfMessageSentFunction | N/A | callback |
emberAfSendCommandBroadcastWithAlias#
EmberStatus emberAfSendCommandBroadcastWithAlias (EmberNodeId destination, EmberNodeId alias, uint8_t sequence)
Sends the command prepared with emberAfFill.... macro.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | destination | |
EmberNodeId | N/A | alias | |
uint8_t | N/A | sequence |
This function is used to send a command that was previously prepared using the emberAfFill... macros from the client command API.
emberAfSendCommandInterPan#
EmberStatus emberAfSendCommandInterPan (EmberPanId panId, const EmberEUI64 destinationLongId, EmberNodeId destinationShortId, EmberMulticastId multicastId, EmberAfProfileId profileId)
Sends the command prepared with emberAfFill.... macro.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberPanId | N/A | panId | |
const EmberEUI64 | N/A | destinationLongId | |
EmberNodeId | N/A | destinationShortId | |
EmberMulticastId | N/A | multicastId | |
EmberAfProfileId | N/A | profileId |
This function is used to send a command that was previously prepared using the emberAfFill... 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.
emberAfSendDefaultResponse#
EmberStatus emberAfSendDefaultResponse (const EmberAfClusterCommand * cmd, EmberAfStatus status)
Sends a default response to a cluster command.
Type | Direction | Argument Name | Description |
---|---|---|---|
const EmberAfClusterCommand * | N/A | cmd | The cluster command to which to respond. |
EmberAfStatus | 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 EmberStatus value that indicates the success or failure of sending the response.
emberAfSendDefaultResponseWithCallback#
EmberStatus emberAfSendDefaultResponseWithCallback (const EmberAfClusterCommand * cmd, EmberAfStatus status, EmberAfMessageSentFunction callback)
emberAfSendDefaultResponse with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
const EmberAfClusterCommand * | N/A | cmd | |
EmberAfStatus | N/A | status | |
EmberAfMessageSentFunction | N/A | callback |
emberAfSendImmediateDefaultResponse#
EmberStatus emberAfSendImmediateDefaultResponse (EmberAfStatus status)
Sends a default response to a cluster command using the current command.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberAfStatus | 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 EmberStatus value that indicates the success or failure of sending the response.
emberAfSendImmediateDefaultResponseWithCallback#
EmberStatus emberAfSendImmediateDefaultResponseWithCallback (EmberAfStatus status, EmberAfMessageSentFunction callback)
emberAfSendImmediateDefaultResponse with attached message sent callback.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberAfStatus | N/A | status | |
EmberAfMessageSentFunction | N/A | callback |
emberAfMaximumApsPayloadLength#
uint8_t emberAfMaximumApsPayloadLength (EmberOutgoingMessageType type, uint16_t indexOrDestination, EmberApsFrame * apsFrame)
Returns the maximum size of the payload that the Application Support sub-layer will accept for the given message type, destination, and APS frame.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberOutgoingMessageType | N/A | type | The outgoing message type. |
uint16_t | N/A | indexOrDestination | Depending on the message type, this is either the EmberNodeId of the destination, an index into the address table, an index into the binding table, the multicast identifier, or a broadcast address. |
EmberApsFrame * | 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.
emberAfGetCommandApsFrame#
EmberApsFrame* emberAfGetCommandApsFrame (void )
Access to client API APS frame.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfSetCommandEndpoints#
void emberAfSetCommandEndpoints (uint8_t sourceEndpoint, uint8_t destinationEndpoint)
Set the source and destination endpoints in the client API APS frame.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | sourceEndpoint | |
uint8_t | N/A | destinationEndpoint |
emberAfFindDevicesByProfileAndCluster#
EmberStatus emberAfFindDevicesByProfileAndCluster (EmberNodeId target, EmberAfProfileId profileId, EmberAfClusterId clusterId, bool serverCluster, EmberAfServiceDiscoveryCallback * callback)
Use this function to 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 EMBER_RX_ON_WHEN_IDLE_BROADCAST_ADDRESS.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | target | The destination node ID for the discovery; either a specific node's ID or EMBER_RX_ON_WHEN_IDLE_BROADCAST_ADDRESS. |
EmberAfProfileId | N/A | profileId | The application profile for the cluster being discovered. |
EmberAfClusterId | N/A | clusterId | The cluster being discovered. |
bool | N/A | serverCluster | EMBER_AF_SERVER_CLUSTER_DISCOVERY (true) if discovering servers for the target cluster; EMBER_AF_CLIENT_CLUSTER_DISCOVERY (false) if discovering clients for that cluster. |
EmberAfServiceDiscoveryCallback * | 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.) |
With this function a service discovery is initiated and 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.
emberAfFindClustersByDeviceAndEndpoint#
EmberStatus emberAfFindClustersByDeviceAndEndpoint (EmberNodeId target, uint8_t targetEndpoint, EmberAfServiceDiscoveryCallback * callback)
Use this function to 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.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | 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. |
uint8_t | N/A | targetEndpoint | The endpoint to target with the discovery process. |
EmberAfServiceDiscoveryCallback * | N/A | callback | Function pointer for the callback function triggered when the discovery is returned. |
With this function a single service discovery is initiated and the response is passed back to the passed callback.
emberAfFindIeeeAddress#
EmberStatus emberAfFindIeeeAddress (EmberNodeId shortAddress, EmberAfServiceDiscoveryCallback * callback)
Use this function to initiate a discovery for the IEEE address of the specified node id. This will send a unicast sent to the target node ID.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | shortAddress | |
EmberAfServiceDiscoveryCallback * | N/A | callback |
emberAfFindNodeId#
EmberStatus emberAfFindNodeId (EmberEUI64 longAddress, EmberAfServiceDiscoveryCallback * callback)
Use this function to 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).
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEUI64 | N/A | longAddress | |
EmberAfServiceDiscoveryCallback * | N/A | callback |
emberAfFindActiveEndpoints#
EmberStatus emberAfFindActiveEndpoints (EmberNodeId target, EmberAfServiceDiscoveryCallback * callback)
Initiate an Active Endpoint request ZDO message to the target node ID.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | target | |
EmberAfServiceDiscoveryCallback * | N/A | callback |
emberAfAddAddressTableEntry#
uint8_t emberAfAddAddressTableEntry (EmberEUI64 longId, EmberNodeId shortId)
Use this function to add an entry for a remote device to the address table.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberEUI64 | N/A | longId | The EUI64 of the remote device. |
EmberNodeId | N/A | shortId | The node id of the remote device or EMBER_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 emberAfRemoveAddressTableEntry.
Returns
The index of the address table entry for this remove device or EMBER_NULL_ADDRESS_TABLE_INDEX if an error occurred (e.g., the address table is full).
emberAfSetAddressTableEntry#
EmberStatus emberAfSetAddressTableEntry (uint8_t index, EmberEUI64 longId, EmberNodeId shortId)
Use this function to add an entry for a remote device to the address table at a specific location.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | index | The index of the address table entry. |
EmberEUI64 | N/A | longId | The EUI64 of the remote device. |
EmberNodeId | N/A | shortId | The node id of the remote device or EMBER_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 emberAfAddAddressTableEntry. 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 emberAfRemoveAddressTableEntry.
Returns
EMBER_SUCCESS if the address table entry was successfully set, EMBER_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 EMBER_ADDRESS_TABLE_INDEX_OUT_OF_RANGE if the index is out of range.
emberAfRemoveAddressTableEntry#
EmberStatus emberAfRemoveAddressTableEntry (uint8_t index)
Use this function to remove a specific entry from the address table.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | 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 emberAfAddAddressTableEntry and emberAfSetAddressTableEntry. The address table entry at this index will not actually be removed until its reference count reaches zero.
Returns
EMBER_SUCCESS if the address table entry was successfully removed or EMBER_ADDRESS_TABLE_INDEX_OUT_OF_RANGE if the index is out of range.
emberAfInitiateKeyEstablishment#
EmberStatus emberAfInitiateKeyEstablishment (EmberNodeId nodeId, uint8_t endpoint)
Use this function to initiate key establishment with a remote node. emberAfKeyEstablishmentCallback will be called as events occur and when key establishment completes.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | nodeId | The node id of the remote device. |
uint8_t | N/A | endpoint | The endpoint on the remote device. |
Returns
EMBER_SUCCESS if key establishment was initiated successfully
emberAfInitiateInterPanKeyEstablishment#
EmberStatus emberAfInitiateInterPanKeyEstablishment (EmberPanId panId, const EmberEUI64 eui64)
Use this function to initiate key establishment with a remote node on a different PAN. emberAfInterPanKeyEstablishmentCallback will be called as events occur and when key establishment completes.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberPanId | N/A | panId | The PAN id of the remote device. |
const EmberEUI64 | N/A | eui64 | The EUI64 of the remote device. |
Returns
EMBER_SUCCESS if key establishment was initiated successfully
emberAfPerformingKeyEstablishment#
bool emberAfPerformingKeyEstablishment (void )
Use this function to tell if the device is in the process of performing key establishment.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
::true if key establishment is in progress.
emberAfInitiatePartnerLinkKeyExchange#
EmberStatus emberAfInitiatePartnerLinkKeyExchange (EmberNodeId target, uint8_t endpoint, EmberAfPartnerLinkKeyExchangeCallback * callback)
Use this function to initiate partner link key exchange with a remote node.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNodeId | N/A | target | The node id of the remote device. |
uint8_t | N/A | endpoint | The key establishment endpoint of the remote device. |
EmberAfPartnerLinkKeyExchangeCallback * | N/A | callback | The callback that should be called when the partner link key exchange completes. |
Returns
EMBER_SUCCESS if the partner link key exchange was initiated successfully.
emberAfIsCurrentSecurityProfileSmartEnergy#
bool emberAfIsCurrentSecurityProfileSmartEnergy (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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
ZCL macros Documentation#
Network utility functions Documentation#
emberAfFormNetwork#
EmberStatus emberAfFormNetwork (EmberNetworkParameters * parameters)
Use this function to form a new network using the specified network parameters.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNetworkParameters * | N/A | parameters | Specification of the new network. |
Returns
An EmberStatus value that indicates either the successful formation of the new network or the reason that the network formation failed.
emberAfJoinNetwork#
EmberStatus emberAfJoinNetwork (EmberNetworkParameters * parameters)
Use this function to associate with the network using the specified network parameters.
Type | Direction | Argument Name | Description |
---|---|---|---|
EmberNetworkParameters * | N/A | parameters | Specification of the network with which the node should associate. |
Returns
An EmberStatus value that indicates either that the association process began successfully or the reason for failure.
emberAfFindUnusedPanIdAndForm#
EmberStatus emberAfFindUnusedPanIdAndForm (void )
Use this function to find an unused PAN id and form a new network.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
An EmberStatus value that indicates either the process begin successfully or the reason for failure.
emberAfStartSearchForJoinableNetwork#
EmberStatus emberAfStartSearchForJoinableNetwork (void )
Use this function to find a joinable network and join it.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
An EmberStatus value that indicates either the process begin successfully or the reason for failure.
emberAfPushNetworkIndex#
EmberStatus emberAfPushNetworkIndex (uint8_t networkIndex)
Sets the current network to that of the given index 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 emberAfPopNetworkIndex.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | networkIndex |
emberAfPushCallbackNetworkIndex#
EmberStatus emberAfPushCallbackNetworkIndex (void )
Sets 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 emberAfPopNetworkIndex.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfPushEndpointNetworkIndex#
EmberStatus emberAfPushEndpointNetworkIndex (uint8_t endpoint)
Sets 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 emberAfPopNetworkIndex.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | endpoint |
emberAfPopNetworkIndex#
EmberStatus emberAfPopNetworkIndex (void )
Removes 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 emberAfPushNetworkIndex, emberAfPushCallbackNetworkIndex, or emberAfPushEndpointNetworkIndex.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfPrimaryEndpointForNetworkIndex#
uint8_t emberAfPrimaryEndpointForNetworkIndex (uint8_t networkIndex)
Returns the primary endpoint of the given network index or 0xFF if no endpoints belong to the network.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | N/A | networkIndex |
emberAfPrimaryEndpointForCurrentNetworkIndex#
uint8_t emberAfPrimaryEndpointForCurrentNetworkIndex (void )
Returns the primary endpoint of the current network index or 0xFF if no endpoints belong to the current network.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfMainInit#
void emberAfMainInit (void )
Basic initialization API to be invoked before emberAfMain.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
emberAfMain#
int emberAfMain (MAIN_FUNCTION_PARAMETERS )
This function effectively serves as the application main.
Type | Direction | Argument Name | Description |
---|---|---|---|
MAIN_FUNCTION_PARAMETERS | N/A |