I am trying to make an ESP32 application by combining the examples of `ot_cli` and `ot_rcp`. I want to compile a firmware where the device can operate both as a JOINER and in RCP mode. Of course the application will never be in both states, but I want to compile with the possibility of using both these states and dynamically on runtime choose which version to initialize.
I noticed that when I enable these configuration options simultaneously the firmware cannot be compiled:
Code: Select all
CONFIG_OPENTHREAD_RADIO=y
CONFIG_OPENTHREAD_JOINER=y
Code: Select all
CONFIG_OPENTHREAD_RADIO=n
CONFIG_OPENTHREAD_JOINER=y
Code: Select all
CONFIG_OPENTHREAD_RADIO=y
CONFIG_OPENTHREAD_JOINER=n
Code: Select all
#if CONFIG_OPENTHREAD_JOINER
#error "Joiner shouldn't be enabled for RCP"
#endif
I also noticed that even if I suppress the error above and enable both RADIO and JOINER
Code: Select all
CONFIG_OPENTHREAD_RADIO=y
CONFIG_OPENTHREAD_JOINER=y
My question is if there is any reason that it is not allowed to compile for both these modes. Of course I understand why I cannot use both these modes simultaneously, I just want to allow compiling for both and choose on runtime which one to initialize. Is there a limitation on that based on the way the openthread library works? Can I just modify the CMake files myself and to compile succesfully or is there a reason that I cannot do that?
Has anyone ever encountered this scenario in the past, I am curious to hear how you solved this.