Ember Connect API for finding, forming, joining, and leaving Connect networks. More...

Macros

#define EMBER_MAC_MAX_APP_BEACON_PAYLOAD_LENGTH
The maximum length in bytes of the application beacon payload. More...

Handlers

void emberIncomingBeaconHandler ( EmberPanId panId, EmberNodeId nodeId, int8_t rssi, bool permitJoining, uint8_t payloadLength, uint8_t *payload)
This stack handler is invoked if a beacon is received during the scanning procedure and if this was initiated by the application with the emberStartActiveScan stack APIs. More...
void emberActiveScanCompleteHandler (void)
This stack handler is invoked after the application calls the emberStartActiveScan stack API to inform the application that the scanning procedure is complete. More...
void emberEnergyScanCompleteHandler (int8_t mean, int8_t min, int8_t max, uint16_t variance)
This stack handler is invoked after the application calls the emberStartEnergyScan stack API to inform the application that the energy scan procedure is complete and to provide statistics. More...
void emberFrequencyHoppingStartClientCompleteHandler ( EmberStatus status)
This stack handler is invoked after the application calls the emberFrequencyHoppingStartClient stack API to inform the application that the synchronization process with the server is complete. After the client is synched to a server, it may seamlessly perform the resynchronization process if needed. Sleepy devices in particular periodically perform the resynchronization process. If the client fails a resynchronization process, it will inform the application by invoking the emberStackStatusHandler handler with EMBER_MAC_SYNC_TIMEOUT status. When this occurs, the client will be no longer synched to the server. More...

APIs

