Skip to content

Commit cb6604f

Browse files
authored
ESP32: add custom MRP configs for esp platform (project-chip#33356)
1 parent 3d306d7 commit cb6604f

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
@@ -99,3 +99,37 @@
9999
#ifdef CONFIG_CHIP_ENABLE_BDX_LOG_TRANSFER
100100
#define CHIP_CONFIG_ENABLE_BDX_LOG_TRANSFER 1
101101
#endif // CONFIG_CHIP_ENABLE_BDX_LOG_TRANSFER
102+
103+
#ifndef CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
104+
#if CHIP_ENABLE_OPENTHREAD
105+
#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL \
106+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_THREAD)
107+
#else
108+
#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL \
109+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_WIFI_ETHERNET)
110+
#endif // CHIP_ENABLE_OPENTHREAD
111+
#endif // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
112+
113+
#ifndef CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
114+
#if CHIP_ENABLE_OPENTHREAD
115+
#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL \
116+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_THREAD)
117+
#else
118+
#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL \
119+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_WIFI_ETHERNET)
120+
#endif // CHIP_ENABLE_OPENTHREAD
121+
#endif // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
122+
123+
#ifndef CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
124+
#if CHIP_ENABLE_OPENTHREAD
125+
#define CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST \
126+
chip::System::Clock::Milliseconds32(CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_THREAD)
127+
#else
128+
#define CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST \
129+
chip::System::Clock::Milliseconds32(CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_WIFI_ETHERNET)
130+
#endif // CHIP_ENABLE_OPENTHREAD
131+
#endif // CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
132+
133+
#ifndef CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS
134+
#define CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS CONFIG_MRP_MAX_RETRANS
135+
#endif // CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS

0 commit comments

Comments
 (0)