Basic xdot code to check how many memory is available for user APP after initializing libxdot lorawan stack
Diff: examples/src/dot_util.cpp
- Revision:
- 42:20f6b29a9903
- Parent:
- 33:15ea8f985c54
--- a/examples/src/dot_util.cpp Mon May 18 13:12:47 2020 -0500 +++ b/examples/src/dot_util.cpp Tue May 25 09:54:33 2021 -0500 @@ -12,6 +12,39 @@ #endif +lora::ChannelPlan* create_channel_plan() { + lora::ChannelPlan* plan; + +#if CHANNEL_PLAN == CP_US915 + plan = new lora::ChannelPlan_US915(); +#elif CHANNEL_PLAN == CP_AU915 + plan = new lora::ChannelPlan_AU915(); +#elif CHANNEL_PLAN == CP_EU868 + plan = new lora::ChannelPlan_EU868(); +#elif CHANNEL_PLAN == CP_KR920 + plan = new lora::ChannelPlan_KR920(); +#elif CHANNEL_PLAN == CP_IN865 + plan = new lora::ChannelPlan_IN865(); +#elif CHANNEL_PLAN == CP_AS923 + plan = new lora::ChannelPlan_AS923(); +#elif CHANNEL_PLAN == CP_AS923_2 + plan = new lora::ChannelPlan_AS923(); +#elif CHANNEL_PLAN == CP_AS923_3 + plan = new lora::ChannelPlan_AS923(); +#elif CHANNEL_PLAN == CP_AS923_JAPAN + plan = new lora::ChannelPlan_AS923_Japan(); +#elif CHANNEL_PLAN == CP_AS923_JAPAN1 + plan = new lora::ChannelPlan_AS923_Japan1(); +#elif CHANNEL_PLAN == CP_AS923_JAPAN2 + plan = new lora::ChannelPlan_AS923_Japan2(); +#elif CHANNEL_PLAN == CP_RU864 + plan = new lora::ChannelPlan_RU864(); +#endif + + return plan; +} + + void display_config() { // display configuration and library version information logInfo("====================="); @@ -301,7 +334,7 @@ uint32_t delay_s = (dot->getNextTxMs() / 1000) + 1; if (delay_s < 5) { logInfo("waiting %lu s until next free channel", delay_s); - wait(delay_s); + ThisThread::sleep_for(std::chrono::seconds(delay_s)); } else { logInfo("sleeping %lu s until next free channel", delay_s); dot->sleep(delay_s, mDot::RTC_ALARM, false);