![]() |
0.01.00
|
This module includes functions that control link-layer configuration. More...
Typedefs | |
typedef void(OTCALL * | otHandleActiveScanResult) (otActiveScanResult *aResult, void *aContext) |
This function pointer is called during an IEEE 802.15.4 Active Scan when an IEEE 802.15.4 Beacon is received or the scan completes. More... | |
typedef void(OTCALL * | otHandleEnergyScanResult) (otEnergyScanResult *aResult, void *aContext) |
This function pointer is called during an IEEE 802.15.4 Energy Scan when the result for a channel is ready or the scan completes. More... | |
typedef void(* | otLinkPcapCallback) (const otRadioFrame *aFrame, void *aContext) |
This function pointer is called when an IEEE 802.15.4 frame is received. More... | |
Functions | |
OTAPI otError OTCALL | otLinkActiveScan (otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, otHandleActiveScanResult aCallback, void *aCallbackContext) |
This function starts an IEEE 802.15.4 Active Scan. More... | |
OTAPI bool OTCALL | otLinkIsActiveScanInProgress (otInstance *aInstance) |
This function indicates whether or not an IEEE 802.15.4 Active Scan is currently in progress. More... | |
OTAPI otError OTCALL | otLinkEnergyScan (otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, otHandleEnergyScanResult aCallback, void *aCallbackContext) |
This function starts an IEEE 802.15.4 Energy Scan. More... | |
OTAPI bool OTCALL | otLinkIsEnergyScanInProgress (otInstance *aInstance) |
This function indicates whether or not an IEEE 802.15.4 Energy Scan is currently in progress. More... | |
OTAPI otError OTCALL | otLinkSendDataRequest (otInstance *aInstance) |
This function enqueues an IEEE 802.15.4 Data Request message for transmission. More... | |
OTAPI bool OTCALL | otLinkIsInTransmitState (otInstance *aInstance) |
This function indicates whether or not an IEEE 802.15.4 MAC is in the transmit state. More... | |
OTAPI uint8_t OTCALL | otLinkGetChannel (otInstance *aInstance) |
Get the IEEE 802.15.4 channel. More... | |
OTAPI otError OTCALL | otLinkSetChannel (otInstance *aInstance, uint8_t aChannel) |
Set the IEEE 802.15.4 channel. More... | |
OTAPI const otExtAddress *OTCALL | otLinkGetExtendedAddress (otInstance *aInstance) |
Get the IEEE 802.15.4 Extended Address. More... | |
OTAPI otError OTCALL | otLinkSetExtendedAddress (otInstance *aInstance, const otExtAddress *aExtAddress) |
This function sets the IEEE 802.15.4 Extended Address. More... | |
OTAPI void OTCALL | otLinkGetFactoryAssignedIeeeEui64 (otInstance *aInstance, otExtAddress *aEui64) |
Get the factory-assigned IEEE EUI-64. More... | |
OTAPI int8_t OTCALL | otLinkGetMaxTransmitPower (otInstance *aInstance) |
This function returns the maximum transmit power setting in dBm. More... | |
OTAPI void OTCALL | otLinkSetMaxTransmitPower (otInstance *aInstance, int8_t aPower) |
This function sets the maximum transmit power in dBm. More... | |
OTAPI otPanId OTCALL | otLinkGetPanId (otInstance *aInstance) |
Get the IEEE 802.15.4 PAN ID. More... | |
OTAPI otError OTCALL | otLinkSetPanId (otInstance *aInstance, otPanId aPanId) |
Set the IEEE 802.15.4 PAN ID. More... | |
OTAPI uint32_t OTCALL | otLinkGetPollPeriod (otInstance *aInstance) |
Get the data poll period of sleepy end device. More... | |
OTAPI void OTCALL | otLinkSetPollPeriod (otInstance *aInstance, uint32_t aPollPeriod) |
Set the data poll period for sleepy end device. More... | |
OTAPI otShortAddress OTCALL | otLinkGetShortAddress (otInstance *aInstance) |
Get the IEEE 802.15.4 Short Address. More... | |
OTAPI otMacFilterAddressMode OTCALL | otLinkFilterGetAddressMode (otInstance *aInstance) |
This function gets the address mode of MAC filter. More... | |
OTAPI otError OTCALL | otLinkFilterSetAddressMode (otInstance *aInstance, otMacFilterAddressMode aMode) |
This function sets the address mode of MAC filter. More... | |
OTAPI otError OTCALL | otLinkFilterAddAddress (otInstance *aInstance, const otExtAddress *aExtAddress) |
This method adds an Extended Address to MAC filter. More... | |
OTAPI otError OTCALL | otLinkFilterRemoveAddress (otInstance *aInstance, const otExtAddress *aExtAddress) |
This method removes an Extended Address from MAC filter. More... | |
OTAPI void OTCALL | otLinkFilterClearAddresses (otInstance *aInstance) |
This method clears all the Extended Addresses from MAC filter. More... | |
OTAPI otError OTCALL | otLinkFilterGetNextAddress (otInstance *aInstance, otMacFilterIterator *aIterator, otMacFilterEntry *aEntry) |
This method gets an in-use address filter entry. More... | |
OTAPI otError OTCALL | otLinkFilterAddRssIn (otInstance *aInstance, const otExtAddress *aExtAddress, int8_t aRss) |
This method sets the received signal strength (in dBm) for the messages from the Extended Address. More... | |
OTAPI otError OTCALL | otLinkFilterRemoveRssIn (otInstance *aInstance, const otExtAddress *aExtAddress) |
This method removes the received signal strength setting for the received messages from the Extended Address or removes the default received signal strength setting if no Extended Address is specified. More... | |
OTAPI void OTCALL | otLinkFilterClearRssIn (otInstance *aInstance) |
This method clears all the received signal strength settings. More... | |
OTAPI otError OTCALL | otLinkFilterGetNextRssIn (otInstance *aInstance, otMacFilterIterator *aIterator, otMacFilterEntry *aEntry) |
This method gets an in-use RssIn filter entry. More... | |
uint8_t | otLinkConvertRssToLinkQuality (otInstance *aInstance, int8_t aRss) |
This method converts received signal strength to link quality. More... | |
int8_t | otLinkConvertLinkQualityToRss (otInstance *aInstance, uint8_t aLinkQuality) |
This method converts link quality to typical received signal strength. More... | |
OTAPI const otMacCounters *OTCALL | otLinkGetCounters (otInstance *aInstance) |
Get the MAC layer counters. More... | |
void | otLinkSetPcapCallback (otInstance *aInstance, otLinkPcapCallback aPcapCallback, void *aCallbackContext) |
This function registers a callback to provide received raw IEEE 802.15.4 frames. More... | |
bool | otLinkIsPromiscuous (otInstance *aInstance) |
This function indicates whether or not promiscuous mode is enabled at the link layer. More... | |
otError | otLinkSetPromiscuous (otInstance *aInstance, bool aPromiscuous) |
This function enables or disables the link layer promiscuous mode. More... | |
This module includes functions that control link-layer configuration.
typedef void(OTCALL * otHandleActiveScanResult) (otActiveScanResult *aResult, void *aContext) |
This function pointer is called during an IEEE 802.15.4 Active Scan when an IEEE 802.15.4 Beacon is received or the scan completes.
[in] | aResult | A valid pointer to the beacon information or NULL when the active scan completes. |
[in] | aContext | A pointer to application-specific context. |
typedef void(OTCALL * otHandleEnergyScanResult) (otEnergyScanResult *aResult, void *aContext) |
This function pointer is called during an IEEE 802.15.4 Energy Scan when the result for a channel is ready or the scan completes.
[in] | aResult | A valid pointer to the energy scan result information or NULL when the energy scan completes. |
[in] | aContext | A pointer to application-specific context. |
typedef void(* otLinkPcapCallback) (const otRadioFrame *aFrame, void *aContext) |
This function pointer is called when an IEEE 802.15.4 frame is received.
aFrame
may not contain the actual FCS that was received.aFrame
will always be false.[in] | aFrame | A pointer to the received IEEE 802.15.4 frame. |
[in] | aContext | A pointer to application-specific context. |
OTAPI otError OTCALL otLinkActiveScan | ( | otInstance * | aInstance, |
uint32_t | aScanChannels, | ||
uint16_t | aScanDuration, | ||
otHandleActiveScanResult | aCallback, | ||
void * | aCallbackContext | ||
) |
This function starts an IEEE 802.15.4 Active Scan.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aScanChannels | A bit vector indicating which channels to scan (e.g. OT_CHANNEL_11_MASK). |
[in] | aScanDuration | The time in milliseconds to spend scanning each channel. |
[in] | aCallback | A pointer to a function called on receiving a beacon or scan completes. |
[in] | aCallbackContext | A pointer to application-specific context. |
OT_ERROR_NONE | Accepted the Active Scan request. |
OT_ERROR_BUSY | Already performing an Active Scan. |
int8_t otLinkConvertLinkQualityToRss | ( | otInstance * | aInstance, |
uint8_t | aLinkQuality | ||
) |
This method converts link quality to typical received signal strength.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aLinkQuality | LinkQuality value, should be in range [0,3]. |
aLinkQuality
. uint8_t otLinkConvertRssToLinkQuality | ( | otInstance * | aInstance, |
int8_t | aRss | ||
) |
This method converts received signal strength to link quality.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aRss | The received signal strength value to be converted. |
aRss
. OTAPI otError OTCALL otLinkEnergyScan | ( | otInstance * | aInstance, |
uint32_t | aScanChannels, | ||
uint16_t | aScanDuration, | ||
otHandleEnergyScanResult | aCallback, | ||
void * | aCallbackContext | ||
) |
This function starts an IEEE 802.15.4 Energy Scan.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aScanChannels | A bit vector indicating on which channels to perform energy scan. |
[in] | aScanDuration | The time in milliseconds to spend scanning each channel. |
[in] | aCallback | A pointer to a function called to pass on scan result on indicate scan completion. |
[in] | aCallbackContext | A pointer to application-specific context. |
OT_ERROR_NONE | Accepted the Energy Scan request. |
OT_ERROR_BUSY | Could not start the energy scan. |
OTAPI otError OTCALL otLinkFilterAddAddress | ( | otInstance * | aInstance, |
const otExtAddress * | aExtAddress | ||
) |
This method adds an Extended Address to MAC filter.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddress | A reference to the Extended Address. |
OT_ERROR_NONE | Successfully added aExtAddress to MAC filter. |
OT_ERROR_ALREADY | If aExtAddress was already in MAC filter. |
OT_ERROR_INVALID_ARGS | If aExtAddress is NULL. |
OT_ERROR_NO_BUFS | No available entry exists. |
OTAPI otError OTCALL otLinkFilterAddRssIn | ( | otInstance * | aInstance, |
const otExtAddress * | aExtAddress, | ||
int8_t | aRss | ||
) |
This method sets the received signal strength (in dBm) for the messages from the Extended Address.
The default received signal strength for all received messages would be set if no Extended Address is specified.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddress | A pointer to the IEEE 802.15.4 Extended Address, or NULL to set the default received signal strength. |
[in] | aRss | The received signal strength (in dBm) to set. |
OT_ERROR_NONE | Successfully set aRss for aExtAddress or set the default aRss for all received messages if aExtAddress is NULL. |
OT_ERROR_NO_BUFS | No available entry exists. |
OTAPI void OTCALL otLinkFilterClearAddresses | ( | otInstance * | aInstance | ) |
This method clears all the Extended Addresses from MAC filter.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI void OTCALL otLinkFilterClearRssIn | ( | otInstance * | aInstance | ) |
This method clears all the received signal strength settings.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otMacFilterAddressMode OTCALL otLinkFilterGetAddressMode | ( | otInstance * | aInstance | ) |
This function gets the address mode of MAC filter.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otError OTCALL otLinkFilterGetNextAddress | ( | otInstance * | aInstance, |
otMacFilterIterator * | aIterator, | ||
otMacFilterEntry * | aEntry | ||
) |
This method gets an in-use address filter entry.
[in] | aInstance | A pointer to an OpenThread instance. |
[in,out] | aIterator | A pointer to the MAC filter iterator context. To get the first in-use address filter entry, it should be set to OT_MAC_FILTER_ITERATOR_INIT. |
[out] | aEntry | A pointer to where the information is placed. |
OT_ERROR_NONE | Successfully retrieved an in-use address filter entry. |
OT_ERROR_INVALID_ARGS | If aIterator or aEntry is NULL. |
OT_ERROR_NOT_FOUND | No subsequent entry exists. |
OTAPI otError OTCALL otLinkFilterGetNextRssIn | ( | otInstance * | aInstance, |
otMacFilterIterator * | aIterator, | ||
otMacFilterEntry * | aEntry | ||
) |
This method gets an in-use RssIn filter entry.
[in] | aInstance | A pointer to an OpenThread instance. |
[in,out] | aIterator | A reference to the MAC filter iterator context. To get the first in-use RssIn Filter entry, it should be set to OT_MAC_FILTER_ITERATOR_INIT. |
[out] | aEntry | A reference to where the information is placed. The last entry would have the extended address as all 0xff to indicate the default received signal strength if it was set. |
OT_ERROR_NONE | Successfully retrieved an in-use RssIn Filter entry. |
OT_ERROR_INVALID_ARGS | If aIterator or aEntry is NULL. |
OT_ERROR_NOT_FOUND | No subsequent entry exists. |
OTAPI otError OTCALL otLinkFilterRemoveAddress | ( | otInstance * | aInstance, |
const otExtAddress * | aExtAddress | ||
) |
This method removes an Extended Address from MAC filter.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddress | A reference to the Extended Address. |
OT_ERROR_NONE | Successfully removed aExtAddress from MAC filter. |
OT_ERROR_INVALID_ARGS | If aExtAddress is NULL. |
OT_ERROR_NOT_FOUND | aExtAddress is not in MAC filter. |
OTAPI otError OTCALL otLinkFilterRemoveRssIn | ( | otInstance * | aInstance, |
const otExtAddress * | aExtAddress | ||
) |
This method removes the received signal strength setting for the received messages from the Extended Address or removes the default received signal strength setting if no Extended Address is specified.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddress | A pointer to the IEEE 802.15.4 Extended Address, or NULL to reset the default received signal strength. |
OT_ERROR_NONE | Successfully removed received signal strength setting for aExtAddress or removed the default received signal strength setting if aExtAddress is NULL. |
OT_ERROR_NOT_FOUND | aExtAddress is not in MAC filter if it is not NULL. |
OTAPI otError OTCALL otLinkFilterSetAddressMode | ( | otInstance * | aInstance, |
otMacFilterAddressMode | aMode | ||
) |
This function sets the address mode of MAC filter.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aMode | The address mode to set. |
OT_ERROR_NONE | Successfully set the address mode. |
OT_ERROR_INVALID_ARGS | aMode is not valid. |
OTAPI uint8_t OTCALL otLinkGetChannel | ( | otInstance * | aInstance | ) |
Get the IEEE 802.15.4 channel.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI const otMacCounters* OTCALL otLinkGetCounters | ( | otInstance * | aInstance | ) |
Get the MAC layer counters.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI const otExtAddress* OTCALL otLinkGetExtendedAddress | ( | otInstance * | aInstance | ) |
Get the IEEE 802.15.4 Extended Address.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI void OTCALL otLinkGetFactoryAssignedIeeeEui64 | ( | otInstance * | aInstance, |
otExtAddress * | aEui64 | ||
) |
Get the factory-assigned IEEE EUI-64.
[in] | aInstance | A pointer to the OpenThread instance. |
[out] | aEui64 | A pointer to where the factory-assigned IEEE EUI-64 is placed. |
OTAPI int8_t OTCALL otLinkGetMaxTransmitPower | ( | otInstance * | aInstance | ) |
This function returns the maximum transmit power setting in dBm.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otPanId OTCALL otLinkGetPanId | ( | otInstance * | aInstance | ) |
Get the IEEE 802.15.4 PAN ID.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint32_t OTCALL otLinkGetPollPeriod | ( | otInstance * | aInstance | ) |
Get the data poll period of sleepy end device.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otShortAddress OTCALL otLinkGetShortAddress | ( | otInstance * | aInstance | ) |
Get the IEEE 802.15.4 Short Address.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI bool OTCALL otLinkIsActiveScanInProgress | ( | otInstance * | aInstance | ) |
This function indicates whether or not an IEEE 802.15.4 Active Scan is currently in progress.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI bool OTCALL otLinkIsEnergyScanInProgress | ( | otInstance * | aInstance | ) |
This function indicates whether or not an IEEE 802.15.4 Energy Scan is currently in progress.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI bool OTCALL otLinkIsInTransmitState | ( | otInstance * | aInstance | ) |
This function indicates whether or not an IEEE 802.15.4 MAC is in the transmit state.
MAC module is in the transmit state during CSMA/CA procedure, CCA, Data, Beacon or Data Request frame transmission and receiving an ACK of a transmitted frame. MAC module is not in the transmit state during transmission of an ACK frame or a Beacon Request frame.
[in] | aInstance | A pointer to an OpenThread instance. |
bool otLinkIsPromiscuous | ( | otInstance * | aInstance | ) |
This function indicates whether or not promiscuous mode is enabled at the link layer.
[in] | aInstance | A pointer to an OpenThread instance. |
true | Promiscuous mode is enabled. |
false | Promiscuous mode is not enabled. |
OTAPI otError OTCALL otLinkSendDataRequest | ( | otInstance * | aInstance | ) |
This function enqueues an IEEE 802.15.4 Data Request message for transmission.
[in] | aInstance | A pointer to an OpenThread instance. |
OT_ERROR_NONE | Successfully enqueued an IEEE 802.15.4 Data Request message. |
OT_ERROR_ALREADY | An IEEE 802.15.4 Data Request message is already enqueued. |
OT_ERROR_INVALID_STATE | Device is not in rx-off-when-idle mode. |
OT_ERROR_NO_BUFS | Insufficient message buffers available. |
OTAPI otError OTCALL otLinkSetChannel | ( | otInstance * | aInstance, |
uint8_t | aChannel | ||
) |
Set the IEEE 802.15.4 channel.
This function succeeds only when Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aChannel | The IEEE 802.15.4 channel. |
OT_ERROR_NONE | Successfully set the channel. |
OT_ERROR_INVALID_ARGS | If aChnanel is not in the range [11, 26]. |
OT_ERROR_INVALID_STATE | Thread protocols are enabled. |
OTAPI otError OTCALL otLinkSetExtendedAddress | ( | otInstance * | aInstance, |
const otExtAddress * | aExtAddress | ||
) |
This function sets the IEEE 802.15.4 Extended Address.
This function succeedsm only when Thread protocols are disabled.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddress | A pointer to the IEEE 802.15.4 Extended Address. |
OT_ERROR_NONE | Successfully set the IEEE 802.15.4 Extended Address. |
OT_ERROR_INVALID_ARGS | aExtAddress was NULL. |
OT_ERROR_INVALID_STATE | Thread protocols are enabled. |
OTAPI void OTCALL otLinkSetMaxTransmitPower | ( | otInstance * | aInstance, |
int8_t | aPower | ||
) |
This function sets the maximum transmit power in dBm.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPower | The maximum transmit power in dBm. |
OTAPI otError OTCALL otLinkSetPanId | ( | otInstance * | aInstance, |
otPanId | aPanId | ||
) |
Set the IEEE 802.15.4 PAN ID.
This function succeeds only when Thread protocols are disabled. A successful call to this function also invalidates the Active and Pending Operational Datasets in non-volatile memory.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPanId | The IEEE 802.15.4 PAN ID. |
OT_ERROR_NONE | Successfully set the PAN ID. |
OT_ERROR_INVALID_ARGS | If aPanId is not in the range [0, 65534]. |
OT_ERROR_INVALID_STATE | Thread protocols are enabled. |
void otLinkSetPcapCallback | ( | otInstance * | aInstance, |
otLinkPcapCallback | aPcapCallback, | ||
void * | aCallbackContext | ||
) |
This function registers a callback to provide received raw IEEE 802.15.4 frames.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPcapCallback | A pointer to a function that is called when receiving an IEEE 802.15.4 link frame or NULL to disable the callback. |
[in] | aCallbackContext | A pointer to application-specific context. |
OTAPI void OTCALL otLinkSetPollPeriod | ( | otInstance * | aInstance, |
uint32_t | aPollPeriod | ||
) |
Set the data poll period for sleepy end device.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPollPeriod | data poll period in milliseconds. |
otError otLinkSetPromiscuous | ( | otInstance * | aInstance, |
bool | aPromiscuous | ||
) |
This function enables or disables the link layer promiscuous mode.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPromiscuous | true to enable promiscuous mode, or false otherwise. |
OT_ERROR_NONE | Successfully enabled promiscuous mode. |
OT_ERROR_INVALID_STATE | Could not enable promiscuous mode because the Thread interface is enabled. |