Version del programa usado para la Expo IOT 2018 - Strada Hotel
Dependencies: DHT HX711 libmDot-mbed5 ISL29011
Fork of Dot-Examples by
Diff: examples/src/auto_ota_example.cpp
- Revision:
- 5:97ed5f2f099e
- Parent:
- 3:0e3e776e2862
- Child:
- 9:72d3203279b2
--- a/examples/src/auto_ota_example.cpp Thu Oct 06 22:12:21 2016 +0000 +++ b/examples/src/auto_ota_example.cpp Fri Oct 07 10:38:54 2016 -0500 @@ -2,13 +2,17 @@ #if ACTIVE_EXAMPLE == AUTO_OTA_EXAMPLE -/////////////////////////////////////////////////////////// -// these options must match the settings on your gateway // -// edit their values to match your configuration // -// frequency sub band is only relevant for the 915 bands // -/////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////// +// * these options must match the settings on your gateway // +// * edit their values to match your configuration // +// * frequency sub band is only relevant for the 915 bands // +// * 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 uint8_t frequency_sub_band = 0; static bool public_network = false; static uint8_t ack = 1; @@ -48,7 +52,12 @@ logError("failed to set network join mode to AUTO_OTA"); } } - update_ota_config(network_name, network_passphrase, frequency_sub_band, public_network, ack); + // in OTA and AUTO_OTA join modes, the credentials can be passed to the library as a name and passphrase or an EUI and KEY + // 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, public_network, ack); + //update_ota_config_id_key(network_eui, network_key, frequency_sub_band, public_network, ack); // save changes to configuration // AUTO_OTA must be the saved join mode in order for the session to be properly restored after waking up from deepsleep