Parameter file containing MQTT topics as shown below, is read into StaticJsonDocument<1250> DOC
variable.
Size of some groups may differ between MCU's, for example sub_topics_win
may contain more topics, if MCU is 8 relay unit. For that I need the flexibility to read a specific topic that can differ in size.
What is the rifht way to do it?
{
"pub_gen_topics": [
"myHome/Messages",
"myHome/log",
"myHome/debug"
],
"pub_topics": [
"myHome/Cont_A/Avail",
"myHome/Cont_A/State"
],
"sub_topics": [
"myHome/Cont_A",
"myHome/All",
"myHome/lockdown"
],
"sub_topics_win": [
"myHome/Windows/gFloor/TwinWindow",
"myHome/Windows/gFloor/Pergola"
],
"sub_topics_SW": [
"myHome/Light/int/gFloor/SalAmbient1",
"myHome/Light/int/gFloor/SalAmbient2",
"myHome/Light/int/gFloor/Lobby",
"myHome/Light/int/gFloor/Corridor"
],
"sub_topics_win_g": [
"myHome/Windows",
"myHome/Windows/gFloor"
],
"sub_topics_SW_g": [
"myHome/Light",
"myHome/Light/int",
"myHome/Light/int/gFloor/"
],
"ver": 0.1
}
DOC["pub_gen_topics"]
, for example, as an array and usingsize()
to get its size, without any luck.