This module includes functions that control link-layer configuration. More...
Typedefs | |
typedef void(OTCALL * | otHandleActiveScanResult )(otActiveScanResult *aResult, void *aContext) |
typedef void(OTCALL * | otHandleEnergyScanResult )(otEnergyScanResult *aResult, void *aContext) |
typedef void(* | otLinkPcapCallback )(const RadioPacket *aFrame, void *aContext) |
Functions | |
OTAPI ThreadError OTCALL | otLinkActiveScan (otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, otHandleActiveScanResult aCallback, void *aCallbackContext) |
OTAPI bool OTCALL | otLinkIsActiveScanInProgress (otInstance *aInstance) |
OTAPI ThreadError OTCALL | otLinkEnergyScan (otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration, otHandleEnergyScanResult aCallback, void *aCallbackContext) |
OTAPI bool OTCALL | otLinkIsEnergyScanInProgress (otInstance *aInstance) |
OTAPI ThreadError OTCALL | otLinkSendDataRequest (otInstance *aInstance) |
OTAPI bool OTCALL | otLinkIsInTransmitState (otInstance *aInstance) |
OTAPI uint8_t OTCALL | otLinkGetChannel (otInstance *aInstance) |
OTAPI ThreadError OTCALL | otLinkSetChannel (otInstance *aInstance, uint8_t aChannel) |
OTAPI const uint8_t *OTCALL | otLinkGetExtendedAddress (otInstance *aInstance) |
OTAPI ThreadError OTCALL | otLinkSetExtendedAddress (otInstance *aInstance, const otExtAddress *aExtendedAddress) |
OTAPI void OTCALL | otLinkGetFactoryAssignedIeeeEui64 (otInstance *aInstance, otExtAddress *aEui64) |
OTAPI void OTCALL | otLinkGetJoinerId (otInstance *aInstance, otExtAddress *aHashMacAddress) |
OTAPI int8_t OTCALL | otLinkGetMaxTransmitPower (otInstance *aInstance) |
OTAPI void OTCALL | otLinkSetMaxTransmitPower (otInstance *aInstance, int8_t aPower) |
OTAPI otPanId OTCALL | otLinkGetPanId (otInstance *aInstance) |
OTAPI ThreadError 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 ThreadError OTCALL | otLinkAddWhitelist (otInstance *aInstance, const uint8_t *aExtAddr) |
OTAPI ThreadError OTCALL | otLinkAddWhitelistRssi (otInstance *aInstance, const uint8_t *aExtAddr, int8_t aRssi) |
OTAPI void OTCALL | otLinkRemoveWhitelist (otInstance *aInstance, const uint8_t *aExtAddr) |
OTAPI ThreadError OTCALL | otLinkGetWhitelistEntry (otInstance *aInstance, uint8_t aIndex, otMacWhitelistEntry *aEntry) |
OTAPI void OTCALL | otLinkClearWhitelist (otInstance *aInstance) |
OTAPI void OTCALL | otLinkSetWhitelistEnabled (otInstance *aInstance, bool aEnabled) |
OTAPI bool OTCALL | otLinkIsWhitelistEnabled (otInstance *aInstance) |
OTAPI ThreadError OTCALL | otLinkAddBlacklist (otInstance *aInstance, const uint8_t *aExtAddr) |
OTAPI void OTCALL | otLinkRemoveBlacklist (otInstance *aInstance, const uint8_t *aExtAddr) |
OTAPI ThreadError OTCALL | otLinkGetBlacklistEntry (otInstance *aInstance, uint8_t aIndex, otMacBlacklistEntry *aEntry) |
OTAPI void OTCALL | otLinkClearBlacklist (otInstance *aInstance) |
OTAPI void OTCALL | otLinkSetBlacklistEnabled (otInstance *aInstance, bool aEnabled) |
OTAPI bool OTCALL | otLinkIsBlacklistEnabled (otInstance *aInstance) |
OTAPI ThreadError OTCALL | otLinkGetAssignLinkQuality (otInstance *aInstance, const uint8_t *aExtAddr, uint8_t *aLinkQuality) |
OTAPI void OTCALL | otLinkSetAssignLinkQuality (otInstance *aInstance, const uint8_t *aExtAddr, uint8_t aLinkQuality) |
OTAPI const otMacCounters *OTCALL | otLinkGetCounters (otInstance *aInstance) |
void | otLinkSetPcapCallback (otInstance *aInstance, otLinkPcapCallback aPcapCallback, void *aCallbackContext) |
bool | otLinkIsPromiscuous (otInstance *aInstance) |
ThreadError | otLinkSetPromiscuous (otInstance *aInstance, bool aPromiscuous) |
This module includes functions that control link-layer configuration.
typedef void(OTCALL * otHandleActiveScanResult)(otActiveScanResult *aResult, void *aContext) |
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.
[in] | aResult | A valid pointer to the beacon information or NULL when the active scan completes. |
[in] | aContext | A pointer to application-specific context. |
typedef void(OTCALL * otHandleEnergyScanResult)(otEnergyScanResult *aResult, void *aContext) |
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.
[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 RadioPacket *aFrame, void *aContext) |
This function pointer is called when an IEEE 802.15.4 frame is received.
aFrame
may not contain the actual FCS that was received.aFrame
will always be false.[in] | aFrame | A pointer to the received IEEE 802.15.4 frame. |
[in] | aContext | A pointer to application-specific context. |
OTAPI ThreadError OTCALL otLinkActiveScan | ( | otInstance * | aInstance, |
uint32_t | aScanChannels, | ||
uint16_t | aScanDuration, | ||
otHandleActiveScanResult | aCallback, | ||
void * | aCallbackContext | ||
) |
This function starts an IEEE 802.15.4 Active Scan
[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. |
kThreadError_None | Accepted the Active Scan request. |
kThreadError_Busy | Already performing an Active Scan. |
OTAPI ThreadError OTCALL otLinkAddBlacklist | ( | otInstance * | aInstance, |
const uint8_t * | aExtAddr | ||
) |
Add an IEEE 802.15.4 Extended Address to the MAC blacklist.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddr | A pointer to the IEEE 802.15.4 Extended Address. |
kThreadErrorNone | Successfully added to the MAC blacklist. |
kThreadErrorNoBufs | No buffers available for a new MAC blacklist entry. |
OTAPI ThreadError OTCALL otLinkAddWhitelist | ( | otInstance * | aInstance, |
const uint8_t * | aExtAddr | ||
) |
Add an IEEE 802.15.4 Extended Address to the MAC whitelist.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddr | A pointer to the IEEE 802.15.4 Extended Address. |
kThreadErrorNone | Successfully added to the MAC whitelist. |
kThreadErrorNoBufs | No buffers available for a new MAC whitelist entry. |
OTAPI ThreadError OTCALL otLinkAddWhitelistRssi | ( | otInstance * | aInstance, |
const uint8_t * | aExtAddr, | ||
int8_t | aRssi | ||
) |
Add an IEEE 802.15.4 Extended Address to the MAC whitelist and fix the RSSI value.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddr | A pointer to the IEEE 802.15.4 Extended Address. |
[in] | aRssi | The RSSI in dBm to use when receiving messages from aExtAddr. |
kThreadErrorNone | Successfully added to the MAC whitelist. |
kThreadErrorNoBufs | No buffers available for a new MAC whitelist entry. |
OTAPI void OTCALL otLinkClearBlacklist | ( | otInstance * | aInstance | ) |
Remove all entries from the MAC Blacklist.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI void OTCALL otLinkClearWhitelist | ( | otInstance * | aInstance | ) |
Remove all entries from the MAC whitelist.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI ThreadError OTCALL otLinkEnergyScan | ( | otInstance * | aInstance, |
uint32_t | aScanChannels, | ||
uint16_t | aScanDuration, | ||
otHandleEnergyScanResult | aCallback, | ||
void * | aCallbackContext | ||
) |
This function starts an IEEE 802.15.4 Energy Scan
[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. |
kThreadError_None | Accepted the Energy Scan request. |
kThreadError_Busy | Could not start the energy scan. |
OTAPI ThreadError OTCALL otLinkGetAssignLinkQuality | ( | otInstance * | aInstance, |
const uint8_t * | aExtAddr, | ||
uint8_t * | aLinkQuality | ||
) |
Get the assigned link quality which is on the link to a given extended address.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddr | A pointer to the IEEE 802.15.4 Extended Address. |
[in] | aLinkQuality | A pointer to the assigned link quality. |
kThreadError_None | Successfully retrieved the link quality to aLinkQuality. |
kThreadError_InvalidState | No attached child matches with a given extended address. |
OTAPI ThreadError OTCALL otLinkGetBlacklistEntry | ( | otInstance * | aInstance, |
uint8_t | aIndex, | ||
otMacBlacklistEntry * | aEntry | ||
) |
This function gets a MAC Blacklist entry.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aIndex | An index into the MAC Blacklist table. |
[out] | aEntry | A pointer to where the information is placed. |
kThreadError_None | Successfully retrieved the MAC Blacklist entry. |
kThreadError_InvalidArgs | aIndex is out of bounds or aEntry is NULL. |
OTAPI uint8_t OTCALL otLinkGetChannel | ( | otInstance * | aInstance | ) |
Get the IEEE 802.15.4 channel.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI const otMacCounters* OTCALL otLinkGetCounters | ( | otInstance * | aInstance | ) |
Get the MAC layer counters.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI const uint8_t* OTCALL otLinkGetExtendedAddress | ( | otInstance * | aInstance | ) |
Get the IEEE 802.15.4 Extended Address.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI void OTCALL otLinkGetFactoryAssignedIeeeEui64 | ( | otInstance * | aInstance, |
otExtAddress * | aEui64 | ||
) |
Get the factory-assigned IEEE EUI-64.
[in] | aInstance | A pointer to the OpenThread instance. |
[out] | aEui64 | A pointer to where the factory-assigned IEEE EUI-64 is placed. |
OTAPI void OTCALL otLinkGetJoinerId | ( | otInstance * | aInstance, |
otExtAddress * | aHashMacAddress | ||
) |
Get the Joiner ID.
Joiner ID is the first 64 bits of the result of computing SHA-256 over factory-assigned IEEE EUI-64, which is used as IEEE 802.15.4 Extended Address during commissioning process.
[in] | aInstance | A pointer to the OpenThread instance. |
[out] | aHashMacAddress | A pointer to where the Hash Mac Address is placed. |
OTAPI int8_t OTCALL otLinkGetMaxTransmitPower | ( | otInstance * | aInstance | ) |
This function returns the maximum transmit power setting in dBm.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otPanId OTCALL otLinkGetPanId | ( | otInstance * | aInstance | ) |
Get the IEEE 802.15.4 PAN ID.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint32_t OTCALL otLinkGetPollPeriod | ( | otInstance * | aInstance | ) |
Get the data poll period of sleepy end device.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otShortAddress OTCALL otLinkGetShortAddress | ( | otInstance * | aInstance | ) |
Get the IEEE 802.15.4 Short Address.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI ThreadError OTCALL otLinkGetWhitelistEntry | ( | otInstance * | aInstance, |
uint8_t | aIndex, | ||
otMacWhitelistEntry * | aEntry | ||
) |
This function gets a MAC whitelist entry.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aIndex | An index into the MAC whitelist table. |
[out] | aEntry | A pointer to where the information is placed. |
kThreadError_None | Successfully retrieved the MAC whitelist entry. |
kThreadError_InvalidArgs | aIndex is out of bounds or aEntry is NULL. |
OTAPI bool OTCALL otLinkIsActiveScanInProgress | ( | otInstance * | aInstance | ) |
This function indicates whether or not an IEEE 802.15.4 Active Scan is currently in progress.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI bool OTCALL otLinkIsBlacklistEnabled | ( | otInstance * | aInstance | ) |
This function indicates whether or not the MAC Blacklist is enabled.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI bool OTCALL otLinkIsEnergyScanInProgress | ( | otInstance * | aInstance | ) |
This function indicates whether or not an IEEE 802.15.4 Energy Scan is currently in progress.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI bool OTCALL otLinkIsInTransmitState | ( | otInstance * | aInstance | ) |
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.
[in] | aInstance | A pointer to an OpenThread instance. |
bool otLinkIsPromiscuous | ( | otInstance * | aInstance | ) |
This function indicates whether or not promiscuous mode is enabled at the link layer.
[in] | aInstance | A pointer to an OpenThread instance. |
true | Promiscuous mode is enabled. |
false | Promiscuous mode is not enabled. |
OTAPI bool OTCALL otLinkIsWhitelistEnabled | ( | otInstance * | aInstance | ) |
This function indicates whether or not the MAC whitelist is enabled.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI void OTCALL otLinkRemoveBlacklist | ( | otInstance * | aInstance, |
const uint8_t * | aExtAddr | ||
) |
Remove an IEEE 802.15.4 Extended Address from the MAC blacklist.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddr | A pointer to the IEEE 802.15.4 Extended Address. |
OTAPI void OTCALL otLinkRemoveWhitelist | ( | otInstance * | aInstance, |
const uint8_t * | aExtAddr | ||
) |
Remove an IEEE 802.15.4 Extended Address from the MAC whitelist.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddr | A pointer to the IEEE 802.15.4 Extended Address. |
OTAPI ThreadError OTCALL otLinkSendDataRequest | ( | otInstance * | aInstance | ) |
This function enqueues an IEEE 802.15.4 Data Request message for transmission.
[in] | aInstance | A pointer to an OpenThread instance. |
kThreadError_None | Successfully enqueued an IEEE 802.15.4 Data Request message. |
kThreadError_Already | An IEEE 802.15.4 Data Request message is already enqueued. |
kThreadError_InvalidState | Device is not in rx-off-when-idle mode. |
kThreadError_NoBufs | Insufficient message buffers available. |
OTAPI void OTCALL otLinkSetAssignLinkQuality | ( | otInstance * | aInstance, |
const uint8_t * | aExtAddr, | ||
uint8_t | aLinkQuality | ||
) |
Set the link quality which is on the link to a given extended address.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtAddr | A pointer to the IEEE 802.15.4 Extended Address. |
[in] | aLinkQuality | The link quality to be set on the link. |
OTAPI void OTCALL otLinkSetBlacklistEnabled | ( | otInstance * | aInstance, |
bool | aEnabled | ||
) |
Enable MAC Blacklist filtering.
[in] | aInstance | A pointer to an OpenThread instance. [in] aEnabled TRUE to enable the blacklist, FALSE otherwise. |
OTAPI ThreadError OTCALL otLinkSetChannel | ( | otInstance * | aInstance, |
uint8_t | aChannel | ||
) |
Set the IEEE 802.15.4 channel
This function will only succeed when Thread protocols are disabled. A successful call to this function will also invalidate the Active and Pending Operational Datasets in non-volatile memory.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aChannel | The IEEE 802.15.4 channel. |
kThreadErrorNone | Successfully set the channel. |
kThreadErrorInvalidArgs | If aChnanel is not in the range [11, 26]. kThreadError_InvalidState Thread protocols are enabled. |
OTAPI ThreadError OTCALL otLinkSetExtendedAddress | ( | otInstance * | aInstance, |
const otExtAddress * | aExtendedAddress | ||
) |
This function sets the IEEE 802.15.4 Extended Address.
This function will only succeed when Thread protocols are disabled.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtendedAddress | A pointer to the IEEE 802.15.4 Extended Address. |
kThreadError_None | Successfully set the IEEE 802.15.4 Extended Address. |
kThreadError_InvalidArgs | aExtendedAddress was NULL. |
kThraedError_InvalidState | Thread protocols are enabled. |
OTAPI void OTCALL otLinkSetMaxTransmitPower | ( | otInstance * | aInstance, |
int8_t | aPower | ||
) |
This function sets the maximum transmit power in dBm.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPower | The maximum transmit power in dBm. |
OTAPI ThreadError OTCALL otLinkSetPanId | ( | otInstance * | aInstance, |
otPanId | aPanId | ||
) |
Set the IEEE 802.15.4 PAN ID.
This function will only succeed when Thread protocols are disabled. A successful call to this function will also invalidate the Active and Pending Operational Datasets in non-volatile memory.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPanId | The IEEE 802.15.4 PAN ID. |
kThreadError_None | Successfully set the PAN ID. |
kThreadError_InvalidArgs | If aPanId is not in the range [0, 65534]. |
kThreadError_InvalidState | Thread protocols are enabled. |
void otLinkSetPcapCallback | ( | otInstance * | aInstance, |
otLinkPcapCallback | aPcapCallback, | ||
void * | aCallbackContext | ||
) |
This function registers a callback to provide received raw IEEE 802.15.4 frames.
[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. |
OTAPI void OTCALL otLinkSetPollPeriod | ( | otInstance * | aInstance, |
uint32_t | aPollPeriod | ||
) |
Set the data poll period for sleepy end device.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPollPeriod | data poll period. |
ThreadError otLinkSetPromiscuous | ( | otInstance * | aInstance, |
bool | aPromiscuous | ||
) |
This function enables or disables the link layer promiscuous mode.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPromiscuous | true to enable promiscuous mode, or false otherwise. |
kThreadError_None | Successfully enabled promiscuous mode. |
kThreadError_InvalidState | Could not enable promiscuous mode because the Thread interface is enabled. |
OTAPI void OTCALL otLinkSetWhitelistEnabled | ( | otInstance * | aInstance, |
bool | aEnabled | ||
) |
Enable MAC whitelist filtering.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aEnabled | TRUE to enable the whitelist, FALSE otherwise. |