EmberStatus emberInit (void)
Initializes the radio and the Ember stack. More...
void emberTick (void)
A periodic tick routine that should be called: More...
EmberStatus emberNetworkInit (void)
Resumes the network operation after a reboot. More...
EmberStatus emberStartActiveScan (uint8_t channel)
Starts an active scan. EMBER_SUCCESS signals that the scan successfully started. Upon receiving a beacon, the emberIncomingBeaconHandler stack handler is called. At the end of the scanning procedure, the emberActiveScanCompleteHandler stack handler is called. Note that, while a scan can be initiated when the node is currently joined to a network, the node will generally be unable to communicate with its PAN during the scan period. In particular, time-sensitive network operations might be affected because a scan operation will prevent any network operation for the duration of the scan. More...
EmberStatus emberStartEnergyScan (uint8_t channel, uint8_t samples)
Starts an energy scan. EMBER_SUCCESS signals that the scan successfully started. At the end of the scanning procedure the emberEnergyScanCompleteHandler stack handler is called. Note that, while a scan can be initiated when the node is currently joined to a network, the node is generally unable to communicate with its PAN during the scan period. In particular, time-sensitive network operations might be affected because a scan operation will prevent any network operation for the duration of the scan. More...
EmberStatus emberSetApplicationBeaconPayload (uint8_t payloadLength, uint8_t *payload)
Allows the application to set the application portion of the beacon payload. It's by default set to the empty string. More...
EmberStatus emberFormNetwork ( EmberNetworkParameters *parameters)
Forms a new network by becoming the coordinator. More...
EmberStatus emberJoinNetworkExtended ( EmberNodeType nodeType, EmberNodeId nodeId, EmberNetworkParameters *parameters)
Causes the stack to associate with the network using the specified network parameters. It can take several seconds for the stack to associate with the local network. Do not send messages until a call to the emberStackStatusHandler() callback informs you that the stack is up. More...
EmberStatus emberJoinNetwork ( EmberNodeType nodeType, EmberNetworkParameters *parameters)
Causes the stack to associate with the network using the specified network parameters. The network ID is assigned by the network coordinator. It can take several seconds for the stack to associate with the local network. Do not send messages until a call to the emberStackStatusHandler() callback informs you that the stack is up. More...
EmberStatus emberPermitJoining (uint8_t duration)
Tells the stack to allow other nodes to join the network with this node as their parent. Joining is initially disabled by default. This function may only be called after the node is part of a network and the stack is up. More...
EmberStatus emberJoinCommissioned ( EmberNodeType nodeType, EmberNodeId nodeId, EmberNetworkParameters *parameters)
Causes the stack to go up with the passed network parameters without performing any over-the-air message exchange. More...
EmberStatus emberSetAuxiliaryAddressFilteringEntry ( EmberNodeId nodeId, uint8_t entryIndex)
Sets an entry in the auxiliary address filtering table at a given address. Nodes of EMBER_DIRECT_DEVICE device type can receive incoming messages destined to any of the node IDs in the auxiliary address filtering table (while also receiving messages destined to actual node ID). If the passed node ID is EMBER_NULL_NODE_ID , the entry is cleared. More...
EmberNodeId emberGetAuxiliaryAddressFilteringEntry (uint8_t entryIndex)
Retrieves the content of the auxiliary address filtering table at a given address. More...
void emberResetNetworkState (void)
Forgets the current network and reverts to a network status of EMBER_NO_NETWORK . More...
EmberStatus emberMacSetAllocateAddressFlag (bool allocateAddress)
Configures the "allocate address" flag in the association request command for nodes joining as EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE . This flag should be set if the device wishes to obtain a random 16-bit address from the coordinator. If cleared, the coordinator will not assign a 16-bit address to the device. More...
EmberStatus emberFrequencyHoppingStartServer (void)
Starts operating as a frequency hopping server. This API can only be invoked when the node is joined to a network. More...
EmberStatus emberFrequencyHoppingStartClient ( EmberNodeId serverNodeId, EmberPanId serverPanId)
Starts operating as a frequency hopping client and synchronize with the specified server. This API can be invoked on nodes that are already joined to a network (with the exception of nodes started as EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE ) and nodes that are not joined to a network yet. If the node is already performing frequency hopping, this API returns EMBER_INVALID_CALL . If this API returns EMBER_SUCCESS , the emberFrequencyHoppingStartClientCompleteHandler is invoked asynchronously to inform the application whether the node successfully synchronized with the specified server or to inform the application of the reason of failure. Once the client is synched to a server, it may seamlessly perform the resynchronization process if needed. Sleepy devices in particular periodically perform the resynchronization process. If the client fails a resynchronization process, it informs the application by invoking the emberStackStatusHandler handler with EMBER_MAC_SYNC_TIMEOUT status. When this occurs, the client will no longer be synched to the server. The application may elect to attempt a new synchronization process by invoking this API again. More...
EmberStatus emberFrequencyHoppingStop (void)
Stops frequency hopping. This API can only be invoked when the node is frequency hopping. More...
#define EMBER_MAX_AUXILIARY_ADDRESS_FILTERING_TABLE_LENGTH
The maximum number of entries the auxiliary address filtering table can hold. More...

Detailed Description

Ember Connect API for finding, forming, joining, and leaving Connect networks.

See network-management.h for source code.

Macro Definition Documentation

#define EMBER_MAC_MAX_APP_BEACON_PAYLOAD_LENGTH

The maximum length in bytes of the application beacon payload.

Definition at line 22 of file network-management.h .

#define EMBER_MAX_AUXILIARY_ADDRESS_FILTERING_TABLE_LENGTH

The maximum number of entries the auxiliary address filtering table can hold.

Definition at line 310 of file network-management.h .

Function Documentation

void emberActiveScanCompleteHandler ( void )

This stack handler is invoked after the application calls the emberStartActiveScan stack API to inform the application that the scanning procedure is complete.

void emberEnergyScanCompleteHandler ( int8_t mean,
int8_t min,
int8_t max,
uint16_t variance
)

This stack handler is invoked after the application calls the emberStartEnergyScan stack API to inform the application that the energy scan procedure is complete and to provide statistics.

Parameters
mean The average energy detected.
min The minimum energy detected.
max The maximum energy detected.
variance The variance of the energy detected.
EmberStatus emberFormNetwork ( EmberNetworkParameters * parameters )

Forms a new network by becoming the coordinator.

