Raw Link#
This module includes functions that control the raw link-layer configuration.
Typedefs#
Pointer on receipt of a IEEE 802.15.4 frame.
Pointer on receipt of a IEEE 802.15.4 frame.
Pointer on receipt of a IEEE 802.15.4 frame.
Functions#
Enables/disables the raw link-layer.
Indicates whether or not the raw link-layer is enabled.
Gets the status of promiscuous mode.
Enables or disables promiscuous mode.
Set the Short Address for address filtering.
Set the alternate short address.
Transition the radio from Receive to Sleep.
Transitioning the radio from Sleep to Receive.
The radio transitions from Transmit to Receive.
Begins the transmit sequence on the radio.
Get the most recent RSSI measurement.
Get the radio capabilities.
Begins the energy scan sequence on the radio.
Enable/Disable source match for frame pending.
Adding short address to the source match table.
Adding extended address to the source match table.
Removing short address to the source match table.
Removing extended address to the source match table of the radio.
Removing all the short addresses from the source match table.
Removing all the extended addresses from the source match table.
Update MAC keys and key index.
Sets the current MAC frame counter value.
Sets the current MAC frame counter value only if the new value is larger than the current one.
Get current platform time (64bits width) of the radio chip.
Typedef Documentation#
otLinkRawReceiveDone#
typedef void(* otLinkRawReceiveDone) (otInstance *aInstance, otRadioFrame *aFrame, otError aError) )(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
Pointer on receipt of a IEEE 802.15.4 frame.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aInstance | A pointer to an OpenThread instance. | |
[in] | aFrame | A pointer to the received frame or NULL if the receive operation was aborted. | |
[in] | aError | OT_ERROR_NONE when successfully received a frame. OT_ERROR_ABORT when reception was aborted and a frame was not received. |
otLinkRawTransmitDone#
typedef void(* otLinkRawTransmitDone) (otInstance *aInstance, otRadioFrame *aFrame, otRadioFrame *aAckFrame, otError aError) )(otInstance *aInstance, otRadioFrame *aFrame, otRadioFrame *aAckFrame, otError aError)
Pointer on receipt of a IEEE 802.15.4 frame.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aInstance | A pointer to an OpenThread instance. | |
[in] | aFrame | A pointer to the frame that was transmitted. | |
[in] | aAckFrame | A pointer to the ACK frame. | |
[in] | aError | OT_ERROR_NONE when the frame was transmitted. OT_ERROR_NO_ACK when the frame was transmitted but no ACK was received OT_ERROR_CHANNEL_ACCESS_FAILURE when the transmission could not take place due to activity on the channel. OT_ERROR_ABORT when transmission was aborted for other reasons. |
otLinkRawEnergyScanDone#
typedef void(* otLinkRawEnergyScanDone) (otInstance *aInstance, int8_t aEnergyScanMaxRssi) )(otInstance *aInstance, int8_t aEnergyScanMaxRssi)
Pointer on receipt of a IEEE 802.15.4 frame.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aInstance | A pointer to an OpenThread instance. | |
[in] | aEnergyScanMaxRssi | The maximum RSSI encountered on the scanned channel. |
Function Documentation#
otLinkRawSetReceiveDone#
otError otLinkRawSetReceiveDone (otInstance * aInstance, otLinkRawReceiveDone aCallback)
Enables/disables the raw link-layer.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otLinkRawReceiveDone | [in] | aCallback | A pointer to a function called on receipt of a IEEE 802.15.4 frame. NULL to disable the raw-link layer. |
otLinkRawIsEnabled#
bool otLinkRawIsEnabled (otInstance * aInstance)
Indicates whether or not the raw link-layer is enabled.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otLinkRawGetPromiscuous#
bool otLinkRawGetPromiscuous (otInstance * aInstance)
Gets the status of promiscuous mode.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otLinkRawSetPromiscuous#
otError otLinkRawSetPromiscuous (otInstance * aInstance, bool aEnable)
Enables or disables promiscuous mode.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
bool | [in] | aEnable | A value to enable or disable promiscuous mode. |
otLinkRawSetShortAddress#
otError otLinkRawSetShortAddress (otInstance * aInstance, uint16_t aShortAddress)
Set the Short Address for address filtering.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aShortAddress | The IEEE 802.15.4 Short Address. |
otLinkRawSetAlternateShortAddress#
otError otLinkRawSetAlternateShortAddress (otInstance * aInstance, otShortAddress aShortAddress)
Set the alternate short address.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
otShortAddress | [in] | aShortAddress | 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.
otLinkRawSleep#
otError otLinkRawSleep (otInstance * aInstance)
Transition the radio from Receive to Sleep.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Turn off the radio.
otLinkRawReceive#
otError otLinkRawReceive (otInstance * aInstance)
Transitioning the radio from Sleep to Receive.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Turn on the radio.
otLinkRawGetTransmitBuffer#
otRadioFrame * otLinkRawGetTransmitBuffer (otInstance * aInstance)
The radio transitions from Transmit to Receive.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
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.
Returns
A pointer to the transmit buffer or NULL if the raw link-layer isn't enabled.
otLinkRawTransmit#
otError otLinkRawTransmit (otInstance * aInstance, otLinkRawTransmitDone aCallback)
Begins the transmit sequence on the radio.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otLinkRawTransmitDone | [in] | aCallback | A pointer to a function called on completion of the transmission. |
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.
otLinkRawGetRssi#
int8_t otLinkRawGetRssi (otInstance * aInstance)
Get the most recent RSSI measurement.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The RSSI in dBm when it is valid. 127 when RSSI is invalid.
otLinkRawGetCaps#
otRadioCaps otLinkRawGetCaps (otInstance * aInstance)
Get the radio capabilities.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The radio capability bit vector. The stack enables or disables some functions based on this value.
otLinkRawEnergyScan#
otError otLinkRawEnergyScan (otInstance * aInstance, uint8_t aScanChannel, uint16_t aScanDuration, otLinkRawEnergyScanDone aCallback)
Begins the energy scan sequence on the radio.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [in] | aScanChannel | The channel to perform the energy scan on. |
uint16_t | [in] | aScanDuration | The duration, in milliseconds, for the channel to be scanned. |
otLinkRawEnergyScanDone | [in] | aCallback | A pointer to a function called on completion of a scanned channel. |
otLinkRawSrcMatchEnable#
otError otLinkRawSrcMatchEnable (otInstance * aInstance, bool aEnable)
Enable/Disable source match for frame pending.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
bool | [in] | aEnable | Enable/disable source match for frame pending. |
otLinkRawSrcMatchAddShortEntry#
otError otLinkRawSrcMatchAddShortEntry (otInstance * aInstance, uint16_t aShortAddress)
Adding short address to the source match table.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aShortAddress | The short address to be added. |
otLinkRawSrcMatchAddExtEntry#
otError otLinkRawSrcMatchAddExtEntry (otInstance * aInstance, const otExtAddress * aExtAddress)
Adding extended address to the source match table.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otExtAddress * | [in] | aExtAddress | The extended address to be added. |
otLinkRawSrcMatchClearShortEntry#
otError otLinkRawSrcMatchClearShortEntry (otInstance * aInstance, uint16_t aShortAddress)
Removing short address to the source match table.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aShortAddress | The short address to be removed. |
otLinkRawSrcMatchClearExtEntry#
otError otLinkRawSrcMatchClearExtEntry (otInstance * aInstance, const otExtAddress * aExtAddress)
Removing extended address to the source match table of the radio.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otExtAddress * | [in] | aExtAddress | The extended address to be removed. |
otLinkRawSrcMatchClearShortEntries#
otError otLinkRawSrcMatchClearShortEntries (otInstance * aInstance)
Removing all the short addresses from the source match table.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otLinkRawSrcMatchClearExtEntries#
otError otLinkRawSrcMatchClearExtEntries (otInstance * aInstance)
Removing all the extended addresses from the source match table.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [in] | aKeyIdMode | The key ID mode. |
uint8_t | [in] | aKeyId | The key index. |
const otMacKey * | [in] | aPrevKey | The previous MAC key. |
const otMacKey * | [in] | aCurrKey | The current MAC key. |
const otMacKey * | [in] | aNextKey | The next MAC key. |
otLinkRawSetMacFrameCounter#
otError otLinkRawSetMacFrameCounter (otInstance * aInstance, uint32_t aMacFrameCounter)
Sets the current MAC frame counter value.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint32_t | [in] | aMacFrameCounter | The MAC frame counter value. |
Always sets the MAC counter to the new given value aMacFrameCounter
independent of the current value.
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint32_t | [in] | aMacFrameCounter | The MAC frame counter value. |
otLinkRawGetRadioTime#
uint64_t otLinkRawGetRadioTime (otInstance * aInstance)
Get current platform time (64bits width) of the radio chip.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The current radio time in microseconds.