Skip to content

Commit ee53359

Browse files
authored
Add custom MRP configs for the esp platform (#33215)
1 parent d7a488f commit ee53359

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

config/esp32/components/chip/Kconfig

+58
Original file line numberDiff line numberDiff line change
@@ -1229,4 +1229,62 @@ menu "CHIP Device Layer"
12291229

12301230
endmenu
12311231

1232+
menu "Message Reliable Protocol Options"
1233+
config MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_THREAD
1234+
int "MRP local active retry interval for Thread network in milliseconds"
1235+
depends on OPENTHREAD_ENABLED
1236+
range 0 3600000
1237+
default 800
1238+
help
1239+
Base retry interval of the present Thread node when it is in the active state.
1240+
1241+
config MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_WIFI_ETHERNET
1242+
int "MRP local active retry interval for WIFI or ETHERNET network in milliseconds"
1243+
depends on !OPENTHREAD_ENABLED
1244+
range 0 3600000
1245+
default 300
1246+
help
1247+
Base retry interval of the present node (WIFI or ETHERNET) when it is in the active state.
1248+
1249+
config MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_THREAD
1250+
int "MRP local idle retry interval for Thread network in milliseconds"
1251+
depends on OPENTHREAD_ENABLED
1252+
range 0 3600000
1253+
default 800
1254+
help
1255+
Base retry interval of the present Thread node when it is in the idle state.
1256+
1257+
config MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_WIFI_ETHERNET
1258+
int "MRP local idle retry interval for WIFI or ETHERNET network in milliseconds"
1259+
depends on !OPENTHREAD_ENABLED
1260+
range 0 3600000
1261+
default 500
1262+
help
1263+
Base retry interval of the present node (WIFI or ETHERNET) when it is in the idle state.
1264+
1265+
config MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_THREAD
1266+
int "MRP retransmission delta timeout for Thread network in milliseconds"
1267+
depends on OPENTHREAD_ENABLED
1268+
range 0 3600000
1269+
default 500
1270+
help
1271+
A constant value added to the calculated retransmission timeout.
1272+
1273+
config MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_WIFI_ETHERNET
1274+
int "MRP retransmission delta timeout for WIFI or ETHERNET network in milliseconds"
1275+
depends on !OPENTHREAD_ENABLED
1276+
range 0 3600000
1277+
default 0
1278+
help
1279+
A constant value added to the calculated retransmission timeout.
1280+
1281+
config MRP_MAX_RETRANS
1282+
int "MRP retransmission maximum count"
1283+
range 1 10
1284+
default 4
1285+
help
1286+
The maximum number of retransmissions before giving up.
1287+
1288+
endmenu
1289+
12321290
endmenu

src/platform/ESP32/CHIPPlatformConfig.h

+34
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,37 @@
107107
// Enable CONFIG_BUILD_FOR_HOST_UNIT_TEST when building CHIP test binaries
108108
#define CONFIG_BUILD_FOR_HOST_UNIT_TEST 1
109109
#endif
110+
111+
#ifndef CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
112+
#if CHIP_ENABLE_OPENTHREAD
113+
#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL \
114+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_THREAD)
115+
#else
116+
#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL \
117+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_WIFI_ETHERNET)
118+
#endif // CHIP_ENABLE_OPENTHREAD
119+
#endif // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
120+
121+
#ifndef CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
122+
#if CHIP_ENABLE_OPENTHREAD
123+
#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL \
124+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_THREAD)
125+
#else
126+
#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL \
127+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_WIFI_ETHERNET)
128+
#endif // CHIP_ENABLE_OPENTHREAD
129+
#endif // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
130+
131+
#ifndef CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
132+
#if CHIP_ENABLE_OPENTHREAD
133+
#define CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST \
134+
chip::System::Clock::Milliseconds32(CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_THREAD)
135+
#else
136+
#define CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST \
137+
chip::System::Clock::Milliseconds32(CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_WIFI_ETHERNET)
138+
#endif // CHIP_ENABLE_OPENTHREAD
139+
#endif // CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
140+
141+
#ifndef CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS
142+
#define CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS CONFIG_MRP_MAX_RETRANS
143+
#endif // CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS

0 commit comments

Comments
 (0)