Parameters
parameters An EmberNetworkParameters value that specifies the network parameters of the network to be formed.
Returns
An EmberStatus value that indicates either the successful formation of the new network or the reason that the network formation failed.
EmberStatus emberFrequencyHoppingStartClient ( EmberNodeId serverNodeId,
EmberPanId serverPanId
)

Starts operating as a frequency hopping client and synchronize with the specified server. This API can be invoked on nodes that are already joined to a network (with the exception of nodes started as EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE ) and nodes that are not joined to a network yet. If the node is already performing frequency hopping, this API returns EMBER_INVALID_CALL . If this API returns EMBER_SUCCESS , the emberFrequencyHoppingStartClientCompleteHandler is invoked asynchronously to inform the application whether the node successfully synchronized with the specified server or to inform the application of the reason of failure. Once the client is synched to a server, it may seamlessly perform the resynchronization process if needed. Sleepy devices in particular periodically perform the resynchronization process. If the client fails a resynchronization process, it informs the application by invoking the emberStackStatusHandler handler with EMBER_MAC_SYNC_TIMEOUT status. When this occurs, the client will no longer be synched to the server. The application may elect to attempt a new synchronization process by invoking this API again.

Parameters
serverNodeId An EmberNodeId value indicating the node ID of the server to synchronize with.
serverPanId An EmberPanId value indicating the PAN ID of the server to synchronize with. Note that this parameter is meaningful only if the node is not currently joined to any network.
Returns
An EmberStatus value of EMBER_SUCCESS indicating that the node successfully initiated the synchronization process with the server, otherwise an EmberStatus value indicating the reason of failure.
void emberFrequencyHoppingStartClientCompleteHandler ( EmberStatus status )

This stack handler is invoked after the application calls the emberFrequencyHoppingStartClient stack API to inform the application that the synchronization process with the server is complete. After the client is synched to a server, it may seamlessly perform the resynchronization process if needed. Sleepy devices in particular periodically perform the resynchronization process. If the client fails a resynchronization process, it will inform the application by invoking the emberStackStatusHandler handler with EMBER_MAC_SYNC_TIMEOUT status. When this occurs, the client will be no longer synched to the server.

Parameters
status An EmberStatus value indicating whether the synchronization process with the server was completed successfully or the reason for failure.
EmberStatus emberFrequencyHoppingStartServer ( void )

Starts operating as a frequency hopping server. This API can only be invoked when the node is joined to a network.

Returns
An EmberStatus value of EMBER_SUCCESS if the node successfully initiated frequency hopping server operations. An EmberStatus value of EMBER_INVALID_CALL if the node is not currently joined to a network or if the node is already performing frequency hopping.
EmberStatus emberFrequencyHoppingStop ( void )

Stops frequency hopping. This API can only be invoked when the node is frequency hopping.

Returns
An EmberStatus value of EMBER_SUCCESS indicating that the node successfully stopped frequency hopping. An EmberStatus value of EMBER_INVALID_CALL if the node is not currently frequency hopping.
EmberNodeId emberGetAuxiliaryAddressFilteringEntry ( uint8_t entryIndex )

Retrieves the content of the auxiliary address filtering table at a given address.

Parameters
entryIndex The index in the auxiliary address filtering table entry to be retrieved.
Returns
An EmberNodeId value of EMBER_NULL_NODE_ID if the passed entry index is invalid or if the passed entry index refers to an unused entry. Otherwise, it returns the content of the auxiliary address filtering table entry corresponding to the passed entry index.
void emberIncomingBeaconHandler ( EmberPanId panId,
EmberNodeId nodeId,
int8_t rssi,
bool permitJoining,
uint8_t payloadLength,
uint8_t * payload
)

This stack handler is invoked if a beacon is received during the scanning procedure and if this was initiated by the application with the emberStartActiveScan stack APIs.

Parameters
panId The source pan ID of the received beacon.
nodeId The source node ID of the received beacon.
rssi The RSSI the beacon was received with.
permitJoining The permit joining flag in the received beacon.
payloadLength The length in bytes of the application beacon payload of the received beacon.
payload A pointer to the application beacon payload of the received beacon.
EmberStatus emberInit ( void )

