mirror of
https://github.com/espressif/openthread.git
synced 2026-09-10 03:00:09 +00:00
[channel-manager] API to get the last requested channel (#2546)
This commits adds a new API to `ChannelManager` class (and a a corresponding public OT API) to get the channel for the last successfully requested channel change.
This commit is contained in:
committed by
Jonathan Hui
parent
33a9b3e62b
commit
e347a7ddba
@@ -72,6 +72,14 @@ extern "C" {
|
||||
*/
|
||||
otError otChannelManagerRequestChannelChange(otInstance *aInstance, uint8_t aChannel);
|
||||
|
||||
/**
|
||||
* This function gets the channel from the last successful call to `otChannelManagerRequestChannelChange()`
|
||||
*
|
||||
* @returns The last requested channel or zero if there has been no channel change request yet.
|
||||
*
|
||||
*/
|
||||
uint8_t otChannelManagerGetRequestedChannel(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function gets the delay (in seconds) used by Channel Manager for a channel change.
|
||||
*
|
||||
|
||||
@@ -48,6 +48,13 @@ otError otChannelManagerRequestChannelChange(otInstance *aInstance, uint8_t aCha
|
||||
return instance.GetChannelManager().RequestChannelChange(aChannel);
|
||||
}
|
||||
|
||||
uint8_t otChannelManagerGetRequestedChannel(otInstance *aInstance)
|
||||
{
|
||||
Instance &instance = *static_cast<Instance *>(aInstance);
|
||||
|
||||
return instance.GetChannelManager().GetRequestedChannel();
|
||||
}
|
||||
|
||||
uint16_t otChannelManagerGetDelay(otInstance *aInstance)
|
||||
{
|
||||
Instance &instance = *static_cast<Instance *>(aInstance);
|
||||
|
||||
@@ -100,7 +100,15 @@ public:
|
||||
otError RequestChannelChange(uint8_t aChannel);
|
||||
|
||||
/**
|
||||
* This method gets the delay (in seconds) used for a channel change.
|
||||
* This method gets the channel from the last successful call to `RequestChannelChange()`.
|
||||
*
|
||||
* @returns The last requested channel, or zero if there has been no channel change request yet.
|
||||
*
|
||||
*/
|
||||
uint8_t GetRequestedChannel(void) const { return mChannel; }
|
||||
|
||||
/**
|
||||
* This method gets the delay (in seconds) used for a channel change.
|
||||
*
|
||||
* @returns The delay (in seconds)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user