Commit 89b73368 authored by Nick Ward's avatar Nick Ward Committed by Anas Nashif
Browse files

net: openthread: make receive sensitivity configurable



OpenThread route cost calculations are dependent on this
being accurate for the hardware design.

Signed-off-by: default avatarNick Ward <nix.ward@gmail.com>
parent 43897a4e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -175,6 +175,13 @@ config OPENTHREAD_MAC_STAY_AWAKE_BETWEEN_FRAGMENTS
	help
	  This optimization is done at the expense of power consumption on SED/SSED devices.

config OPENTHREAD_DEFAULT_RX_SENSITIVITY
	int "OpenThread default RX sensitivity in dBm"
	range $(INT8_MIN) $(INT8_MAX)
	default -100
	help
	  Set the default receive sensitivity [dBm] in radio driver.

config OPENTHREAD_DEFAULT_TX_POWER
	int "OpenThread default tx power in dBm"
	range -40 20 if NRF_802154_RADIO_DRIVER
+1 −3
Original line number Diff line number Diff line
@@ -69,8 +69,6 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_OPENTHREAD_L2_LOG_LEVEL);
 */
#define PHR_DURATION_US 32U

#define DEFAULT_SENSITIVITY -100

enum pending_events {
	PENDING_EVENT_FRAME_TO_SEND, /* There is a tx frame to send  */
	PENDING_EVENT_FRAME_RECEIVED, /* Radio has received new frame */
@@ -1173,7 +1171,7 @@ int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
{
	ARG_UNUSED(aInstance);

	return DEFAULT_SENSITIVITY;
	return CONFIG_OPENTHREAD_DEFAULT_RX_SENSITIVITY;
}

otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#define OT_WORKER_PRIORITY K_PRIO_COOP(CONFIG_OPENTHREAD_THREAD_PRIORITY)
#define CONFIG_NET_L2_OPENTHREAD 1
#define CONFIG_OPENTHREAD_RADIO_WORKQUEUE_STACK_SIZE 512
#define CONFIG_OPENTHREAD_DEFAULT_RX_SENSITIVITY -100
#define CONFIG_OPENTHREAD_DEFAULT_TX_POWER 0

/* file itself */