Skip to content

Commit fe9e306

Browse files
edmontcarlescufi
authored andcommitted
net: openthread: fix otLinkMetricsInit usage
Remove usage of `otPlatRadioGetReceiveSensitivity` without the `otInstance` parameter. Signed-off-by: Eduardo Montoya <[email protected]>
1 parent ba5bcb1 commit fe9e306

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/openthread/platform/radio.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_OPENTHREAD_L2_LOG_LEVEL);
6363
*/
6464
#define PHR_DURATION_US 32U
6565

66+
#define DEFAULT_SENSITIVITY -100
67+
6668
enum pending_events {
6769
PENDING_EVENT_FRAME_TO_SEND, /* There is a tx frame to send */
6870
PENDING_EVENT_FRAME_RECEIVED, /* Radio has received new frame */
@@ -363,7 +365,7 @@ void platformRadioInit(void)
363365
radio_api->configure(radio_dev, IEEE802154_CONFIG_EVENT_HANDLER, &cfg);
364366

365367
#if defined(CONFIG_OPENTHREAD_LINK_METRICS_SUBJECT)
366-
otLinkMetricsInit(otPlatRadioGetReceiveSensitivity());
368+
otLinkMetricsInit(DEFAULT_SENSITIVITY);
367369
#endif
368370
}
369371

@@ -1110,7 +1112,7 @@ int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
11101112
{
11111113
ARG_UNUSED(aInstance);
11121114

1113-
return -100;
1115+
return DEFAULT_SENSITIVITY;
11141116
}
11151117

11161118
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)

0 commit comments

Comments
 (0)