Skip to content

Commit d71faef

Browse files
[nrf fromtree] net: openthread: radio: Add setting channel in diag mode
Add possibility to set channel in diag mode by implementing `platformRadioChannelSet` API. Signed-off-by: Maciej Baczmanski <[email protected]> (cherry picked from commit 712da72)
1 parent 008e774 commit d71faef

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

modules/openthread/platform/diag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ bool otPlatDiagModeGet(void)
104104

105105
void otPlatDiagChannelSet(uint8_t aChannel)
106106
{
107-
ARG_UNUSED(aChannel);
108107
sChannel = aChannel;
108+
platformRadioChannelSet(aChannel);
109109
}
110110

111111
void otPlatDiagTxPowerSet(int8_t aTxPower)

modules/openthread/platform/platform-zephyr.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ void platformUartPanic(void);
7070
*/
7171
uint16_t platformRadioChannelGet(otInstance *aInstance);
7272

73+
#if defined(CONFIG_OPENTHREAD_DIAG)
74+
/**
75+
* Set channel on radio driver.
76+
*
77+
* @param[in] aChannel The channel that the radio driver should use for operation.
78+
*
79+
*/
80+
void platformRadioChannelSet(uint8_t aChannel);
81+
#endif /* CONFIG_OPENTHREAD_DIAG */
82+
7383
#if defined(CONFIG_IEEE802154_CARRIER_FUNCTIONS)
7484
/**
7585
* Start/stop continuous carrier wave transmission.

modules/openthread/platform/radio.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,13 @@ uint16_t platformRadioChannelGet(otInstance *aInstance)
708708
return channel;
709709
}
710710

711+
#if defined(CONFIG_OPENTHREAD_DIAG)
712+
void platformRadioChannelSet(uint8_t aChannel)
713+
{
714+
channel = aChannel;
715+
}
716+
#endif
717+
711718
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId)
712719
{
713720
ARG_UNUSED(aInstance);

0 commit comments

Comments
 (0)