Initializes the radio and the Ember stack.

Device configuration functions must be called before emberInit() is called.

Note
The application must check the return value of this function. If the initialization fails, normal messaging functions are not available. Some failure modes are not fatal, but the application must follow certain procedures to permit recovery. Ignoring the return code results in unpredictable radio and API behavior. (In particular, problems with association will occur.)
Returns
An EmberStatus value indicating successful initialization or the reason for failure.
EmberStatus emberJoinCommissioned ( EmberNodeType nodeType,
EmberNodeId nodeId,
EmberNetworkParameters * parameters
)

Causes the stack to go up with the passed network parameters without performing any over-the-air message exchange.

Parameters
nodeType Specifies the role that this node will have in the network. The only device types allowed in the commissioning API are EMBER_DIRECT_DEVICE , EMBER_MAC_MODE_DEVICE and EMBER_MAC_MODE_SLEEPY_DEVICE .
nodeId An EmberNodeId value that specifies the short ID the node will have. The passed node ID must be a valid short address (any value other than EMBER_NULL_NODE_ID or EMBER_BROADCAST_ADDRESS ).
parameters An EmberNetworkParameters value that specifies the network parameters of the network the node should participate in.
Returns
An EmberStatus value that indicates either:
  • that the node successfully commissioned the passed network parameters
  • the reason for failure.
EmberStatus emberJoinNetwork ( EmberNodeType nodeType,
EmberNetworkParameters * parameters
)

Causes the stack to associate with the network using the specified network parameters. The network ID is assigned by the network coordinator. It can take several seconds for the stack to associate with the local network. Do not send messages until a call to the emberStackStatusHandler() callback informs you that the stack is up.

Parameters
nodeType Specification of the role that this node will have in the network. This role can be EMBER_STAR_RANGE_EXTENDER , EMBER_STAR_END_DEVICE , EMBER_STAR_SLEEPY_END_DEVICE , EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE . If the node is frequency hopping, the role can not be EMBER_STAR_RANGE_EXTENDER .
parameters An EmberNetworkParameters value that specifies the network parameters 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.
EmberStatus emberJoinNetworkExtended ( EmberNodeType nodeType,
EmberNodeId nodeId,
EmberNetworkParameters * parameters
)

Causes the stack to associate with the network using the specified network parameters. It can take several seconds for the stack to associate with the local network. Do not send messages until a call to the emberStackStatusHandler() callback informs you that the stack is up.

Parameters
nodeType Specification of the role that this node will have in the network. This role can be EMBER_STAR_RANGE_EXTENDER , EMBER_STAR_END_DEVICE , EMBER_STAR_SLEEPY_END_DEVICE , EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE . If the node is frequency hopping, the role can not be EMBER_STAR_RANGE_EXTENDER .
nodeId An EmberNodeId value indicating the short ID the node intends to use for addressing purposes. If this value is EMBER_NULL_NODE_ID , the network coordinator will allocate a new short address. Addresses should be allocated by the coordinator unless there is a specific need to join a network with a specific ID. If a specific ID is used, uniqueness should be guaranteed across the entire network by the application, via some out of band means. Notice that nodes of EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE require this parameter to be set to EMBER_NULL_NODE_ID .
parameters An EmberNetworkParameters value that specifies the network parameters 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.
EmberStatus emberMacSetAllocateAddressFlag ( bool allocateAddress )

Configures the "allocate address" flag in the association request command for nodes joining as EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE . This flag should be set if the device wishes to obtain a random 16-bit address from the coordinator. If cleared, the coordinator will not assign a 16-bit address to the device.

Parameters
allocateAddress Configured whether the short address should be allocated by the coordinator when associating. Note, this only applies to nodes joining as EMBER_MAC_MODE_DEVICE or EMBER_MAC_MODE_SLEEPY_DEVICE .
Returns
An EmberStatus value of EMBER_SUCCESS if the flag was successfully set, or another EmberStatus value indicating the reason of failure.
EmberStatus emberNetworkInit ( void )

