Senet fork
Dependencies: libxDot-mbed5 ISL29011
Fork of Dot-Examples by
Revision 17:50b6694ba62f, committed 2016-10-31
- Comitter:
- shaunkrnelson
- Date:
- Mon Oct 31 18:23:19 2016 +0000
- Parent:
- 16:a3832552dfe1
- Child:
- 18:30f96328cfea
- Child:
- 19:346e72331db6
- Commit message:
- Senet OTAA Configuration
Changed in this revision
--- a/examples/example_config.h Wed Oct 19 11:53:17 2016 -0500 +++ b/examples/example_config.h Mon Oct 31 18:23:19 2016 +0000 @@ -8,6 +8,6 @@ #define CLASS_C_EXAMPLE 5 // see class_c_example.cpp // the active example is the one that will be compiled -#define ACTIVE_EXAMPLE OTA_EXAMPLE +#define ACTIVE_EXAMPLE AUTO_OTA_EXAMPLE #endif \ No newline at end of file
--- a/examples/src/auto_ota_example.cpp Wed Oct 19 11:53:17 2016 -0500 +++ b/examples/src/auto_ota_example.cpp Mon Oct 31 18:23:19 2016 +0000 @@ -12,10 +12,10 @@ ///////////////////////////////////////////////////////////// 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 network_id[] = { 0x00, 0x25, 0x0C, 0x00, 0x00, 0x01, 0x00, 0x01 }; +static uint8_t network_key[] = { 0x2D, 0xB6, 0xFF, 0x53, 0x57, 0x8C, 0x24, 0x62, 0x3A, 0xA3, 0xBD, 0xAA, 0x7A, 0x83, 0x69, 0x48}; static uint8_t frequency_sub_band = 0; -static bool public_network = false; +static bool public_network = true; static uint8_t ack = 0; // deepsleep consumes slightly less current than sleep @@ -25,23 +25,41 @@ static bool deep_sleep = true; mDot* dot = NULL; - Serial pc(USBTX, USBRX); #if defined(TARGET_XDOT_L151CC) + I2C i2c(I2C_SDA, I2C_SCL); ISL29011 lux(i2c); #else AnalogIn lux(XBEE_AD0); #endif +//#define TEST +#ifdef TEST +int main() { + + pc.baud(115200); + mts::MTSLog::setLogLevel(mts::MTSLog::TRACE_LEVEL); + + while(true) + { + pc.printf("pc.printf(Hello World!)\r\n"); + logInfo("logInfo(HelloWorld!)\r\n"); + wait(5); + } + return 0; +} + +#else + int main() { // Custom event handler for automatically displaying RX data RadioEvent events; pc.baud(115200); - mts::MTSLog::setLogLevel(mts::MTSLog::TRACE_LEVEL); + logInfo("%d:%s\r\n",__LINE__,__func__); dot = mDot::getInstance(); @@ -71,15 +89,15 @@ // 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_id, network_key, frequency_sub_band, public_network, ack); + //update_ota_config_name_phrase(network_name, network_passphrase, frequency_sub_band, public_network, ack); + update_ota_config_id_key(network_id, network_key, frequency_sub_band, public_network, 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 // check the link every count packets // declare the Dot disconnected after threshold failed link checks // for count = 3 and threshold = 5, the Dot will be considered disconnected after 15 missed packets in a row - update_network_link_check_config(3, 5); + //update_network_link_check_config(3, 5); // save changes to configuration logInfo("saving configuration"); @@ -132,5 +150,5 @@ return 0; } - #endif +#endif
--- a/examples/src/ota_example.cpp Wed Oct 19 11:53:17 2016 -0500 +++ b/examples/src/ota_example.cpp Mon Oct 31 18:23:19 2016 +0000 @@ -12,10 +12,10 @@ ///////////////////////////////////////////////////////////// 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 network_id[] = { 0x00, 0x25, 0x0C, 0x00, 0x00, 0x01, 0x00, 0x01 }; +static uint8_t network_key[] = {0x2D,0xB6,0xFF,0x53,0x57,0x8C,0x24,0x62,0x3A,0xA3,0xBD,0xAA,0x7A,0x83,0x69,0x48}; static uint8_t frequency_sub_band = 0; -static bool public_network = false; +static bool public_network = true; static uint8_t ack = 0; // deepsleep consumes slightly less current than sleep @@ -70,15 +70,15 @@ // 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_id, network_key, frequency_sub_band, public_network, ack); + //update_ota_config_name_phrase(network_name, network_passphrase, frequency_sub_band, public_network, ack); + update_ota_config_id_key(network_id, network_key, frequency_sub_band, public_network, 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 // check the link every count packets // declare the Dot disconnected after threshold failed link checks // for count = 3 and threshold = 5, the Dot will be considered disconnected after 15 missed packets in a row - update_network_link_check_config(3, 5); + //update_network_link_check_config(3, 5); // save changes to configuration logInfo("saving configuration");
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libxDot-mbed5.lib Mon Oct 31 18:23:19 2016 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/MultiTech/code/libxDot-mbed5/#aff2c05aacce
--- a/mbed-os.lib Wed Oct 19 11:53:17 2016 -0500 +++ b/mbed-os.lib Mon Oct 31 18:23:19 2016 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#670b0984ebf1207771ef5afbc1c64f85af349da1 +https://github.com/ARMmbed/mbed-os/#a6f3fd1a60d5df59246d7caf3f108c4d34e1808e