mirror of
https://github.com/espressif/openthread.git
synced 2026-09-09 02:30:11 +00:00
Add API function to check if MAC layer is during transmission operation. (#1447)
This commit is contained in:
@@ -136,6 +136,20 @@ OTAPI bool OTCALL otLinkIsEnergyScanInProgress(otInstance *aInstance);
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkSendDataRequest(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.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @returns true if an IEEE 802.15.4 MAC is in the transmit state, false otherwise.
|
||||
*
|
||||
*/
|
||||
OTAPI bool OTCALL otLinkIsInTransmitState(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Get the IEEE 802.15.4 channel.
|
||||
*
|
||||
|
||||
@@ -355,6 +355,10 @@ bool otLinkIsEnergyScanInProgress(otInstance *aInstance)
|
||||
return aInstance->mThreadNetif.GetMac().IsEnergyScanInProgress();
|
||||
}
|
||||
|
||||
bool otLinkIsInTransmitState(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetMac().IsInTransmitState();
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -257,6 +257,11 @@ bool Mac::IsEnergyScanInProgress(void)
|
||||
return (mState == kStateEnergyScan) || (mPendingScanRequest == kScanTypeEnergy);
|
||||
}
|
||||
|
||||
bool Mac::IsInTransmitState(void)
|
||||
{
|
||||
return (mState == kStateTransmitData) || (mState == kStateTransmitBeacon);
|
||||
}
|
||||
|
||||
void Mac::StartEnergyScan(void)
|
||||
{
|
||||
mState = kStateEnergyScan;
|
||||
|
||||
@@ -502,6 +502,16 @@ public:
|
||||
*/
|
||||
bool IsEnergyScanInProgress(void);
|
||||
|
||||
/**
|
||||
* This method returns if the MAC layer is in transmit state.
|
||||
*
|
||||
* The MAC layer is in transmit state during CSMA/CA, CCA, transmission of Data, Beacon or Data Request frames and
|
||||
* receiving of ACK frames. The MAC layer is not in transmit state during transmission of ACK frames or Beacon
|
||||
* Requests.
|
||||
*
|
||||
*/
|
||||
bool IsInTransmitState(void);
|
||||
|
||||
/**
|
||||
* This method registers a callback to provide received raw IEEE 802.15.4 frames.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user