Skip to content

Commit 7a469fd

Browse files
authored
ESP32: add custom MRP configs for esp platform (project-chip#33355)
1 parent f52860e commit 7a469fd

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
@@ -1086,4 +1086,62 @@ menu "CHIP Device Layer"
10861086

10871087
endmenu
10881088

1089+
menu "Message Reliable Protocol Options"
1090+
config MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_THREAD
1091+
int "MRP local active retry interval for Thread network in milliseconds"
1092+
depends on OPENTHREAD_ENABLED
1093+
range 0 3600000
1094+
default 800
1095+
help
1096+
Base retry interval of the present Thread node when it is in the active state.
1097+
1098+
config MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_WIFI_ETHERNET
1099+
int "MRP local active retry interval for WIFI or ETHERNET network in milliseconds"
1100+
depends on !OPENTHREAD_ENABLED
1101+
range 0 3600000
1102+
default 300
1103+
help
1104+
Base retry interval of the present node (WIFI or ETHERNET) when it is in the active state.
1105+
1106+
config MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_THREAD
1107+
int "MRP local idle retry interval for Thread network in milliseconds"
1108+
depends on OPENTHREAD_ENABLED
1109+
range 0 3600000
1110+
default 800
1111+
help
1112+
Base retry interval of the present Thread node when it is in the idle state.
1113+
1114+
config MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_WIFI_ETHERNET
1115+
int "MRP local idle retry interval for WIFI or ETHERNET network in milliseconds"
1116+
depends on !OPENTHREAD_ENABLED
1117+
range 0 3600000
1118+
default 500
1119+
help
1120+
Base retry interval of the present node (WIFI or ETHERNET) when it is in the idle state.
1121+
1122+
config MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_THREAD
1123+
int "MRP retransmission delta timeout for Thread network in milliseconds"
1124+
depends on OPENTHREAD_ENABLED
1125+
range 0 3600000
1126+
default 500
1127+
help
1128+
A constant value added to the calculated retransmission timeout.
1129+
1130+
config MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_WIFI_ETHERNET
1131+
int "MRP retransmission delta timeout for WIFI or ETHERNET network in milliseconds"
1132+
depends on !OPENTHREAD_ENABLED
1133+
range 0 3600000
1134+
default 0
1135+
help
1136+
A constant value added to the calculated retransmission timeout.
1137+
1138+
config MRP_MAX_RETRANS
1139+
int "MRP retransmission maximum count"
1140+
range 1 10
1141+
default 4
1142+
help
1143+
The maximum number of retransmissions before giving up.
1144+
1145+
endmenu
1146+
10891147
endmenu

src/platform/ESP32/CHIPPlatformConfig.h

+34
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,37 @@
9595
#endif // CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC
9696

9797
#endif // CONFIG_ENABLE_ICD_SERVER
98+
99+
#ifndef CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
100+
#if CHIP_ENABLE_OPENTHREAD
101+
#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL \
102+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_THREAD)
103+
#else
104+
#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL \
105+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_WIFI_ETHERNET)
106+
#endif // CHIP_ENABLE_OPENTHREAD
107+
#endif // CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
108+
109+
#ifndef CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
110+
#if CHIP_ENABLE_OPENTHREAD
111+
#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL \
112+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_THREAD)
113+
#else
114+
#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL \
115+
chip::System::Clock::Milliseconds32(CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_WIFI_ETHERNET)
116+
#endif // CHIP_ENABLE_OPENTHREAD
117+
#endif // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL
118+
119+
#ifndef CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
120+
#if CHIP_ENABLE_OPENTHREAD
121+
#define CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST \
122+
chip::System::Clock::Milliseconds32(CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_THREAD)
123+
#else
124+
#define CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST \
125+
chip::System::Clock::Milliseconds32(CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_WIFI_ETHERNET)
126+
#endif // CHIP_ENABLE_OPENTHREAD
127+
#endif // CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
128+
129+
#ifndef CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS
130+
#define CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS CONFIG_MRP_MAX_RETRANS
131+
#endif // CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS

0 commit comments

Comments
 (0)