Scan Dispatch#

API and Callbacks for the scan-dispatch Component.

This component allows existence of multiple consumers of the stack 802.15.4 scan results.

This plugin allows for multiple consumers of stack 802.15.4 scan callbacks.

Modules#

EmberAfPluginScanDispatchScanResults

EmberAfPluginScanDispatchScanData

API#

EmberNetworkScanType
emberAfPluginScanDispatchScanResultsGetScanType(EmberAfPluginScanDispatchScanResults *results)

Get the scan type.

bool
emberAfPluginScanDispatchScanResultsAreComplete(EmberAfPluginScanDispatchScanResults *results)

Get whether the originally requested scan has completed.

bool
emberAfPluginScanDispatchScanResultsAreFailure(EmberAfPluginScanDispatchScanResults *results)

Result in a failure.

EmberStatus
emberAfPluginScanDispatchScheduleScan(EmberAfPluginScanDispatchScanData *data)

Schedule a scan.

void

Remove all consumers in the queue.

Typedefs#

typedef void(*
EmberAfPluginScanDispatchScanResultsHandler)(EmberAfPluginScanDispatchScanResults *results)

Handle scan results.

Macros#

#define
EMBER_AF_PLUGIN_SCAN_DISPATCH_SCAN_QUEUE_SIZE 10

The size of the dispatch queue.

API Documentation#

emberAfPluginScanDispatchScanResultsGetScanType#

EmberNetworkScanType emberAfPluginScanDispatchScanResultsGetScanType (EmberAfPluginScanDispatchScanResults * results)

Get the scan type.

Parameters
TypeDirectionArgument NameDescription
EmberAfPluginScanDispatchScanResults *N/Aresults

The EmberAfPluginScanDispatchScanResults for which the scan type will be found.

Gets the scan type from an EmberAfPluginScanDispatchScanResults. This value will either be ::EMBER_ENERGY_SCAN, ::EMBER_ACTIVE_SCAN or ::EMBER_ACTIVE_SCAN_ROUTER

Returns

  • The ::EmberNetworkScanType of the scan results.


emberAfPluginScanDispatchScanResultsAreComplete#

bool emberAfPluginScanDispatchScanResultsAreComplete (EmberAfPluginScanDispatchScanResults * results)

Get whether the originally requested scan has completed.

Parameters
TypeDirectionArgument NameDescription
EmberAfPluginScanDispatchScanResults *N/Aresults

The EmberAfPluginScanDispatchScanResults that belong to a potentially complete scan.

This can happen either when the dispatcher asks the stack for a scan (see ::emberStartScan) or after all of the scan results have been delivered to the consumer (see emberAfScanCompleteCallback).

Returns

  • Indicates whether or not the scan for the scan results is complete.


emberAfPluginScanDispatchScanResultsAreFailure#

bool emberAfPluginScanDispatchScanResultsAreFailure (EmberAfPluginScanDispatchScanResults * results)

Result in a failure.

Parameters
TypeDirectionArgument NameDescription
EmberAfPluginScanDispatchScanResults *N/Aresults

The EmberAfPluginScanDispatchScanResults for which the call to ::emberStartScan may have failed.

Gets whether or not the scan results are from a failed call to ::emberStartScan.

Returns

  • Indicates whether or not the call to ::emberStartScan failed for these results.


emberAfPluginScanDispatchScheduleScan#

EmberStatus emberAfPluginScanDispatchScheduleScan (EmberAfPluginScanDispatchScanData * data)

Schedule a scan.

Parameters
TypeDirectionArgument NameDescription
EmberAfPluginScanDispatchScanData *N/Adata

An EmberAfPluginScanDispatchScanData that holds the scanType, channelMask, duration, and EmberAfPluginScanDispatchScanResultsHandler for the scan.

This API schedules an 802.15.4 scan. The results will be delivered to the consumer via a handler in the passed EmberAfPluginScanDispatchScanData.

Returns

  • An ::EmberStatus value describing the result of the scheduling of a scan.


emberAfPluginScanDispatchClear#

void emberAfPluginScanDispatchClear (void )

Remove all consumers in the queue.

Parameters
TypeDirectionArgument NameDescription
voidN/A

A call to this function will remove all consumers in the queue for scan results. It will also cancel any 802.15.4 scan that the stack is currently performing.


Typedef Documentation#

EmberAfPluginScanDispatchScanResultsHandler#

typedef void(* EmberAfPluginScanDispatchScanResultsHandler) (EmberAfPluginScanDispatchScanResults *results) )(EmberAfPluginScanDispatchScanResults *results)

Handle scan results.