This module includes functions that control link-layer configuration.
More...
|
OTAPI otError OTCALL | otLinkActiveScan (otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, otHandleActiveScanResult aCallback, void *aCallbackContext) |
|
OTAPI bool OTCALL | otLinkIsActiveScanInProgress (otInstance *aInstance) |
|
OTAPI otError OTCALL | otLinkEnergyScan (otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, otHandleEnergyScanResult aCallback, void *aCallbackContext) |
|
OTAPI bool OTCALL | otLinkIsEnergyScanInProgress (otInstance *aInstance) |
|
OTAPI otError OTCALL | otLinkSendDataRequest (otInstance *aInstance) |
|
OTAPI bool OTCALL | otLinkIsInTransmitState (otInstance *aInstance) |
|
OTAPI uint8_t OTCALL | otLinkGetChannel (otInstance *aInstance) |
|
OTAPI otError OTCALL | otLinkSetChannel (otInstance *aInstance, uint8_t aChannel) |
|
OTAPI const otExtAddress *OTCALL | otLinkGetExtendedAddress (otInstance *aInstance) |
|
OTAPI otError OTCALL | otLinkSetExtendedAddress (otInstance *aInstance, const otExtAddress *aExtAddress) |
|
OTAPI void OTCALL | otLinkGetFactoryAssignedIeeeEui64 (otInstance *aInstance, otExtAddress *aEui64) |
|
OTAPI int8_t OTCALL | otLinkGetMaxTransmitPower (otInstance *aInstance) |
|
OTAPI void OTCALL | otLinkSetMaxTransmitPower (otInstance *aInstance, int8_t aPower) |
|
OTAPI otPanId OTCALL | otLinkGetPanId (otInstance *aInstance) |
|
OTAPI otError OTCALL | otLinkSetPanId (otInstance *aInstance, otPanId aPanId) |
|
OTAPI uint32_t OTCALL | otLinkGetPollPeriod (otInstance *aInstance) |
|
OTAPI void OTCALL | otLinkSetPollPeriod (otInstance *aInstance, uint32_t aPollPeriod) |
|
OTAPI otShortAddress OTCALL | otLinkGetShortAddress (otInstance *aInstance) |
|
OTAPI otMacFilterAddressMode OTCALL | otLinkFilterGetAddressMode (otInstance *aInstance) |
|
OTAPI otError OTCALL | otLinkFilterSetAddressMode (otInstance *aInstance, otMacFilterAddressMode aMode) |
|
OTAPI otError OTCALL | otLinkFilterAddAddress (otInstance *aInstance, const otExtAddress *aExtAddress) |
|
OTAPI otError OTCALL | otLinkFilterRemoveAddress (otInstance *aInstance, const otExtAddress *aExtAddress) |
|
OTAPI void OTCALL | otLinkFilterClearAddresses (otInstance *aInstance) |
|
OTAPI otError OTCALL | otLinkFilterGetNextAddress (otInstance *aInstance, otMacFilterIterator *aIterator, otMacFilterEntry *aEntry) |
|
OTAPI otError OTCALL | otLinkFilterAddRssIn (otInstance *aInstance, const otExtAddress *aExtAddress, int8_t aRss) |
|
OTAPI otError OTCALL | otLinkFilterRemoveRssIn (otInstance *aInstance, const otExtAddress *aExtAddress) |
|
OTAPI void OTCALL | otLinkFilterClearRssIn (otInstance *aInstance) |
|
OTAPI otError OTCALL | otLinkFilterGetNextRssIn (otInstance *aInstance, otMacFilterIterator *aIterator, otMacFilterEntry *aEntry) |
|
uint8_t | otLinkConvertRssToLinkQuality (otInstance *aInstance, int8_t aRss) |
|
int8_t | otLinkConvertLinkQualityToRss (otInstance *aInstance, uint8_t aLinkQuality) |
|
OTAPI const otMacCounters *OTCALL | otLinkGetCounters (otInstance *aInstance) |
|
void | otLinkSetPcapCallback (otInstance *aInstance, otLinkPcapCallback aPcapCallback, void *aCallbackContext) |
|
bool | otLinkIsPromiscuous (otInstance *aInstance) |
|
otError | otLinkSetPromiscuous (otInstance *aInstance, bool aPromiscuous) |
|
This module includes functions that control link-layer configuration.
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.
- Parameters
-
[in] | aResult | A valid pointer to the beacon information or NULL when the active scan completes. |
[in] | aContext | A pointer to application-specific context. |
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.
- Parameters
-
[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.
- Note
- This callback is called after FCS processing and
aFrame
may not contain the actual FCS that was received.
-
This callback is called before IEEE 802.15.4 security processing and mSecurityValid in
aFrame
will always be false.
- Parameters
-
[in] | aFrame | A pointer to the received IEEE 802.15.4 frame. |
[in] | aContext | A pointer to application-specific context. |
This function starts an IEEE 802.15.4 Active Scan
- Parameters
-
[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. |
- Return values
-
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.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aLinkQuality | LinkQuality value, should be in range [0,3]. |
- Returns
- Typical platform received signal strength mapping to
aLinkQuality
.
uint8_t otLinkConvertRssToLinkQuality |
( |
otInstance * |
aInstance, |
|
|
int8_t |
aRss |
|
) |
| |
This method converts received signal strength to link quality.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aRss | The received signal strength value to be converted. |
- Returns
- Link quality value mapping to
aRss
.
This function starts an IEEE 802.15.4 Energy Scan
- Parameters
-
[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. |
- Return values
-
OT_ERROR_NONE | Accepted the Energy Scan request. |
OT_ERROR_BUSY | Could not start the energy scan. |
Get the IEEE 802.15.4 channel.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- The IEEE 802.15.4 channel.
- See Also
- otLinkSetChannel
Get the MAC layer counters.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- A pointer to the MAC layer counters.
Get the IEEE 802.15.4 Extended Address.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- A pointer to the IEEE 802.15.4 Extended Address.
Get the factory-assigned IEEE EUI-64.
- Parameters
-
[in] | aInstance | A pointer to the OpenThread instance. |
[out] | aEui64 | A pointer to where the factory-assigned IEEE EUI-64 is placed. |
This function returns the maximum transmit power setting in dBm.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- The maximum transmit power setting.
Get the IEEE 802.15.4 PAN ID.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- The IEEE 802.15.4 PAN ID.
- See Also
- otLinkSetPanId
Get the data poll period of sleepy end device.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- The data poll period of sleepy end device in milliseconds.
- See Also
- otLinkSetPollPeriod
Get the IEEE 802.15.4 Short Address.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- A pointer to the IEEE 802.15.4 Short Address.
This function indicates whether or not an IEEE 802.15.4 Active Scan is currently in progress.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- true if an IEEE 802.15.4 Active Scan is in progress, false otherwise.
This function indicates whether or not an IEEE 802.15.4 Energy Scan is currently in progress.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- true if an IEEE 802.15.4 Energy Scan is in progress, false otherwise.
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.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- true if an IEEE 802.15.4 MAC is in the transmit state, false otherwise.
bool otLinkIsPromiscuous |
( |
otInstance * |
aInstance | ) |
|
This function indicates whether or not promiscuous mode is enabled at the link layer.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Return values
-
true | Promiscuous mode is enabled. |
false | Promiscuous mode is not enabled. |
This function enqueues an IEEE 802.15.4 Data Request message for transmission.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Return values
-
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. |
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.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aChannel | The IEEE 802.15.4 channel. |
- Return values
-
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. |
- See Also
- otLinkGetChannel
This function sets the IEEE 802.15.4 Extended Address.
This function succeedsm only when Thread protocols are disabled.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddress | A pointer to the IEEE 802.15.4 Extended Address. |
- Return values
-
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. |
This function sets the maximum transmit power in dBm.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPower | The maximum transmit power in dBm. |
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.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPanId | The IEEE 802.15.4 PAN ID. |
- Return values
-
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. |
- See Also
- otLinkGetPanId
This function registers a callback to provide received raw IEEE 802.15.4 frames.
- Parameters
-
[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. |
Set the data poll period for sleepy end device.
- Note
- This function updates only poll period of sleepy end device. To update child timeout the function otSetChildTimeout() shall be called.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPollPeriod | data poll period in milliseconds. |
- See Also
- otLinkGetPollPeriod
This function enables or disables the link layer promiscuous mode.
- Note
- Promiscuous mode may only be enabled when the Thread interface is disabled.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPromiscuous | true to enable promiscuous mode, or false otherwise. |
- Return values
-
OT_ERROR_NONE | Successfully enabled promiscuous mode. |
OT_ERROR_INVALID_STATE | Could not enable promiscuous mode because the Thread interface is enabled. |