Thanh Nguyen
/
Alarm3Sensors_240220
no
Diff: examples/src/ota_example.cpp
- Revision:
- 33:63c42cbe3459
- Parent:
- 31:b1d5811e3d5d
--- a/examples/src/ota_example.cpp Thu Sep 13 15:32:55 2018 -0500 +++ b/examples/src/ota_example.cpp Mon Feb 24 07:38:20 2020 +0000 @@ -22,10 +22,14 @@ // * either the network name and passphrase can be used or // // the network ID (8 bytes) and KEY (16 bytes) // ///////////////////////////////////////////////////////////// -static std::string network_name = "MultiTech"; -static std::string network_passphrase = "MultiTech"; -static uint8_t network_id[] = { 0x6C, 0x4E, 0xEF, 0x66, 0xF4, 0x79, 0x86, 0xA6 }; -static uint8_t network_key[] = { 0x1F, 0x33, 0xA1, 0x70, 0xA5, 0xF1, 0xFD, 0xA0, 0xAB, 0x69, 0x7A, 0xAE, 0x2B, 0x95, 0x91, 0x6B }; +//static std::string network_name = "MultiTech"; +//static std::string network_passphrase = "MultiTech"; +//static uint8_t network_id[] = { 0x6C, 0x4E, 0xEF, 0x66, 0xF4, 0x79, 0x86, 0xA6 }; +//static uint8_t network_key[] = { 0x1F, 0x33, 0xA1, 0x70, 0xA5, 0xF1, 0xFD, 0xA0, 0xAB, 0x69, 0x7A, 0xAE, 0x2B, 0x95, 0x91, 0x6B }; +static std::string network_name = ""; +static std::string network_passphrase = ""; +static uint8_t network_id[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC }; +static uint8_t network_key[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC }; static uint8_t frequency_sub_band = 0; static lora::NetworkType network_type = lora::PUBLIC_LORAWAN; static uint8_t join_delay = 5; @@ -61,6 +65,7 @@ #endif mts::MTSLog::setLogLevel(mts::MTSLog::TRACE_LEVEL); + logDebug("START..................................... "); #if CHANNEL_PLAN == CP_US915 plan = new lora::ChannelPlan_US915(); @@ -76,6 +81,8 @@ plan = new lora::ChannelPlan_AS923_Japan(); #elif CHANNEL_PLAN == CP_IN865 plan = new lora::ChannelPlan_IN865(); +#elif CHANNEL_PLAN == CP_XX919 + plan = new lora::ChannelPlan_VN919(); #endif assert(plan); @@ -107,8 +114,8 @@ // only one method or the other should be used! // network ID = crc64(network name) // network KEY = cmac(network passphrase) - update_ota_config_name_phrase(network_name, network_passphrase, frequency_sub_band, network_type, ack); - //update_ota_config_id_key(network_id, network_key, frequency_sub_band, network_type, ack); + // update_ota_config_name_phrase(network_name, network_passphrase, frequency_sub_band, network_type, ack); + update_ota_config_id_key(network_id, network_key, frequency_sub_band, network_type, ack); // configure network link checks // network link checks are a good alternative to requiring the gateway to ACK every packet and should allow a single gateway to handle more Dots