Link
This module includes functions that control link-layer configuration.
Summary
Enumerations |
|
---|---|
otMacFilterAddressMode{
|
enum Defines address mode of the mac filter. |
Typedefs |
|
---|---|
otActiveScanResult
|
typedefstruct otActiveScanResult
Represents a received IEEE 802.15.4 Beacon. |
otEnergyScanResult
|
typedefstruct otEnergyScanResult
Represents an energy scan result. |
otHandleActiveScanResult)(otActiveScanResult *aResult, void *aContext)
|
typedefvoid(*
Pointer is called during an IEEE 802.15.4 Active Scan when an IEEE 802.15.4 Beacon is received or the scan completes. |
otHandleEnergyScanResult)(otEnergyScanResult *aResult, void *aContext)
|
typedefvoid(*
Pointer is called during an IEEE 802.15.4 Energy Scan when the result for a channel is ready or the scan completes. |
otLinkPcapCallback)(const otRadioFrame *aFrame, bool aIsTx, void *aContext)
|
typedefvoid(*
Pointer is called when an IEEE 802.15.4 frame is received. |
otMacCounters
|
typedefstruct otMacCounters
Represents the MAC layer counters. |
otMacFilterAddressMode
|
typedef Defines address mode of the mac filter. |
otMacFilterEntry
|
typedefstruct otMacFilterEntry
Represents a Mac Filter entry. |
otMacFilterIterator
|
typedefuint8_t
Used to iterate through mac filter entries. |
Functions |
|
---|---|
otLinkActiveScan(otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, otHandleActiveScanResult aCallback, void *aCallbackContext)
|
Starts an IEEE 802.15.4 Active Scan.
|
otLinkConvertLinkQualityToRss(otInstance *aInstance, uint8_t aLinkQuality)
|
int8_t
Converts link quality to typical received signal strength.
|
otLinkConvertRssToLinkQuality(otInstance *aInstance, int8_t aRss)
|
uint8_t
Converts received signal strength to link quality.
|
otLinkEnergyScan(otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, otHandleEnergyScanResult aCallback, void *aCallbackContext)
|
Starts an IEEE 802.15.4 Energy Scan.
|
otLinkFilterAddAddress(otInstance *aInstance, const otExtAddress *aExtAddress)
|
Adds an Extended Address to MAC filter.
|
otLinkFilterAddRssIn(otInstance *aInstance, const otExtAddress *aExtAddress, int8_t aRss)
|
Adds the specified Extended Address to the
RssIn list (or modifies an existing address in the RssIn list) and sets the received signal strength (in dBm) entry for messages from that address. |
otLinkFilterClearAddresses(otInstance *aInstance)
|
void
Clears all the Extended Addresses from MAC filter.
|
otLinkFilterClearAllRssIn(otInstance *aInstance)
|
void
Clears all the received signal strength (
rss ) and link quality indicator (lqi ) entries (including defaults) from the RssIn list. |
otLinkFilterClearDefaultRssIn(otInstance *aInstance)
|
void
Clears any previously set default received signal strength (in dBm) on MAC Filter.
|
otLinkFilterGetAddressMode(otInstance *aInstance)
|
Gets the address mode of MAC filter.
|
otLinkFilterGetNextAddress(otInstance *aInstance, otMacFilterIterator *aIterator, otMacFilterEntry *aEntry)
|
Gets an in-use address filter entry.
|
otLinkFilterGetNextRssIn(otInstance *aInstance, otMacFilterIterator *aIterator, otMacFilterEntry *aEntry)
|
Gets an in-use RssIn filter entry.
|
otLinkFilterRemoveAddress(otInstance *aInstance, const otExtAddress *aExtAddress)
|
void
Removes an Extended Address from MAC filter.
|
otLinkFilterRemoveRssIn(otInstance *aInstance, const otExtAddress *aExtAddress)
|
void
Removes the specified Extended Address from the
RssIn list. |
otLinkFilterSetAddressMode(otInstance *aInstance, otMacFilterAddressMode aMode)
|
void
Sets the address mode of MAC filter.
|
otLinkFilterSetDefaultRssIn(otInstance *aInstance, int8_t aRss)
|
void
Sets the default received signal strength (in dBm) on MAC Filter.
|
otLinkGetAlternateShortAddress(otInstance *aInstance)
|
Get the IEEE 802.15.4 alternate short address.
|
otLinkGetCcaFailureRate(otInstance *aInstance)
|
uint16_t
Returns the current CCA (Clear Channel Assessment) failure rate.
|
otLinkGetChannel(otInstance *aInstance)
|
uint8_t
Get the IEEE 802.15.4 channel.
|
otLinkGetCounters(otInstance *aInstance)
|
const otMacCounters *
Get the MAC layer counters.
|
otLinkGetCslChannel(otInstance *aInstance)
|
uint8_t
Gets the CSL channel.
|
otLinkGetCslPeriod(otInstance *aInstance)
|
uint32_t
Gets the CSL period in microseconds.
|
otLinkGetCslTimeout(otInstance *aInstance)
|
uint32_t
Gets the CSL timeout.
|
otLinkGetExtendedAddress(otInstance *aInstance)
|
const otExtAddress *
Gets the IEEE 802.15.4 Extended Address.
|
otLinkGetFactoryAssignedIeeeEui64(otInstance *aInstance, otExtAddress *aEui64)
|
void
Get the factory-assigned IEEE EUI-64.
|
otLinkGetFrameCounter(otInstance *aInstance)
|
uint32_t
Gets the current MAC frame counter value.
|
otLinkGetMaxFrameRetriesDirect(otInstance *aInstance)
|
uint8_t
Returns the maximum number of frame retries during direct transmission.
|
otLinkGetMaxFrameRetriesIndirect(otInstance *aInstance)
|
uint8_t
Returns the maximum number of frame retries during indirect transmission.
|
otLinkGetPanId(otInstance *aInstance)
|
Get the IEEE 802.15.4 PAN ID.
|
otLinkGetPollPeriod(otInstance *aInstance)
|
uint32_t
Get the data poll period of sleepy end device.
|
otLinkGetRegion(otInstance *aInstance, uint16_t *aRegionCode)
|
Get the region code.
|
otLinkGetShortAddress(otInstance *aInstance)
|
Get the IEEE 802.15.4 Short Address.
|
otLinkGetSupportedChannelMask(otInstance *aInstance)
|
uint32_t
Get the supported channel mask of MAC layer.
|
otLinkGetTxDirectRetrySuccessHistogram(otInstance *aInstance, uint8_t *aNumberOfEntries)
|
const uint32_t *
Gets histogram of retries for a single direct packet until success.
|
otLinkGetTxIndirectRetrySuccessHistogram(otInstance *aInstance, uint8_t *aNumberOfEntries)
|
const uint32_t *
Gets histogram of retries for a single indirect packet until success.
|
otLinkGetWakeupChannel(otInstance *aInstance)
|
uint8_t
Gets the Wake-up channel.
|
otLinkGetWakeupListenParameters(otInstance *aInstance, uint32_t *aInterval, uint32_t *aDuration)
|
void
Get the wake-up listen parameters.
|
otLinkIsActiveScanInProgress(otInstance *aInstance)
|
bool
Indicates whether or not an IEEE 802.15.4 Active Scan is currently in progress.
|
otLinkIsCslEnabled(otInstance *aInstance)
|
bool
Indicates whether or not CSL is enabled.
|
otLinkIsCslSupported(otInstance *aInstance)
|
bool
Indicates whether the device is connected to a parent which supports CSL.
|
otLinkIsEnabled(otInstance *aInstance)
|
bool
Indicates whether or not the link layer is enabled.
|
otLinkIsEnergyScanInProgress(otInstance *aInstance)
|
bool
Indicates whether or not an IEEE 802.15.4 Energy Scan is currently in progress.
|
otLinkIsInTransmitState(otInstance *aInstance)
|
bool
Indicates whether or not an IEEE 802.15.4 MAC is in the transmit state.
|
otLinkIsPromiscuous(otInstance *aInstance)
|
bool
Indicates whether or not promiscuous mode is enabled at the link layer.
|
otLinkIsRadioFilterEnabled(otInstance *aInstance)
|
bool
Indicates whether the IEEE 802.15.4 radio filter is enabled or not.
|
otLinkIsWakeupListenEnabled(otInstance *aInstance)
|
bool
Returns whether listening for wake-up frames is enabled.
|
otLinkResetCounters(otInstance *aInstance)
|
void
Resets the MAC layer counters.
|
otLinkResetTxRetrySuccessHistogram(otInstance *aInstance)
|
void
Clears histogram statistics for direct and indirect transmissions.
|
otLinkSendDataRequest(otInstance *aInstance)
|
Enqueues an IEEE 802.15.4 Data Request message for transmission.
|
otLinkSendEmptyData(otInstance *aInstance)
|
Instructs the device to send an empty IEEE 802.15.4 data frame.
|
otLinkSetChannel(otInstance *aInstance, uint8_t aChannel)
|
Set the IEEE 802.15.4 channel.
|
otLinkSetCslChannel(otInstance *aInstance, uint8_t aChannel)
|
Sets the CSL channel.
|
otLinkSetCslPeriod(otInstance *aInstance, uint32_t aPeriod)
|
Sets the CSL period in microseconds.
|
otLinkSetCslTimeout(otInstance *aInstance, uint32_t aTimeout)
|
Sets the CSL timeout in seconds.
|
otLinkSetEnabled(otInstance *aInstance, bool aEnable)
|
Enables or disables the link layer.
|
otLinkSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtAddress)
|
Sets the IEEE 802.15.4 Extended Address.
|
otLinkSetMaxFrameRetriesDirect(otInstance *aInstance, uint8_t aMaxFrameRetriesDirect)
|
void
Sets the maximum number of frame retries during direct transmission.
|
otLinkSetMaxFrameRetriesIndirect(otInstance *aInstance, uint8_t aMaxFrameRetriesIndirect)
|
void
Sets the maximum number of frame retries during indirect transmission.
|
otLinkSetPanId(otInstance *aInstance, otPanId aPanId)
|
Set the IEEE 802.15.4 PAN ID.
|
otLinkSetPcapCallback(otInstance *aInstance, otLinkPcapCallback aPcapCallback, void *aCallbackContext)
|
void
Registers a callback to provide received raw IEEE 802.15.4 frames.
|
otLinkSetPollPeriod(otInstance *aInstance, uint32_t aPollPeriod)
|
Set/clear user-specified/external data poll period for sleepy end device.
|
otLinkSetPromiscuous(otInstance *aInstance, bool aPromiscuous)
|
Enables or disables the link layer promiscuous mode.
|
otLinkSetRadioFilterEnabled(otInstance *aInstance, bool aFilterEnabled)
|
void
Enables/disables IEEE 802.15.4 radio filter mode.
|
otLinkSetRegion(otInstance *aInstance, uint16_t aRegionCode)
|
Sets the region code.
|
otLinkSetRxOnWhenIdle(otInstance *aInstance, bool aRxOnWhenIdle)
|
Sets the rx-on-when-idle state.
|
otLinkSetSupportedChannelMask(otInstance *aInstance, uint32_t aChannelMask)
|
Set the supported channel mask of MAC layer.
|
otLinkSetWakeUpListenEnabled(otInstance *aInstance, bool aEnable)
|
Enables or disables listening for wake-up frames.
|
otLinkSetWakeupChannel(otInstance *aInstance, uint8_t aChannel)
|
Sets the Wake-up channel.
|
otLinkSetWakeupListenParameters(otInstance *aInstance, uint32_t aInterval, uint32_t aDuration)
|
Set the wake-up listen parameters.
|
Macros |
|
---|---|
OT_LINK_CSL_PERIOD_TEN_SYMBOLS_UNIT_IN_USEC (160)
|
Represents CSL period ten symbols unit in microseconds.
|
OT_MAC_FILTER_FIXED_RSS_DISABLED 127
|
Used to indicate no fixed received signal strength was set.
|
OT_MAC_FILTER_ITERATOR_INIT 0
|
Initializer for otMacFilterIterator.
|
OT_US_PER_TEN_SYMBOLS OT_RADIO_TEN_SYMBOLS_TIME
|
Time for 10 symbols in units of microseconds.
|
Structs |
|
---|---|
otActiveScanResult |
Represents a received IEEE 802.15.4 Beacon. |
otEnergyScanResult |
Represents an energy scan result. |
otMacCounters |
Represents the MAC layer counters. |
otMacFilterEntry |
Represents a Mac Filter entry. |
Enumerations
otMacFilterAddressMode
otMacFilterAddressMode
Typedefs
otActiveScanResult
struct otActiveScanResult otActiveScanResult
Represents a received IEEE 802.15.4 Beacon.
otHandleActiveScanResult
void(* otHandleActiveScanResult)(otActiveScanResult *aResult, void *aContext)
Pointer is called during an IEEE 802.15.4 Active Scan when an IEEE 802.15.4 Beacon is received or the scan completes.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otHandleEnergyScanResult
void(* otHandleEnergyScanResult)(otEnergyScanResult *aResult, void *aContext)
Pointer is called during an IEEE 802.15.4 Energy Scan when the result for a channel is ready or the scan completes.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otLinkPcapCallback
void(* otLinkPcapCallback)(const otRadioFrame *aFrame, bool aIsTx, void *aContext)
Pointer is called when an IEEE 802.15.4 frame is received.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otMacFilterAddressMode
enum otMacFilterAddressMode otMacFilterAddressMode
Defines address mode of the mac filter.
otMacFilterIterator
uint8_t otMacFilterIterator
Used to iterate through mac filter entries.
Functions
otLinkActiveScan
otError otLinkActiveScan( otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, otHandleActiveScanResult aCallback, void *aCallbackContext )
Starts an IEEE 802.15.4 Active Scan.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
otLinkConvertLinkQualityToRss
int8_t otLinkConvertLinkQualityToRss( otInstance *aInstance, uint8_t aLinkQuality )
Converts link quality to typical received signal strength.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Typical platform received signal strength mapping to
aLinkQuality . |
otLinkConvertRssToLinkQuality
uint8_t otLinkConvertRssToLinkQuality( otInstance *aInstance, int8_t aRss )
Converts received signal strength to link quality.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Link quality value mapping to
aRss . |
otLinkEnergyScan
otError otLinkEnergyScan( otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, otHandleEnergyScanResult aCallback, void *aCallbackContext )
Starts an IEEE 802.15.4 Energy Scan.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
otLinkFilterAddAddress
otError otLinkFilterAddAddress( otInstance *aInstance, const otExtAddress *aExtAddress )
Adds an Extended Address to MAC filter.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkFilterAddRssIn
otError otLinkFilterAddRssIn( otInstance *aInstance, const otExtAddress *aExtAddress, int8_t aRss )
Adds the specified Extended Address to the RssIn
list (or modifies an existing address in the RssIn
list) and sets the received signal strength (in dBm) entry for messages from that address.
The Extended Address does not necessarily have to be in the address allowlist/denylist
filter to set the rss
.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkFilterClearAddresses
void otLinkFilterClearAddresses( otInstance *aInstance )
Clears all the Extended Addresses from MAC filter.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
Details | |||
---|---|---|---|
Parameters |
|
otLinkFilterClearAllRssIn
void otLinkFilterClearAllRssIn( otInstance *aInstance )
Clears all the received signal strength (rss
) and link quality indicator (lqi
) entries (including defaults) from the RssIn
list.
Performing this action means that all Extended Addresses will use the on-air signal.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
Details | |||
---|---|---|---|
Parameters |
|
otLinkFilterClearDefaultRssIn
void otLinkFilterClearDefaultRssIn( otInstance *aInstance )
Clears any previously set default received signal strength (in dBm) on MAC Filter.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
Details | |||
---|---|---|---|
Parameters |
|
otLinkFilterGetAddressMode
otMacFilterAddressMode otLinkFilterGetAddressMode( otInstance *aInstance )
Gets the address mode of MAC filter.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
the address mode.
|
otLinkFilterGetNextAddress
otError otLinkFilterGetNextAddress( otInstance *aInstance, otMacFilterIterator *aIterator, otMacFilterEntry *aEntry )
Gets an in-use address filter entry.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkFilterGetNextRssIn
otError otLinkFilterGetNextRssIn( otInstance *aInstance, otMacFilterIterator *aIterator, otMacFilterEntry *aEntry )
Gets an in-use RssIn filter entry.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkFilterRemoveAddress
void otLinkFilterRemoveAddress( otInstance *aInstance, const otExtAddress *aExtAddress )
Removes an Extended Address from MAC filter.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
No action is performed if there is no existing entry in Filter matching the given Extended Address.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otLinkFilterRemoveRssIn
void otLinkFilterRemoveRssIn( otInstance *aInstance, const otExtAddress *aExtAddress )
Removes the specified Extended Address from the RssIn
list.
Once removed from the RssIn
list, this MAC address will instead use the default rss
and lqi
settings, assuming defaults have been set. (If no defaults have been set, the over-air signal is used.)
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
No action is performed if there is no existing entry in the RssIn
list matching the specified Extended Address.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otLinkFilterSetAddressMode
void otLinkFilterSetAddressMode( otInstance *aInstance, otMacFilterAddressMode aMode )
Sets the address mode of MAC filter.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otLinkFilterSetDefaultRssIn
void otLinkFilterSetDefaultRssIn( otInstance *aInstance, int8_t aRss )
Sets the default received signal strength (in dBm) on MAC Filter.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
The default RSS value is used for all received frames from addresses for which there is no explicit RSS-IN entry in the Filter list (added using otLinkFilterAddRssIn()
).
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otLinkGetAlternateShortAddress
otShortAddress otLinkGetAlternateShortAddress( otInstance *aInstance )
Get the IEEE 802.15.4 alternate short address.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The alternate short address, or
OT_RADIO_INVALID_SHORT_ADDR (0xfffe) if there is no alternate address. |
otLinkGetCcaFailureRate
uint16_t otLinkGetCcaFailureRate( otInstance *aInstance )
Returns the current CCA (Clear Channel Assessment) failure rate.
The rate is maintained over a window of (roughly) last OPENTHREAD_CONFIG_CCA_FAILURE_RATE_AVERAGING_WINDOW
frame transmissions.
Details | |
---|---|
Returns |
The CCA failure rate with maximum value
0xffff corresponding to 100% failure rate. |
otLinkGetChannel
uint8_t otLinkGetChannel( otInstance *aInstance )
Get the IEEE 802.15.4 channel.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The IEEE 802.15.4 channel.
|
otLinkSetChannel
otLinkGetCounters
const otMacCounters * otLinkGetCounters( otInstance *aInstance )
Get the MAC layer counters.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to the MAC layer counters.
|
otLinkGetCslChannel
uint8_t otLinkGetCslChannel( otInstance *aInstance )
Gets the CSL channel.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The CSL channel.
|
otLinkGetCslPeriod
uint32_t otLinkGetCslPeriod( otInstance *aInstance )
Gets the CSL period in microseconds.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The CSL period in microseconds.
|
otLinkGetCslTimeout
uint32_t otLinkGetCslTimeout( otInstance *aInstance )
Gets the CSL timeout.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The CSL timeout in seconds.
|
otLinkGetExtendedAddress
const otExtAddress * otLinkGetExtendedAddress( otInstance *aInstance )
Gets the IEEE 802.15.4 Extended Address.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to the IEEE 802.15.4 Extended Address.
|
otLinkGetFactoryAssignedIeeeEui64
void otLinkGetFactoryAssignedIeeeEui64( otInstance *aInstance, otExtAddress *aEui64 )
Get the factory-assigned IEEE EUI-64.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otLinkGetFrameCounter
uint32_t otLinkGetFrameCounter( otInstance *aInstance )
Gets the current MAC frame counter value.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The current MAC frame counter value.
|
otLinkGetMaxFrameRetriesDirect
uint8_t otLinkGetMaxFrameRetriesDirect( otInstance *aInstance )
Returns the maximum number of frame retries during direct transmission.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The maximum number of retries during direct transmission.
|
otLinkGetMaxFrameRetriesIndirect
uint8_t otLinkGetMaxFrameRetriesIndirect( otInstance *aInstance )
Returns the maximum number of frame retries during indirect transmission.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The maximum number of retries during indirect transmission.
|
otLinkGetPanId
otPanId otLinkGetPanId( otInstance *aInstance )
Get the IEEE 802.15.4 PAN ID.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The IEEE 802.15.4 PAN ID.
|
otLinkSetPanId
otLinkGetPollPeriod
uint32_t otLinkGetPollPeriod( otInstance *aInstance )
Get the data poll period of sleepy end device.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The data poll period of sleepy end device in milliseconds.
|
otLinkSetPollPeriod
otLinkGetRegion
otError otLinkGetRegion( otInstance *aInstance, uint16_t *aRegionCode )
Get the region code.
The radio region format is the 2-bytes ascii representation of the ISO 3166 alpha-2 code.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otLinkGetShortAddress
otShortAddress otLinkGetShortAddress( otInstance *aInstance )
Get the IEEE 802.15.4 Short Address.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The IEEE 802.15.4 Short Address.
|
otLinkGetSupportedChannelMask
uint32_t otLinkGetSupportedChannelMask( otInstance *aInstance )
Get the supported channel mask of MAC layer.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The supported channel mask as
uint32_t with bit 0 (lsb) mapping to channel 0, bit 1 to channel 1, so on. |
otLinkGetTxDirectRetrySuccessHistogram
const uint32_t * otLinkGetTxDirectRetrySuccessHistogram( otInstance *aInstance, uint8_t *aNumberOfEntries )
Gets histogram of retries for a single direct packet until success.
Is valid when OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE configuration is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A pointer to the histogram of retries (in a form of an array). The n-th element indicates that the packet has been sent with n-th retry.
|
otLinkGetTxIndirectRetrySuccessHistogram
const uint32_t * otLinkGetTxIndirectRetrySuccessHistogram( otInstance *aInstance, uint8_t *aNumberOfEntries )
Gets histogram of retries for a single indirect packet until success.
Is valid when OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE configuration is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A pointer to the histogram of retries (in a form of an array). The n-th element indicates that the packet has been sent with n-th retry.
|
otLinkGetWakeupChannel
uint8_t otLinkGetWakeupChannel( otInstance *aInstance )
Gets the Wake-up channel.
Requires OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
or OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The Wake-up channel.
|
otLinkGetWakeupListenParameters
void otLinkGetWakeupListenParameters( otInstance *aInstance, uint32_t *aInterval, uint32_t *aDuration )
Get the wake-up listen parameters.
Requires OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otLinkIsActiveScanInProgress
bool otLinkIsActiveScanInProgress( otInstance *aInstance )
Indicates whether or not an IEEE 802.15.4 Active Scan is currently in progress.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
true if an IEEE 802.15.4 Active Scan is in progress, false otherwise.
|
otLinkIsCslEnabled
bool otLinkIsCslEnabled( otInstance *aInstance )
Indicates whether or not CSL is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkIsCslSupported
bool otLinkIsCslSupported( otInstance *aInstance )
Indicates whether the device is connected to a parent which supports CSL.
Details | |||||
---|---|---|---|---|---|
Return Values |
|
otLinkIsEnabled
bool otLinkIsEnabled( otInstance *aInstance )
Indicates whether or not the link layer is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkIsEnergyScanInProgress
bool otLinkIsEnergyScanInProgress( otInstance *aInstance )
Indicates whether or not an IEEE 802.15.4 Energy Scan is currently in progress.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
true if an IEEE 802.15.4 Energy Scan is in progress, false otherwise.
|
otLinkIsInTransmitState
bool otLinkIsInTransmitState( otInstance *aInstance )
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.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
true if an IEEE 802.15.4 MAC is in the transmit state, false otherwise.
|
otLinkIsPromiscuous
bool otLinkIsPromiscuous( otInstance *aInstance )
Indicates whether or not promiscuous mode is enabled at the link layer.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkIsRadioFilterEnabled
bool otLinkIsRadioFilterEnabled( otInstance *aInstance )
Indicates whether the IEEE 802.15.4 radio filter is enabled or not.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
Details | |||||
---|---|---|---|---|---|
Return Values |
|
otLinkIsWakeupListenEnabled
bool otLinkIsWakeupListenEnabled( otInstance *aInstance )
Returns whether listening for wake-up frames is enabled.
Requires OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkResetCounters
void otLinkResetCounters( otInstance *aInstance )
Resets the MAC layer counters.
Details | |||
---|---|---|---|
Parameters |
|
otLinkResetTxRetrySuccessHistogram
void otLinkResetTxRetrySuccessHistogram( otInstance *aInstance )
Clears histogram statistics for direct and indirect transmissions.
Is valid when OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE configuration is enabled.
Details | |||
---|---|---|---|
Parameters |
|
otLinkSendDataRequest
otError otLinkSendDataRequest( otInstance *aInstance )
Enqueues an IEEE 802.15.4 Data Request message for transmission.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkSendEmptyData
otError otLinkSendEmptyData( otInstance *aInstance )
Instructs the device to send an empty IEEE 802.15.4 data frame.
Is only supported on an Rx-Off-When-Idle device to send an empty data frame to its parent. Note: available only when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
is enabled.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkSetChannel
otError otLinkSetChannel( otInstance *aInstance, uint8_t aChannel )
Set the IEEE 802.15.4 channel.
Succeeds only when Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkGetChannel
otLinkSetCslChannel
otError otLinkSetCslChannel( otInstance *aInstance, uint8_t aChannel )
Sets the CSL channel.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkSetCslPeriod
otError otLinkSetCslPeriod( otInstance *aInstance, uint32_t aPeriod )
Sets the CSL period in microseconds.
Disable CSL by setting this parameter to 0
.
The CSL period MUST be a multiple of OT_LINK_CSL_PERIOD_TEN_SYMBOLS_UNIT_IN_USEC
, otherwise OT_ERROR_INVALID_ARGS
is returned.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkSetCslTimeout
otError otLinkSetCslTimeout( otInstance *aInstance, uint32_t aTimeout )
Sets the CSL timeout in seconds.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkSetEnabled
otError otLinkSetEnabled( otInstance *aInstance, bool aEnable )
Enables or disables the link layer.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkSetExtendedAddress
otError otLinkSetExtendedAddress( otInstance *aInstance, const otExtAddress *aExtAddress )
Sets the IEEE 802.15.4 Extended Address.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkSetMaxFrameRetriesDirect
void otLinkSetMaxFrameRetriesDirect( otInstance *aInstance, uint8_t aMaxFrameRetriesDirect )
Sets the maximum number of frame retries during direct transmission.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otLinkSetMaxFrameRetriesIndirect
void otLinkSetMaxFrameRetriesIndirect( otInstance *aInstance, uint8_t aMaxFrameRetriesIndirect )
Sets the maximum number of frame retries during indirect transmission.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otLinkSetPanId
otError otLinkSetPanId( otInstance *aInstance, otPanId aPanId )
Set the IEEE 802.15.4 PAN ID.
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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkGetPanId
otLinkSetPcapCallback
void otLinkSetPcapCallback( otInstance *aInstance, otLinkPcapCallback aPcapCallback, void *aCallbackContext )
Registers a callback to provide received raw IEEE 802.15.4 frames.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otLinkSetPollPeriod
otError otLinkSetPollPeriod( otInstance *aInstance, uint32_t aPollPeriod )
Set/clear user-specified/external data poll period for sleepy end device.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkGetPollPeriod
otLinkSetPromiscuous
otError otLinkSetPromiscuous( otInstance *aInstance, bool aPromiscuous )
Enables or disables the link layer promiscuous mode.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkSetRadioFilterEnabled
void otLinkSetRadioFilterEnabled( otInstance *aInstance, bool aFilterEnabled )
Enables/disables IEEE 802.15.4 radio filter mode.
Is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
configuration is enabled.
The radio filter is mainly intended for testing. It can be used to temporarily block all tx/rx on the 802.15.4 radio. When radio filter is enabled, radio is put to sleep instead of receive (to ensure device does not receive any frame and/or potentially send ack). Also the frame transmission requests return immediately without sending the frame over the air (return "no ack" error if ack is requested, otherwise return success).
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otLinkSetRegion
otError otLinkSetRegion( otInstance *aInstance, uint16_t aRegionCode )
Sets the region code.
The radio region format is the 2-bytes ascii representation of the ISO 3166 alpha-2 code.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkSetRxOnWhenIdle
otError otLinkSetRxOnWhenIdle( otInstance *aInstance, bool aRxOnWhenIdle )
Sets the rx-on-when-idle state.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkSetSupportedChannelMask
otError otLinkSetSupportedChannelMask( otInstance *aInstance, uint32_t aChannelMask )
Set the supported channel mask of MAC layer.
Succeeds only when Thread protocols are disabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkSetWakeUpListenEnabled
otError otLinkSetWakeUpListenEnabled( otInstance *aInstance, bool aEnable )
Enables or disables listening for wake-up frames.
Requires OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkSetWakeupChannel
otError otLinkSetWakeupChannel( otInstance *aInstance, uint8_t aChannel )
Sets the Wake-up channel.
Requires OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE
or OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkSetWakeupListenParameters
otError otLinkSetWakeupListenParameters( otInstance *aInstance, uint32_t aInterval, uint32_t aDuration )
Set the wake-up listen parameters.
The listen interval must be greater than the listen duration. The listen duration must be greater or equal than the minimum supported.
Requires OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
Macros
OT_LINK_CSL_PERIOD_TEN_SYMBOLS_UNIT_IN_USEC
OT_LINK_CSL_PERIOD_TEN_SYMBOLS_UNIT_IN_USEC (160)
Represents CSL period ten symbols unit in microseconds.
The CSL period (in micro seconds) MUST be a multiple of this value.
OT_MAC_FILTER_FIXED_RSS_DISABLED
OT_MAC_FILTER_FIXED_RSS_DISABLED 127
Used to indicate no fixed received signal strength was set.
OT_MAC_FILTER_ITERATOR_INIT
OT_MAC_FILTER_ITERATOR_INIT 0
Initializer for otMacFilterIterator.
OT_US_PER_TEN_SYMBOLS
OT_US_PER_TEN_SYMBOLS OT_RADIO_TEN_SYMBOLS_TIME
Time for 10 symbols in units of microseconds.
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.