[channelmask] add radio supported and preferred channel mask (#3732)

Add new radio platform APIs:
 * otPlatRadioGetSupportedChannelMask(); // supported channel mask: the device is allowed to be on;
 * otPlatRadioGetPreferredChannelMask(); // preferred channel mask: the device prefers to form on.

Implement some default radio platform APIs.

Add spinel property `SPINEL_PROP_PHY_CHAN_PREFERRED` to retrieve Preferred ChannelMask.
This commit is contained in:
Shu Chen
2019-04-08 10:35:18 -07:00
committed by Jonathan Hui
parent 174d076722
commit 4c06b47c34
22 changed files with 174 additions and 37 deletions
-10
View File
@@ -821,16 +821,6 @@ OTAPI uint8_t OTCALL otLinkGetPhyChannelMin(otInstance *aInstance);
*/
OTAPI uint8_t OTCALL otLinkGetPhyChannelMax(otInstance *aInstance);
/**
* This function gets the supported channel mask of IEEE 802.15.4 physical layer.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @returns The supported channel mask as `uint32_t` with bit 0 (lsb) mapping to channel 0, bit 1 to channel 1, so on.
*
*/
OTAPI uint32_t OTCALL otLinkGetPhySupportedChannelMask(otInstance *aInstance);
/**
* @}
*
+20
View File
@@ -694,6 +694,26 @@ void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance);
*/
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance);
/**
* Get the radio supported channel mask that the device is allowed to be on.
*
* @param[in] aInstance The OpenThread instance structure.
*
* @returns The radio supported channel mask.
*
*/
uint32_t otPlatRadioGetSupportedChannelMask(otInstance *aInstance);
/**
* Get the radio preferred channel mask that the device prefers to form on.
*
* @param[in] aInstance The OpenThread instance strucyyture.
*
* @returns The radio preferred channel mask.
*
*/
uint32_t otPlatRadioGetPreferredChannelMask(otInstance *aInstance);
/**
* @}
*