Here it is ...

Dependencies:   libxDot-mbed5 TSL2561

Fork of Dot-Examples by MultiTech

Committer:
David Gutsch dgutsch@umail.iu.edu
Date:
Wed Jul 25 14:23:40 2018 -0400
Revision:
37:4818522075f8
Parent:
36:5529d26e97e6
Child:
39:0d4362063352
updated, with everything working (pseudo-data)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 1 #include "dot_util.h"
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 2 #include "RadioEvent.h"
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 3
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 4
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 5 #if ACTIVE_EXAMPLE == OTA_EXAMPLE
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 6
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 7 /////////////////////////////////////////////////////////////////////////////
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 8 // -------------------- DOT LIBRARY REQUIRED ------------------------------//
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 9 // * Because these example programs can be used for both mDot and xDot //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 10 // devices, the LoRa stack is not included. The libmDot library should //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 11 // be imported if building for mDot devices. The libxDot library //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 12 // should be imported if building for xDot devices. //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 13 // * https://developer.mbed.org/teams/MultiTech/code/libmDot-dev-mbed5/ //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 14 // * https://developer.mbed.org/teams/MultiTech/code/libmDot-mbed5/ //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 15 // * https://developer.mbed.org/teams/MultiTech/code/libxDot-dev-mbed5/ //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 16 // * https://developer.mbed.org/teams/MultiTech/code/libxDot-mbed5/ //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 17 /////////////////////////////////////////////////////////////////////////////
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 18
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 19 /////////////////////////////////////////////////////////////
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 20 // * these options must match the settings on your gateway //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 21 // * edit their values to match your configuration //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 22 // * frequency sub band is only relevant for the 915 bands //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 23 // * either the network name and passphrase can be used or //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 24 // the network ID (8 bytes) and KEY (16 bytes) //
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 25 /////////////////////////////////////////////////////////////
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 26 static std::string network_name = "MTCDT-19400691";
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 27 static std::string network_passphrase = "MTCDT-19400691";
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 28 static uint8_t network_id[] = { 0x6C, 0x4E, 0xEF, 0x66, 0xF4, 0x79, 0x86, 0xA6 };
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 29 static uint8_t network_key[] = { 0x1F, 0x33, 0xA1, 0x70, 0xA5, 0xF1, 0xFD, 0xA0, 0xAB, 0x69, 0x7A, 0xAE, 0x2B, 0x95, 0x91, 0x6B };
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 30 static uint8_t frequency_sub_band = 1;
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 31 static lora::NetworkType public_network;// = lora::PUBLIC_LORAWAN;
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 32 static uint8_t join_delay = 1;
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 33 static uint8_t ack = 0;
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 34 static bool adr = true;
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 35
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 36 // deepsleep consumes slightly less current than sleep
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 37 // in sleep mode, IO state is maintained, RAM is retained, and application will resume after waking up
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 38 // in deepsleep mode, IOs float, RAM is lost, and application will start from beginning after waking up
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 39 // if deep_sleep == true, device will enter deepsleep mode
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 40 static bool deep_sleep = false;
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 41
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 42 mDot* dot = NULL;
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 43 lora::ChannelPlan* plan = NULL;
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 44
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 45
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 46 Serial pc(PA_9, PA_10);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 47
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 48 int main() {
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 49 pc.baud(115200);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 50 pc.printf("main started \r\n");
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 51 // Custom event handler for automatically displaying RX data
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 52 RadioEvent events;
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 53
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 54
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 55
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 56 mts::MTSLog::setLogLevel(mts::MTSLog::TRACE_LEVEL);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 57
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 58 #if CHANNEL_PLAN == CP_US915
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 59 plan = new lora::ChannelPlan_US915();
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 60 #elif CHANNEL_PLAN == CP_AU915
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 61 plan = new lora::ChannelPlan_AU915();
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 62 #elif CHANNEL_PLAN == CP_EU868
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 63 plan = new lora::ChannelPlan_EU868();
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 64 #elif CHANNEL_PLAN == CP_KR920
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 65 plan = new lora::ChannelPlan_KR920();
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 66 #elif CHANNEL_PLAN == CP_AS923
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 67 plan = new lora::ChannelPlan_AS923();
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 68 #elif CHANNEL_PLAN == CP_AS923_JAPAN
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 69 plan = new lora::ChannelPlan_AS923_Japan();
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 70 #elif CHANNEL_PLAN == CP_IN865
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 71 plan = new lora::ChannelPlan_IN865();
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 72 #endif
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 73 assert(plan);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 74
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 75 dot = mDot::getInstance(plan);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 76 assert(dot);
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 77
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 78
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 79 // attach the custom events handler
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 80 dot->setEvents(&events);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 81
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 82 if (!dot->getStandbyFlag()) {
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 83 logInfo("mbed-os library version: %d", MBED_LIBRARY_VERSION);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 84
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 85 // start from a well-known state
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 86 logInfo("defaulting Dot configuration");
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 87 dot->resetConfig();
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 88 dot->resetNetworkSession();
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 89
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 90 // set the data_rate
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 91 dot->setTxDataRate(lora::DR_1);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 92
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 93 // make sure library logging is turned on
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 94 dot->setLogLevel(mts::MTSLog::INFO_LEVEL);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 95
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 96 // update configuration if necessary
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 97 if (dot->getJoinMode() != mDot::OTA) {
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 98 logInfo("changing network join mode to OTA");
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 99 if (dot->setJoinMode(mDot::OTA) != mDot::MDOT_OK) {
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 100 logError("failed to set network join mode to OTA");
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 101 }
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 102 }
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 103 // in OTA and AUTO_OTA join modes, the credentials can be passed to the library as a name and passphrase or an ID and KEY
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 104 // only one method or the other should be used!
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 105 // network ID = crc64(network name)
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 106 // network KEY = cmac(network passphrase)
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 107 update_ota_config_name_phrase(network_name, network_passphrase, frequency_sub_band, public_network, ack);
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 108 //update_ota_config_id_key(network_id, network_key, frequency_sub_band, public_network, ack);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 109
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 110 // configure network link checks
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 111 // 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
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 112 // check the link every count packets
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 113 // declare the Dot disconnected after threshold failed link checks
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 114 // for count = 3 and threshold = 5, the Dot will ask for a link check response every 5 packets and will consider the connection lost if it fails to receive 3 responses in a row
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 115 update_network_link_check_config(3, 5);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 116
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 117 // enable or disable Adaptive Data Rate
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 118 dot->setAdr(adr);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 119
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 120 // Configure the join delay
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 121 dot->setJoinDelay(join_delay);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 122
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 123 pc.printf("network information set\r\n");
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 124
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 125 // save changes to configuration
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 126 logInfo("saving configuration");
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 127 if (!dot->saveConfig()) {
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 128 logError("failed to save configuration");
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 129 }
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 130
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 131 // display configuration
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 132 display_config();
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 133 } else {
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 134 // restore the saved session if the dot woke from deepsleep mode
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 135 // useful to use with deepsleep because session info is otherwise lost when the dot enters deepsleep
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 136 logInfo("restoring network session from NVM");
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 137 dot->restoreNetworkSession();
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 138 }
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 139
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 140 uint8_t counter = 0;
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 141 std::vector<uint8_t> tx_data;
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 142 char buffer[5];
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 143
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 144 while (true) {
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 145
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 146 // join network if not joined
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 147 if (!dot->getNetworkJoinStatus()) {
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 148 pc.printf("joining lora network.\r\n");
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 149 join_network(&pc);
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 150 }
David Gutsch dgutsch@umail.iu.edu 37:4818522075f8 151
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 152
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 153 // hourly loop
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 154 while( counter < 12) {
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 155
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 156 uint8_t light_data = get_light_data();
David Gutsch dgutsch@umail.iu.edu 37:4818522075f8 157 //pc.printf("pseudo-light data: %d\r\n", light_data);
David Gutsch dgutsch@umail.iu.edu 37:4818522075f8 158 pc.printf("\r\nhour: %d\r\n", ++counter);
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 159
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 160
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 161 // clean out char buffer
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 162 strcpy(buffer, "XXXX");
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 163
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 164 // convert to ascii char && push to vector
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 165 ascii_converter(buffer, light_data, &tx_data, &pc);
David Gutsch dgutsch@umail.iu.edu 37:4818522075f8 166 pc.printf("char buffer: %s\r\n", buffer);
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 167
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 168 if( counter < 12)
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 169 tx_data.push_back(' ');
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 170
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 171
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 172 // if going into deepsleep mode, save the session so we don't need to join again after waking up
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 173 // not necessary if going into sleep mode since RAM is retained
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 174 if (deep_sleep) {
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 175 logInfo("saving network session to NVM");
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 176 dot->saveNetworkSession();
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 177 }
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 178
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 179 // ONLY ONE of the three functions below should be uncommented depending on the desired wakeup method
David Gutsch dgutsch@umail.iu.edu 37:4818522075f8 180 sleep_wake_rtc_only(deep_sleep, 30, &pc);
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 181 //sleep_wake_interrupt_only(deep_sleep);
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 182 //sleep_wake_rtc_or_interrupt(deep_sleep);
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 183 }
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 184
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 185 //print vector data
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 186 pc.printf("vector data:");
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 187
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 188 for(std::vector<uint8_t>::const_iterator iter = tx_data.begin(); iter != tx_data.end(); ++iter) {
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 189 pc.printf(" %c",*iter);
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 190 }
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 191 pc.printf("\r\n");
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 192
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 193 pc.printf("capacity tx_data: %d\r\n", tx_data.capacity());
David Gutsch dgutsch@umail.iu.edu 37:4818522075f8 194 //tx_data.reserve(tx_data.size());
David Gutsch dgutsch@umail.iu.edu 37:4818522075f8 195 //pc.printf("cap resized: %d\r\n", tx_data.capacity());
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 196 pc.printf("sized tx_data: %d\r\n", tx_data.size());
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 197 //actually send the data
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 198 pc.printf("sending data\r\n");
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 199
David Gutsch dgutsch@umail.iu.edu 37:4818522075f8 200
David Gutsch dgutsch@umail.iu.edu 37:4818522075f8 201 // set the data_rate (from forum)
David Gutsch dgutsch@umail.iu.edu 37:4818522075f8 202 dot->setTxDataRate(lora::DR_1);
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 203 int retVal = send_data(tx_data, &pc);
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 204 //while(retVal == 1)
David Gutsch dgutsch@umail.iu.edu 36:5529d26e97e6 205 //retVal = send_data(tx_data, &pc);
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 206
David Gutsch dgutsch@umail.iu.edu 35:b51d482e9731 207 // erase vector data & reset counter
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 208 tx_data.erase(tx_data.begin(), tx_data.end());
David Gutsch dgutsch@umail.iu.edu 33:79e4c812d91d 209 counter = 0;
David Gutsch dgutsch@umail.iu.edu 37:4818522075f8 210 pc.printf("deleted tx_data and reset counter\r\ncap: %d size: %d\r\n", tx_data.capacity(), tx_data.size());
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 211
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 212 }
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 213
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 214 return 0;
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 215 }
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 216
David Gutsch dgutsch@umail.iu.edu 32:cc05a2e80969 217 #endif