This module includes functions that control the raw link-layer configuration.
More...
|
ThreadError | otLinkRawSetEnable (otInstance *aInstance, bool aEnabled) |
|
bool | otLinkRawIsEnabled (otInstance *aInstance) |
|
ThreadError | otLinkRawSetPanId (otInstance *aInstance, uint16_t aPanId) |
|
ThreadError | otLinkRawSetExtendedAddress (otInstance *aInstance, const otExtAddress *aExtendedAddress) |
|
ThreadError | otLinkRawSetShortAddress (otInstance *aInstance, uint16_t aShortAddress) |
|
bool | otLinkRawGetPromiscuous (otInstance *aInstance) |
|
ThreadError | otLinkRawSetPromiscuous (otInstance *aInstance, bool aEnable) |
|
ThreadError | otLinkRawSleep (otInstance *aInstance) |
|
ThreadError | otLinkRawReceive (otInstance *aInstance, uint8_t aChannel, otLinkRawReceiveDone aCallback) |
|
RadioPacket * | otLinkRawGetTransmitBuffer (otInstance *aInstance) |
|
ThreadError | otLinkRawTransmit (otInstance *aInstance, RadioPacket *aPacket, otLinkRawTransmitDone aCallback) |
|
int8_t | otLinkRawGetRssi (otInstance *aInstance) |
|
otRadioCaps | otLinkRawGetCaps (otInstance *aInstance) |
|
ThreadError | otLinkRawEnergyScan (otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration, otLinkRawEnergyScanDone aCallback) |
|
ThreadError | otLinkRawSrcMatchEnable (otInstance *aInstance, bool aEnable) |
|
ThreadError | otLinkRawSrcMatchAddShortEntry (otInstance *aInstance, const uint16_t aShortAddress) |
|
ThreadError | otLinkRawSrcMatchAddExtEntry (otInstance *aInstance, const uint8_t *aExtAddress) |
|
ThreadError | otLinkRawSrcMatchClearShortEntry (otInstance *aInstance, const uint16_t aShortAddress) |
|
ThreadError | otLinkRawSrcMatchClearExtEntry (otInstance *aInstance, const uint8_t *aExtAddress) |
|
ThreadError | otLinkRawSrcMatchClearShortEntries (otInstance *aInstance) |
|
ThreadError | otLinkRawSrcMatchClearExtEntries (otInstance *aInstance) |
|
This module includes functions that control the raw link-layer configuration.
typedef void(* otLinkRawEnergyScanDone)(otInstance *aInstance, int8_t aEnergyScanMaxRssi) |
This function pointer on receipt of a IEEE 802.15.4 frame.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aEnergyScanMaxRssi | The maximum RSSI encountered on the scanned channel. |
typedef void(OTCALL * otLinkRawReceiveDone)(otInstance *aInstance, RadioPacket *aPacket, ThreadError aError) |
This function pointer on receipt of a IEEE 802.15.4 frame.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPacket | A pointer to the received packet or NULL if the receive operation was aborted. |
[in] | aaError | kThreadError_None when successfully received a frame. kThreadError_Abort when reception was aborted and a frame was not received. |
typedef void(* otLinkRawTransmitDone)(otInstance *aInstance, RadioPacket *aPacket, bool aFramePending, ThreadError aError) |
This function pointer on receipt of a IEEE 802.15.4 frame.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPacket | A pointer to the packet that was transmitted. |
[in] | aFramePending | TRUE if an ACK frame was received and the Frame Pending bit was set. |
[in] | aError | kThreadError_None when the frame was transmitted. kThreadError_NoAck when the frame was transmitted but no ACK was received kThreadError_ChannelAccessFailure when the transmission could not take place due to activity on the channel. kThreadError_Abort when transmission was aborted for other reasons. |
ThreadError otLinkRawEnergyScan |
( |
otInstance * |
aInstance, |
|
|
uint8_t |
aScanChannel, |
|
|
uint16_t |
aScanDuration, |
|
|
otLinkRawEnergyScanDone |
aCallback |
|
) |
| |
This method begins the energy scan sequence on the radio.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aScanChannel | The channel to perform the energy scan on. |
[in] | aScanDuration | The duration, in milliseconds, for the channel to be scanned. |
[in] | aCallback | A pointer to a function called on completion of a scanned channel. |
- Return values
-
kThreadError_None | Successfully started scanning the channel. |
kThreadError_NotImplemented | The radio doesn't support energy scanning. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
Get the radio capabilities.
- Parameters
-
[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.
bool otLinkRawGetPromiscuous |
( |
otInstance * |
aInstance | ) |
|
This function gets the status of promiscuous mode.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Return values
-
true | Promiscuous mode is enabled. |
false | Promiscuous mode is disabled. |
int8_t otLinkRawGetRssi |
( |
otInstance * |
aInstance | ) |
|
Get the most recent RSSI measurement.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- The RSSI in dBm when it is valid. 127 when RSSI is invalid.
RadioPacket* otLinkRawGetTransmitBuffer |
( |
otInstance * |
aInstance | ) |
|
The radio transitions from Transmit to Receive. This method 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.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Returns
- A pointer to the transmit buffer or NULL if the raw link-layer isn't enabled.
bool otLinkRawIsEnabled |
( |
otInstance * |
aInstance | ) |
|
This function indicates whether or not the raw link-layer is enabled.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Return values
-
true | The raw link-layer is enabled. |
false | The raw link-layer is disabled. |
ThreadError otLinkRawReceive |
( |
otInstance * |
aInstance, |
|
|
uint8_t |
aChannel, |
|
|
otLinkRawReceiveDone |
aCallback |
|
) |
| |
Transitioning the radio from Sleep to Receive. Turn on the radio.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aChannel | The channel to use for receiving. |
[in] | aCallback | A pointer to a function called on receipt of a IEEE 802.15.4 frame. |
- Return values
-
kThreadError_None | Successfully transitioned to Receive. |
kThreadError_InvalidState | The radio was disabled or transmitting. |
ThreadError otLinkRawSetEnable |
( |
otInstance * |
aInstance, |
|
|
bool |
aEnabled |
|
) |
| |
This function enables/disables the raw link-layer.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aEnabled | TRUE to enable raw link-layer, FALSE otherwise. |
- Return values
-
kThreadError_None | If the enable state was successfully set. |
kThreadError_InvalidState | If the OpenThread Ip6 interface is already enabled. |
ThreadError otLinkRawSetExtendedAddress |
( |
otInstance * |
aInstance, |
|
|
const otExtAddress * |
aExtendedAddress |
|
) |
| |
This function sets the IEEE 802.15.4 Extended Address.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtendedAddress | A pointer to the IEEE 802.15.4 Extended Address. |
- Return values
-
kThreadError_None | If successful. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
ThreadError otLinkRawSetPanId |
( |
otInstance * |
aInstance, |
|
|
uint16_t |
aPanId |
|
) |
| |
This function set the IEEE 802.15.4 PAN ID.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPanId | The IEEE 802.15.4 PAN ID. |
- Return values
-
kThreadError_None | If successful. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
ThreadError otLinkRawSetPromiscuous |
( |
otInstance * |
aInstance, |
|
|
bool |
aEnable |
|
) |
| |
This function enables or disables promiscuous mode.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aEnable | A value to enable or disable promiscuous mode. |
- Return values
-
kThreadError_None | If successful. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
ThreadError otLinkRawSetShortAddress |
( |
otInstance * |
aInstance, |
|
|
uint16_t |
aShortAddress |
|
) |
| |
Set the Short Address for address filtering.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aShortAddress | The IEEE 802.15.4 Short Address. |
- Return values
-
kThreadError_None | If successful. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
ThreadError otLinkRawSleep |
( |
otInstance * |
aInstance | ) |
|
Transition the radio from Receive to Sleep. Turn off the radio.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Return values
-
kThreadError_None | Successfully transitioned to Sleep. |
kThreadError_Busy | The radio was transmitting |
kThreadError_InvalidState | The radio was disabled |
ThreadError otLinkRawSrcMatchAddExtEntry |
( |
otInstance * |
aInstance, |
|
|
const uint8_t * |
aExtAddress |
|
) |
| |
Adding extended address to the source match table.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddress | The extended address to be added. |
- Return values
-
kThreadError_None | Successfully added extended address to the source match table. |
kThreadError_NoBufs | No available entry in the source match table. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
ThreadError otLinkRawSrcMatchAddShortEntry |
( |
otInstance * |
aInstance, |
|
|
const uint16_t |
aShortAddress |
|
) |
| |
Adding short address to the source match table.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aShortAddress | The short address to be added. |
- Return values
-
kThreadError_None | Successfully added short address to the source match table. |
kThreadError_NoBufs | No available entry in the source match table. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
ThreadError otLinkRawSrcMatchClearExtEntries |
( |
otInstance * |
aInstance | ) |
|
Removing all the extended addresses from the source match table.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Return values
-
kThreadError_None | If successful. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
ThreadError otLinkRawSrcMatchClearExtEntry |
( |
otInstance * |
aInstance, |
|
|
const uint8_t * |
aExtAddress |
|
) |
| |
Removing extended address to the source match table of the radio.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddress | The extended address to be removed. |
- Return values
-
kThreadError_None | Successfully removed the extended address from the source match table. |
kThreadError_NoAddress | The extended address is not in source match table. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
ThreadError otLinkRawSrcMatchClearShortEntries |
( |
otInstance * |
aInstance | ) |
|
Removing all the short addresses from the source match table.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
- Return values
-
kThreadError_None | If successful. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
ThreadError otLinkRawSrcMatchClearShortEntry |
( |
otInstance * |
aInstance, |
|
|
const uint16_t |
aShortAddress |
|
) |
| |
Removing short address to the source match table.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aShortAddress | The short address to be removed. |
- Return values
-
kThreadError_None | Successfully removed short address from the source match table. |
kThreadError_NoAddress | The short address is not in source match table. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
ThreadError otLinkRawSrcMatchEnable |
( |
otInstance * |
aInstance, |
|
|
bool |
aEnable |
|
) |
| |
Enable/Disable source match for AutoPend.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aEnable | Enable/disable source match for automatical pending. |
- Return values
-
kThreadError_None | If successful. |
kThreadError_InvalidState | If the raw link-layer isn't enabled. |
This method 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 RadioPacket 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.
- Parameters
-
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPacket | A pointer to the packet that was transmitted. |
[in] | aCallback | A pointer to a function called on completion of the transmission. |
- Return values
-
kThreadError_None | Successfully transitioned to Transmit. |
kThreadError_InvalidState | The radio was not in the Receive state. |