Skip to content

Commit 712da72

Browse files
maciejbaczmanskikartben
authored andcommitted
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]>
1 parent b46f720 commit 712da72

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
@@ -722,6 +722,13 @@ uint16_t platformRadioChannelGet(otInstance *aInstance)
722722
return channel;
723723
}
724724

725+
#if defined(CONFIG_OPENTHREAD_DIAG)
726+
void platformRadioChannelSet(uint8_t aChannel)
727+
{
728+
channel = aChannel;
729+
}
730+
#endif
731+
725732
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId)
726733
{
727734
ARG_UNUSED(aInstance);

0 commit comments

Comments
 (0)