Raw Link
This module includes functions that control the raw link-layer configuration.
Summary
Typedefs |
|
---|---|
otLinkRawEnergyScanDone)(otInstance *aInstance, int8_t aEnergyScanMaxRssi)
|
typedefvoid(*
Pointer on receipt of a IEEE 802.15.4 frame. |
otLinkRawReceiveDone)(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
typedefvoid(*
Pointer on receipt of a IEEE 802.15.4 frame. |
otLinkRawTransmitDone)(otInstance *aInstance, otRadioFrame *aFrame, otRadioFrame *aAckFrame, otError aError)
|
typedefvoid(*
Pointer on receipt of a IEEE 802.15.4 frame. |
Functions |
|
---|---|
otLinkRawEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration, otLinkRawEnergyScanDone aCallback)
|
Begins the energy scan sequence on the radio.
|
otLinkRawGetCaps(otInstance *aInstance)
|
Get the radio capabilities.
|
otLinkRawGetPromiscuous(otInstance *aInstance)
|
bool
Gets the status of promiscuous mode.
|
otLinkRawGetRadioTime(otInstance *aInstance)
|
uint64_t
Get current platform time (64bits width) of the radio chip.
|
otLinkRawGetRssi(otInstance *aInstance)
|
int8_t
Get the most recent RSSI measurement.
|
otLinkRawGetTransmitBuffer(otInstance *aInstance)
|
The radio transitions from Transmit to Receive.
|
otLinkRawIsEnabled(otInstance *aInstance)
|
bool
Indicates whether or not the raw link-layer is enabled.
|
otLinkRawReceive(otInstance *aInstance)
|
Transitioning the radio from Sleep to Receive.
|
otLinkRawSetAlternateShortAddress(otInstance *aInstance, otShortAddress aShortAddress)
|
Set the alternate short address.
|
otLinkRawSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCounter)
|
Sets the current MAC frame counter value.
|
otLinkRawSetMacFrameCounterIfLarger(otInstance *aInstance, uint32_t aMacFrameCounter)
|
Sets the current MAC frame counter value only if the new value is larger than the current one.
|
otLinkRawSetMacKey(otInstance *aInstance, uint8_t aKeyIdMode, uint8_t aKeyId, const otMacKey *aPrevKey, const otMacKey *aCurrKey, const otMacKey *aNextKey)
|
Update MAC keys and key index.
|
otLinkRawSetPromiscuous(otInstance *aInstance, bool aEnable)
|
Enables or disables promiscuous mode.
|
otLinkRawSetReceiveDone(otInstance *aInstance, otLinkRawReceiveDone aCallback)
|
Enables/disables the raw link-layer.
|
otLinkRawSetShortAddress(otInstance *aInstance, uint16_t aShortAddress)
|
Set the Short Address for address filtering.
|
otLinkRawSleep(otInstance *aInstance)
|
Transition the radio from Receive to Sleep.
|
otLinkRawSrcMatchAddExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
Adding extended address to the source match table.
|
otLinkRawSrcMatchAddShortEntry(otInstance *aInstance, uint16_t aShortAddress)
|
Adding short address to the source match table.
|
otLinkRawSrcMatchClearExtEntries(otInstance *aInstance)
|
Removing all the extended addresses from the source match table.
|
otLinkRawSrcMatchClearExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
Removing extended address to the source match table of the radio.
|
otLinkRawSrcMatchClearShortEntries(otInstance *aInstance)
|
Removing all the short addresses from the source match table.
|
otLinkRawSrcMatchClearShortEntry(otInstance *aInstance, uint16_t aShortAddress)
|
Removing short address to the source match table.
|
otLinkRawSrcMatchEnable(otInstance *aInstance, bool aEnable)
|
Enable/Disable source match for frame pending.
|
otLinkRawTransmit(otInstance *aInstance, otLinkRawTransmitDone aCallback)
|
Begins the transmit sequence on the radio.
|
Typedefs
otLinkRawEnergyScanDone
void(* otLinkRawEnergyScanDone)(otInstance *aInstance, int8_t aEnergyScanMaxRssi)
Pointer on receipt of a IEEE 802.15.4 frame.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otLinkRawReceiveDone
void(* otLinkRawReceiveDone)(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
Pointer on receipt of a IEEE 802.15.4 frame.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otLinkRawTransmitDone
void(* otLinkRawTransmitDone)(otInstance *aInstance, otRadioFrame *aFrame, otRadioFrame *aAckFrame, otError aError)
Pointer on receipt of a IEEE 802.15.4 frame.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
Functions
otLinkRawEnergyScan
otError otLinkRawEnergyScan( otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration, otLinkRawEnergyScanDone aCallback )
Begins the energy scan sequence on the radio.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otLinkRawGetCaps
otRadioCaps otLinkRawGetCaps( otInstance *aInstance )
Get the radio capabilities.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The radio capability bit vector. The stack enables or disables some functions based on this value.
|
otLinkRawGetPromiscuous
bool otLinkRawGetPromiscuous( otInstance *aInstance )
Gets the status of promiscuous mode.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkRawGetRadioTime
uint64_t otLinkRawGetRadioTime( otInstance *aInstance )
Get current platform time (64bits width) of the radio chip.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The current radio time in microseconds.
|
otLinkRawGetRssi
int8_t otLinkRawGetRssi( otInstance *aInstance )
Get the most recent RSSI measurement.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The RSSI in dBm when it is valid. 127 when RSSI is invalid.
|
otLinkRawGetTransmitBuffer
otRadioFrame * otLinkRawGetTransmitBuffer( otInstance *aInstance )
The radio transitions from Transmit to Receive.
Returns a pointer to the transmit buffer.
The caller forms the IEEE 802.15.4 frame in this buffer then calls otLinkRawTransmit() to request transmission.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to the transmit buffer or NULL if the raw link-layer isn't enabled.
|
otLinkRawIsEnabled
bool otLinkRawIsEnabled( otInstance *aInstance )
Indicates whether or not the raw link-layer is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkRawReceive
otError otLinkRawReceive( otInstance *aInstance )
Transitioning the radio from Sleep to Receive.
Turn on the radio.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkRawSetAlternateShortAddress
otError otLinkRawSetAlternateShortAddress( otInstance *aInstance, otShortAddress aShortAddress )
Set the alternate short address.
This is an optional API. Support for this is indicated by including the capability OT_RADIO_CAPS_ALT_SHORT_ADDR
in otLinkRawGetCaps()
.
When supported, the radio will accept received frames destined to the specified alternate short address in addition to the short address provided in otLinkRawSetShortAddress()
.
The aShortAddress
can be set to OT_RADIO_INVALID_SHORT_ADDR
(0xfffe) to clear any previously set alternate short address.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkRawSetMacFrameCounter
otError otLinkRawSetMacFrameCounter( otInstance *aInstance, uint32_t aMacFrameCounter )
Sets the current MAC frame counter value.
Always sets the MAC counter to the new given value aMacFrameCounter
independent of the current value.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkRawSetMacFrameCounterIfLarger
otError otLinkRawSetMacFrameCounterIfLarger( otInstance *aInstance, uint32_t aMacFrameCounter )
Sets the current MAC frame counter value only if the new value is larger than the current one.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkRawSetMacKey
otError otLinkRawSetMacKey( otInstance *aInstance, uint8_t aKeyIdMode, uint8_t aKeyId, const otMacKey *aPrevKey, const otMacKey *aCurrKey, const otMacKey *aNextKey )
Update MAC keys and key index.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|
otLinkRawSetPromiscuous
otError otLinkRawSetPromiscuous( otInstance *aInstance, bool aEnable )
Enables or disables promiscuous mode.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkRawSetReceiveDone
otError otLinkRawSetReceiveDone( otInstance *aInstance, otLinkRawReceiveDone aCallback )
Enables/disables the raw link-layer.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkRawSetShortAddress
otError otLinkRawSetShortAddress( otInstance *aInstance, uint16_t aShortAddress )
Set the Short Address for address filtering.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkRawSleep
otError otLinkRawSleep( otInstance *aInstance )
Transition the radio from Receive to Sleep.
Turn off the radio.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkRawSrcMatchAddExtEntry
otError otLinkRawSrcMatchAddExtEntry( otInstance *aInstance, const otExtAddress *aExtAddress )
Adding extended address to the source match table.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkRawSrcMatchAddShortEntry
otError otLinkRawSrcMatchAddShortEntry( otInstance *aInstance, uint16_t aShortAddress )
Adding short address to the source match table.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkRawSrcMatchClearExtEntries
otError otLinkRawSrcMatchClearExtEntries( otInstance *aInstance )
Removing all the extended addresses from the source match table.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkRawSrcMatchClearExtEntry
otError otLinkRawSrcMatchClearExtEntry( otInstance *aInstance, const otExtAddress *aExtAddress )
Removing extended address to the source match table of the radio.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkRawSrcMatchClearShortEntries
otError otLinkRawSrcMatchClearShortEntries( otInstance *aInstance )
Removing all the short addresses from the source match table.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkRawSrcMatchClearShortEntry
otError otLinkRawSrcMatchClearShortEntry( otInstance *aInstance, uint16_t aShortAddress )
Removing short address to the source match table.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otLinkRawSrcMatchEnable
otError otLinkRawSrcMatchEnable( otInstance *aInstance, bool aEnable )
Enable/Disable source match for frame pending.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otLinkRawTransmit
otError otLinkRawTransmit( otInstance *aInstance, otLinkRawTransmitDone aCallback )
Begins the transmit sequence on the radio.
The caller must form the IEEE 802.15.4 frame in the buffer provided by otLinkRawGetTransmitBuffer() before requesting transmission. The channel and transmit power are also included in the otRadioFrame structure.
The transmit sequence consists of:
- Transitioning the radio to Transmit from Receive.
- Transmits the PSDU on the given channel and at the given transmit power.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
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.