Resumes the network operation after a reboot.

This API must be called on boot prior to ANY network operations. It initializes the networking system and attempts to resume the previous network identity and configuration. If the node was not previously joined, this routine should still be called.

If the node was previously joined to a network it will retain its original type (e.g., coordinator, router, end device, and so on.)

EMBER_NOT_JOINED is returned if the node is not part of a network.

Returns
An EmberStatus value that indicates one of the following:
  • successful initialization,
  • EMBER_NOT_JOINED if the node is not part of a network, or
  • the reason for failure.
EmberStatus emberPermitJoining ( uint8_t duration )

Tells the stack to allow other nodes to join the network with this node as their parent. Joining is initially disabled by default. This function may only be called after the node is part of a network and the stack is up.

Parameters
duration A value of 0x00 disables joining. A value of 0xFF enables joining indefinitely. Any other value enables joining for that number of seconds.
Returns
an EmberStatus value of EMBER_SUCCESS if the permit joining was successfully set, otherwise an EmberStatus value indicating the reason of failure.
void emberResetNetworkState ( void )

Forgets the current network and reverts to a network status of EMBER_NO_NETWORK .

EmberStatus emberSetApplicationBeaconPayload ( uint8_t payloadLength,
uint8_t * payload
)

Allows the application to set the application portion of the beacon payload. It's by default set to the empty string.

Parameters
payloadLength The length in bytes of the application beacon payload to be set. This value can not exceed EMBER_MAC_MAX_APP_BEACON_PAYLOAD_LENGTH .
payload A pointer to the application beacon payload to be set.
Returns
an EmberStatus value of EMBER_SUCCESS if the application beacon payload was successfully set, otherwise an EmberStatus value indicating the reason of failure.
EmberStatus emberSetAuxiliaryAddressFilteringEntry ( EmberNodeId nodeId,
uint8_t entryIndex
)

Sets an entry in the auxiliary address filtering table at a given address. Nodes of EMBER_DIRECT_DEVICE device type can receive incoming messages destined to any of the node IDs in the auxiliary address filtering table (while also receiving messages destined to actual node ID). If the passed node ID is EMBER_NULL_NODE_ID , the entry is cleared.

Parameters
nodeId An EmberNodeId value to be added to the auxiliary address filtering table at the passed entry index.
entryIndex The index of the auxiliary address filtering table entry to be set.
Returns
An EmberStatus value of EMBER_SUCCESS if auxiliary address filtering table entry was successfully set. An EmberStatus value of EMBER_INVALID_CALL if the passed entry index is invalid.
EmberStatus emberStartActiveScan ( uint8_t channel )

Starts an active scan. EMBER_SUCCESS signals that the scan successfully started. Upon receiving a beacon, the emberIncomingBeaconHandler stack handler is called. At the end of the scanning procedure, the emberActiveScanCompleteHandler stack handler is called. Note that, while a scan can be initiated when the node is currently joined to a network, the node will generally be unable to communicate with its PAN during the scan period. In particular, time-sensitive network operations might be affected because a scan operation will prevent any network operation for the duration of the scan.

Possible error responses and their meanings:

Parameters
channel The channel to scan.
EmberStatus emberStartEnergyScan ( uint8_t channel,
uint8_t samples
)

Starts an energy scan. EMBER_SUCCESS signals that the scan successfully started. At the end of the scanning procedure the emberEnergyScanCompleteHandler stack handler is called. Note that, while a scan can be initiated when the node is currently joined to a network, the node is generally unable to communicate with its PAN during the scan period. In particular, time-sensitive network operations might be affected because a scan operation will prevent any network operation for the duration of the scan.

Possible error responses and their meanings:

Parameters
channel The channel to scan.
samples The number of energy samples to be produced. Each sample is performed averaging the detected energy over 8 symbols time (the actual length depends on the selected PHY configuration).
void emberTick ( void )

A periodic tick routine that should be called:

  • in the application's main event loop,
  • as soon as possible after any radio interrupts, and
  • after emberInit() .