Demonstration connecting an xDot to Telit Devicewise using the libxDot-mbed5 library.
Dependencies: ISL29011 libxDot-mbed5
main.cpp@0:dd2c9d4723e7, 2017-08-01 (annotated)
- Committer:
- pferland
- Date:
- Tue Aug 01 21:37:30 2017 +0000
- Revision:
- 0:dd2c9d4723e7
Initial Commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pferland | 0:dd2c9d4723e7 | 1 | /*================================================================================ |
pferland | 0:dd2c9d4723e7 | 2 | * |
pferland | 0:dd2c9d4723e7 | 3 | * CLASIFICATION: **** PUBLIC RELEASE AS-IS APPLICATION EXAMPLE **** |
pferland | 0:dd2c9d4723e7 | 4 | * |
pferland | 0:dd2c9d4723e7 | 5 | * SOURCE FILE NAME: main.cpp |
pferland | 0:dd2c9d4723e7 | 6 | * |
pferland | 0:dd2c9d4723e7 | 7 | * DESCRIPTIVE NAME: MBED Source for MultiTech mDot, EVB, and MDOT-BOX Devices |
pferland | 0:dd2c9d4723e7 | 8 | * |
pferland | 0:dd2c9d4723e7 | 9 | * COPYRIGHT: Copyright 2014-2017, Telit |
pferland | 0:dd2c9d4723e7 | 10 | * |
pferland | 0:dd2c9d4723e7 | 11 | ** WEB SITE: www.telit.com |
pferland | 0:dd2c9d4723e7 | 12 | * |
pferland | 0:dd2c9d4723e7 | 13 | * WRITTEN BY: John Keever |
pferland | 0:dd2c9d4723e7 | 14 | * |
pferland | 0:dd2c9d4723e7 | 15 | * DATE: 27 July, 2017 |
pferland | 0:dd2c9d4723e7 | 16 | * |
pferland | 0:dd2c9d4723e7 | 17 | * VERSION: 1.00 |
pferland | 0:dd2c9d4723e7 | 18 | * |
pferland | 0:dd2c9d4723e7 | 19 | * FUNCTION: Provide working example for LoRa 'Sensor-to-Cloud' |
pferland | 0:dd2c9d4723e7 | 20 | * Demonstration using MultiTech LoRa Starter Kit and |
pferland | 0:dd2c9d4723e7 | 21 | * Telit Data and Cloud Platform Services Offerings |
pferland | 0:dd2c9d4723e7 | 22 | * |
pferland | 0:dd2c9d4723e7 | 23 | * SOURCE FILE TYPE: MBED C++ |
pferland | 0:dd2c9d4723e7 | 24 | * |
pferland | 0:dd2c9d4723e7 | 25 | * FUNCTIONS/ENTRY POINTS: main |
pferland | 0:dd2c9d4723e7 | 26 | * |
pferland | 0:dd2c9d4723e7 | 27 | * INPUT = None. |
pferland | 0:dd2c9d4723e7 | 28 | * OUTPUT = None. |
pferland | 0:dd2c9d4723e7 | 29 | * |
pferland | 0:dd2c9d4723e7 | 30 | * EXIT-NORMAL = N/A |
pferland | 0:dd2c9d4723e7 | 31 | * EXIT-ERROR = N/A |
pferland | 0:dd2c9d4723e7 | 32 | * |
pferland | 0:dd2c9d4723e7 | 33 | * EXTERNAL REFERENCES = None. |
pferland | 0:dd2c9d4723e7 | 34 | * |
pferland | 0:dd2c9d4723e7 | 35 | * EXTERNAL FUNCTIONS = None. |
pferland | 0:dd2c9d4723e7 | 36 | * |
pferland | 0:dd2c9d4723e7 | 37 | * CONTROL BLOCKS = None. |
pferland | 0:dd2c9d4723e7 | 38 | * |
pferland | 0:dd2c9d4723e7 | 39 | *================================================================================*/ |
pferland | 0:dd2c9d4723e7 | 40 | /* LEGAL DISCLAIMER */ |
pferland | 0:dd2c9d4723e7 | 41 | /*================================================================================ |
pferland | 0:dd2c9d4723e7 | 42 | |
pferland | 0:dd2c9d4723e7 | 43 | Redistribution and use in source and binary forms, with or without |
pferland | 0:dd2c9d4723e7 | 44 | modification, are permitted provided that the following conditions |
pferland | 0:dd2c9d4723e7 | 45 | are met: |
pferland | 0:dd2c9d4723e7 | 46 | |
pferland | 0:dd2c9d4723e7 | 47 | Neither the name of ILS Technology nor Telit nor the names of its |
pferland | 0:dd2c9d4723e7 | 48 | contributors may be used to endorse or promote products derived |
pferland | 0:dd2c9d4723e7 | 49 | from this software without specific prior written permission. |
pferland | 0:dd2c9d4723e7 | 50 | |
pferland | 0:dd2c9d4723e7 | 51 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
pferland | 0:dd2c9d4723e7 | 52 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
pferland | 0:dd2c9d4723e7 | 53 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
pferland | 0:dd2c9d4723e7 | 54 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
pferland | 0:dd2c9d4723e7 | 55 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
pferland | 0:dd2c9d4723e7 | 56 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
pferland | 0:dd2c9d4723e7 | 57 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
pferland | 0:dd2c9d4723e7 | 58 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
pferland | 0:dd2c9d4723e7 | 59 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
pferland | 0:dd2c9d4723e7 | 60 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
pferland | 0:dd2c9d4723e7 | 61 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
pferland | 0:dd2c9d4723e7 | 62 | |
pferland | 0:dd2c9d4723e7 | 63 | *================================================================================*/ |
pferland | 0:dd2c9d4723e7 | 64 | /* CHANGE LOG */ |
pferland | 0:dd2c9d4723e7 | 65 | /*================================================================================*/ |
pferland | 0:dd2c9d4723e7 | 66 | /* |Changed | | */ |
pferland | 0:dd2c9d4723e7 | 67 | /* Date | by |Version ID| Comments */ |
pferland | 0:dd2c9d4723e7 | 68 | /*----------+--------+----------+-------------------------------------------------*/ |
pferland | 0:dd2c9d4723e7 | 69 | /*07-27-2017|JEK |V1.00 |Original Version - xDot (Light Sensor, S2 Button)*/ |
pferland | 0:dd2c9d4723e7 | 70 | /* | | | */ |
pferland | 0:dd2c9d4723e7 | 71 | /*================================================================================*/ |
pferland | 0:dd2c9d4723e7 | 72 | /*NOTE: Please keep the change log up to date!!! */ |
pferland | 0:dd2c9d4723e7 | 73 | /*================================================================================*/ |
pferland | 0:dd2c9d4723e7 | 74 | |
pferland | 0:dd2c9d4723e7 | 75 | #include "mbed.h" |
pferland | 0:dd2c9d4723e7 | 76 | #include "mDot.h" |
pferland | 0:dd2c9d4723e7 | 77 | #include "rtos.h" |
pferland | 0:dd2c9d4723e7 | 78 | #include "ChannelPlans.h" |
pferland | 0:dd2c9d4723e7 | 79 | |
pferland | 0:dd2c9d4723e7 | 80 | #include "ISL29011.h" |
pferland | 0:dd2c9d4723e7 | 81 | |
pferland | 0:dd2c9d4723e7 | 82 | #include <cmath> |
pferland | 0:dd2c9d4723e7 | 83 | #include <string> |
pferland | 0:dd2c9d4723e7 | 84 | #include <vector> |
pferland | 0:dd2c9d4723e7 | 85 | #include <ctime> |
pferland | 0:dd2c9d4723e7 | 86 | |
pferland | 0:dd2c9d4723e7 | 87 | #ifndef CHANNEL_PLAN |
pferland | 0:dd2c9d4723e7 | 88 | #define CHANNEL_PLAN CP_US915 |
pferland | 0:dd2c9d4723e7 | 89 | #endif |
pferland | 0:dd2c9d4723e7 | 90 | |
pferland | 0:dd2c9d4723e7 | 91 | static volatile bool timer_irq_triggered = false; |
pferland | 0:dd2c9d4723e7 | 92 | static volatile bool ff_irq_triggered = false; |
pferland | 0:dd2c9d4723e7 | 93 | |
pferland | 0:dd2c9d4723e7 | 94 | //static std::string config_network_name = "MTCDT-19186797"; |
pferland | 0:dd2c9d4723e7 | 95 | //static std::string config_network_pass = "MTCDT-19186797"; |
pferland | 0:dd2c9d4723e7 | 96 | //static uint8_t config_frequency_sub_band = 1; |
pferland | 0:dd2c9d4723e7 | 97 | |
pferland | 0:dd2c9d4723e7 | 98 | static std::string config_network_name = "MTCDT-19186799"; |
pferland | 0:dd2c9d4723e7 | 99 | static std::string config_network_pass = "MTCDT-19186799"; |
pferland | 0:dd2c9d4723e7 | 100 | static uint8_t config_frequency_sub_band = 1; |
pferland | 0:dd2c9d4723e7 | 101 | |
pferland | 0:dd2c9d4723e7 | 102 | uint8_t result; |
pferland | 0:dd2c9d4723e7 | 103 | uint8_t data; |
pferland | 0:dd2c9d4723e7 | 104 | uint8_t sf_val = mDot::DR2; |
pferland | 0:dd2c9d4723e7 | 105 | uint8_t pwr_val = 11; // dBm |
pferland | 0:dd2c9d4723e7 | 106 | uint8_t swp_pwr; |
pferland | 0:dd2c9d4723e7 | 107 | uint8_t swp_sf; |
pferland | 0:dd2c9d4723e7 | 108 | |
pferland | 0:dd2c9d4723e7 | 109 | int32_t mdot_ret; |
pferland | 0:dd2c9d4723e7 | 110 | int32_t join_delay; |
pferland | 0:dd2c9d4723e7 | 111 | |
pferland | 0:dd2c9d4723e7 | 112 | osThreadId mainThreadID; |
pferland | 0:dd2c9d4723e7 | 113 | |
pferland | 0:dd2c9d4723e7 | 114 | // Physical I/O Instantiation |
pferland | 0:dd2c9d4723e7 | 115 | DigitalOut led(LED1); |
pferland | 0:dd2c9d4723e7 | 116 | DigitalIn s2(PA_0); |
pferland | 0:dd2c9d4723e7 | 117 | |
pferland | 0:dd2c9d4723e7 | 118 | I2C i2c(I2C_SDA, I2C_SCL); |
pferland | 0:dd2c9d4723e7 | 119 | ISL29011 lux(i2c); |
pferland | 0:dd2c9d4723e7 | 120 | // InterruptIn btn(PA_0); /* S2 - button */ |
pferland | 0:dd2c9d4723e7 | 121 | |
pferland | 0:dd2c9d4723e7 | 122 | // flags for push button debounce code |
pferland | 0:dd2c9d4723e7 | 123 | bool pb1_low = false; |
pferland | 0:dd2c9d4723e7 | 124 | bool pb2_low = false; |
pferland | 0:dd2c9d4723e7 | 125 | bool toggle_text = false; |
pferland | 0:dd2c9d4723e7 | 126 | bool sw1_state = false; |
pferland | 0:dd2c9d4723e7 | 127 | bool sw2_state = false; |
pferland | 0:dd2c9d4723e7 | 128 | |
pferland | 0:dd2c9d4723e7 | 129 | uint32_t num_whole; |
pferland | 0:dd2c9d4723e7 | 130 | uint16_t num_frac; |
pferland | 0:dd2c9d4723e7 | 131 | |
pferland | 0:dd2c9d4723e7 | 132 | uint32_t pressure; |
pferland | 0:dd2c9d4723e7 | 133 | double current; |
pferland | 0:dd2c9d4723e7 | 134 | |
pferland | 0:dd2c9d4723e7 | 135 | bool exit_program = false; |
pferland | 0:dd2c9d4723e7 | 136 | |
pferland | 0:dd2c9d4723e7 | 137 | mDot* mdot_radio; |
pferland | 0:dd2c9d4723e7 | 138 | Mutex mdot_mutex; |
pferland | 0:dd2c9d4723e7 | 139 | |
pferland | 0:dd2c9d4723e7 | 140 | static Ticker ticker; |
pferland | 0:dd2c9d4723e7 | 141 | |
pferland | 0:dd2c9d4723e7 | 142 | void pb1ISR(void); |
pferland | 0:dd2c9d4723e7 | 143 | void pb2ISR(void); |
pferland | 0:dd2c9d4723e7 | 144 | void pb1_debounce(void const *args); |
pferland | 0:dd2c9d4723e7 | 145 | void pb2_debounce(void const *args); |
pferland | 0:dd2c9d4723e7 | 146 | |
pferland | 0:dd2c9d4723e7 | 147 | //MPL3115A2* resetBaro(const MPL3115A2* oldBaro); |
pferland | 0:dd2c9d4723e7 | 148 | void log_error(mDot* dot, const char* msg, int32_t retval); |
pferland | 0:dd2c9d4723e7 | 149 | int32_t sendString(const std::string text); |
pferland | 0:dd2c9d4723e7 | 150 | bool writeValueOrError(); |
pferland | 0:dd2c9d4723e7 | 151 | |
pferland | 0:dd2c9d4723e7 | 152 | const int FAIL_MAX=15; |
pferland | 0:dd2c9d4723e7 | 153 | int failtime=FAIL_MAX; |
pferland | 0:dd2c9d4723e7 | 154 | int cycle_cnt = 0; |
pferland | 0:dd2c9d4723e7 | 155 | |
pferland | 0:dd2c9d4723e7 | 156 | char sensor_text[64]; |
pferland | 0:dd2c9d4723e7 | 157 | char lora_temp_string[16]; |
pferland | 0:dd2c9d4723e7 | 158 | char lora_alt_string[16]; |
pferland | 0:dd2c9d4723e7 | 159 | char lora_press_string[16]; |
pferland | 0:dd2c9d4723e7 | 160 | char lora_light_string[16]; |
pferland | 0:dd2c9d4723e7 | 161 | char lora_current_string[16]; |
pferland | 0:dd2c9d4723e7 | 162 | char lora_humid_string[16]; |
pferland | 0:dd2c9d4723e7 | 163 | |
pferland | 0:dd2c9d4723e7 | 164 | bool bHasGPS = false; |
pferland | 0:dd2c9d4723e7 | 165 | bool bHasACC = false; |
pferland | 0:dd2c9d4723e7 | 166 | bool bHasLCD = false; |
pferland | 0:dd2c9d4723e7 | 167 | |
pferland | 0:dd2c9d4723e7 | 168 | //Helper Functions... Interrupt Handlers |
pferland | 0:dd2c9d4723e7 | 169 | |
pferland | 0:dd2c9d4723e7 | 170 | void rise() |
pferland | 0:dd2c9d4723e7 | 171 | { |
pferland | 0:dd2c9d4723e7 | 172 | printf("\r\nS2 Button Interrupt... RISE (on)\r\n"); |
pferland | 0:dd2c9d4723e7 | 173 | //led.write(true); |
pferland | 0:dd2c9d4723e7 | 174 | led = 1; |
pferland | 0:dd2c9d4723e7 | 175 | } |
pferland | 0:dd2c9d4723e7 | 176 | |
pferland | 0:dd2c9d4723e7 | 177 | void fall() |
pferland | 0:dd2c9d4723e7 | 178 | { |
pferland | 0:dd2c9d4723e7 | 179 | printf("\r\nS2 Button Interrupt... FALL (off)\r\n"); |
pferland | 0:dd2c9d4723e7 | 180 | //led.write(false); |
pferland | 0:dd2c9d4723e7 | 181 | led = 0; |
pferland | 0:dd2c9d4723e7 | 182 | } |
pferland | 0:dd2c9d4723e7 | 183 | |
pferland | 0:dd2c9d4723e7 | 184 | int xmitDataPayload( int, int, int ); |
pferland | 0:dd2c9d4723e7 | 185 | |
pferland | 0:dd2c9d4723e7 | 186 | /*=================================================================================== |
pferland | 0:dd2c9d4723e7 | 187 | Main Program Logic - Entry |
pferland | 0:dd2c9d4723e7 | 188 | ===================================================================================*/ |
pferland | 0:dd2c9d4723e7 | 189 | int main() |
pferland | 0:dd2c9d4723e7 | 190 | { |
pferland | 0:dd2c9d4723e7 | 191 | std::vector<uint8_t> mdot_data; |
pferland | 0:dd2c9d4723e7 | 192 | std::vector<uint8_t> mdot_EUI; |
pferland | 0:dd2c9d4723e7 | 193 | uint16_t i = 0; |
pferland | 0:dd2c9d4723e7 | 194 | |
pferland | 0:dd2c9d4723e7 | 195 | printf ("\r\nStarting xDot Demonstration Application...\r\n"); |
pferland | 0:dd2c9d4723e7 | 196 | |
pferland | 0:dd2c9d4723e7 | 197 | mainThreadID = osThreadGetId(); |
pferland | 0:dd2c9d4723e7 | 198 | |
pferland | 0:dd2c9d4723e7 | 199 | printf("Begin I2C/SPI Device Initialization...\r\n"); |
pferland | 0:dd2c9d4723e7 | 200 | |
pferland | 0:dd2c9d4723e7 | 201 | printf("Initializing Light Sensor...\r\n"); |
pferland | 0:dd2c9d4723e7 | 202 | |
pferland | 0:dd2c9d4723e7 | 203 | lux.setMode(ISL29011::ALS_CONT); |
pferland | 0:dd2c9d4723e7 | 204 | lux.setResolution(ISL29011::ADC_16BIT); |
pferland | 0:dd2c9d4723e7 | 205 | lux.setRange(ISL29011::RNG_64000); |
pferland | 0:dd2c9d4723e7 | 206 | |
pferland | 0:dd2c9d4723e7 | 207 | printf("I2C/SPI Device Initialization Complete...\r\n"); |
pferland | 0:dd2c9d4723e7 | 208 | |
pferland | 0:dd2c9d4723e7 | 209 | printf("Setup PushButton Interface Handlers...\r\n"); |
pferland | 0:dd2c9d4723e7 | 210 | |
pferland | 0:dd2c9d4723e7 | 211 | //btn.rise(&rise); |
pferland | 0:dd2c9d4723e7 | 212 | //btn.fall(&fall); |
pferland | 0:dd2c9d4723e7 | 213 | |
pferland | 0:dd2c9d4723e7 | 214 | printf("S2 IRQs Set...\r\n"); |
pferland | 0:dd2c9d4723e7 | 215 | |
pferland | 0:dd2c9d4723e7 | 216 | printf("PushButton Interface Handlers Setup...\r\n"); |
pferland | 0:dd2c9d4723e7 | 217 | |
pferland | 0:dd2c9d4723e7 | 218 | printf("\r\nSetup xDot Radio Communications...\r\n"); |
pferland | 0:dd2c9d4723e7 | 219 | |
pferland | 0:dd2c9d4723e7 | 220 | #if CHANNEL_PLAN == CP_AS923 |
pferland | 0:dd2c9d4723e7 | 221 | lora::ChannelPlan* plan = new lora::ChannelPlan_AS923(); |
pferland | 0:dd2c9d4723e7 | 222 | #elif CHANNEL_PLAN == CP_US915 |
pferland | 0:dd2c9d4723e7 | 223 | lora::ChannelPlan* plan = new lora::ChannelPlan_US915(); |
pferland | 0:dd2c9d4723e7 | 224 | #elif CHANNEL_PLAN == CP_AU915 |
pferland | 0:dd2c9d4723e7 | 225 | lora::ChannelPlan* plan = new lora::ChannelPlan_AU915(); |
pferland | 0:dd2c9d4723e7 | 226 | #elif CHANNEL_PLAN == CP_EU868 |
pferland | 0:dd2c9d4723e7 | 227 | lora::ChannelPlan* plan = new lora::ChannelPlan_EU868(); |
pferland | 0:dd2c9d4723e7 | 228 | #elif CHANNEL_PLAN == CP_KR920 |
pferland | 0:dd2c9d4723e7 | 229 | lora::ChannelPlan* plan = new lora::ChannelPlan_KR920(); |
pferland | 0:dd2c9d4723e7 | 230 | #elif CHANNEL_PLAN == CP_IN865 |
pferland | 0:dd2c9d4723e7 | 231 | lora::ChannelPlan* plan = new lora::ChannelPlan_IN865(); |
pferland | 0:dd2c9d4723e7 | 232 | #elif CHANNEL_PLAN == CP_AS923_JAPAN |
pferland | 0:dd2c9d4723e7 | 233 | lora::ChannelPlan* plan = new lora::ChannelPlan_AS923_Japan(); |
pferland | 0:dd2c9d4723e7 | 234 | #endif |
pferland | 0:dd2c9d4723e7 | 235 | |
pferland | 0:dd2c9d4723e7 | 236 | printf("xDot getInstance()...\r\n"); |
pferland | 0:dd2c9d4723e7 | 237 | |
pferland | 0:dd2c9d4723e7 | 238 | // get an xDot handle |
pferland | 0:dd2c9d4723e7 | 239 | mdot_radio = mDot::getInstance( plan ); |
pferland | 0:dd2c9d4723e7 | 240 | |
pferland | 0:dd2c9d4723e7 | 241 | if (mdot_radio) |
pferland | 0:dd2c9d4723e7 | 242 | { |
pferland | 0:dd2c9d4723e7 | 243 | printf("xDot getInstance()... Successful!\r\n"); |
pferland | 0:dd2c9d4723e7 | 244 | |
pferland | 0:dd2c9d4723e7 | 245 | // reset to default config so we know what state we're in |
pferland | 0:dd2c9d4723e7 | 246 | mdot_mutex.lock(); // lock mdot before setting configuration |
pferland | 0:dd2c9d4723e7 | 247 | mdot_radio->resetConfig(); |
pferland | 0:dd2c9d4723e7 | 248 | |
pferland | 0:dd2c9d4723e7 | 249 | // Setting up LED1 as activity LED |
pferland | 0:dd2c9d4723e7 | 250 | mdot_radio->setActivityLedPin(LED1); |
pferland | 0:dd2c9d4723e7 | 251 | mdot_radio->setActivityLedEnable(true); |
pferland | 0:dd2c9d4723e7 | 252 | |
pferland | 0:dd2c9d4723e7 | 253 | // Read node ID |
pferland | 0:dd2c9d4723e7 | 254 | mdot_EUI = mdot_radio->getDeviceId(); |
pferland | 0:dd2c9d4723e7 | 255 | printf("mDot EUI = "); |
pferland | 0:dd2c9d4723e7 | 256 | |
pferland | 0:dd2c9d4723e7 | 257 | for(i=0; i<mdot_EUI.size(); i++) |
pferland | 0:dd2c9d4723e7 | 258 | { |
pferland | 0:dd2c9d4723e7 | 259 | printf("%02x ", mdot_EUI[i]); |
pferland | 0:dd2c9d4723e7 | 260 | } |
pferland | 0:dd2c9d4723e7 | 261 | printf("\r\n"); |
pferland | 0:dd2c9d4723e7 | 262 | |
pferland | 0:dd2c9d4723e7 | 263 | // Setting up the mDot with network information. |
pferland | 0:dd2c9d4723e7 | 264 | |
pferland | 0:dd2c9d4723e7 | 265 | // This call sets up private or public mode on the MTDOT. Set the function to true if |
pferland | 0:dd2c9d4723e7 | 266 | // connecting to a public network |
pferland | 0:dd2c9d4723e7 | 267 | printf("Setting Private Network Mode...\r\n"); |
pferland | 0:dd2c9d4723e7 | 268 | if ((mdot_ret = mdot_radio->setPublicNetwork(false)) != mDot::MDOT_OK) { |
pferland | 0:dd2c9d4723e7 | 269 | log_error(mdot_radio, "ERROR: Failed to set Public Network Mode", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 270 | } |
pferland | 0:dd2c9d4723e7 | 271 | |
pferland | 0:dd2c9d4723e7 | 272 | // Frequency sub-band is valid for NAM only and for Private networks should be set to a value |
pferland | 0:dd2c9d4723e7 | 273 | // between 1-8 that matches the the LoRa gateway setting. Public networks use sub-band 0 only. |
pferland | 0:dd2c9d4723e7 | 274 | // This function can be commented out for EU networks |
pferland | 0:dd2c9d4723e7 | 275 | printf("Setting Frequency Sub-Band...\r\n"); |
pferland | 0:dd2c9d4723e7 | 276 | if ((mdot_ret = mdot_radio->setFrequencySubBand(config_frequency_sub_band)) != mDot::MDOT_OK) { |
pferland | 0:dd2c9d4723e7 | 277 | log_error(mdot_radio, "ERROR: Failed to set Frequency Sub-Band", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 278 | } |
pferland | 0:dd2c9d4723e7 | 279 | |
pferland | 0:dd2c9d4723e7 | 280 | // Setting TX power for radio. Max allowed is +14dBm for EU and +20 dBm for NAM. Default is +11 dBm |
pferland | 0:dd2c9d4723e7 | 281 | printf("Setting TX Power Level to %2d dBm...\r\n", pwr_val); |
pferland | 0:dd2c9d4723e7 | 282 | if ((mdot_ret = mdot_radio->setTxPower(pwr_val)) != mDot::MDOT_OK) { |
pferland | 0:dd2c9d4723e7 | 283 | log_error(mdot_radio, "ERROR: Failed to set TX Power Level", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 284 | } |
pferland | 0:dd2c9d4723e7 | 285 | |
pferland | 0:dd2c9d4723e7 | 286 | // Turning ADR off for the purposes of demonstrating TX data rates |
pferland | 0:dd2c9d4723e7 | 287 | printf("Setting ADR to Off...\r\n"); |
pferland | 0:dd2c9d4723e7 | 288 | if((mdot_ret = mdot_radio->setAdr(false)) != mDot::MDOT_OK){ |
pferland | 0:dd2c9d4723e7 | 289 | log_error(mdot_radio, "ERROR: Failed to set ADR", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 290 | } |
pferland | 0:dd2c9d4723e7 | 291 | |
pferland | 0:dd2c9d4723e7 | 292 | // Setting TX data rate for radio. Max allowed is SF_12 for EU and SF10 dBm for NAM. Default is SF_10 |
pferland | 0:dd2c9d4723e7 | 293 | printf("Setting TX data rate to SF_7...\r\n"); |
pferland | 0:dd2c9d4723e7 | 294 | if ((mdot_ret = mdot_radio->setTxDataRate(sf_val)) != mDot::MDOT_OK) { |
pferland | 0:dd2c9d4723e7 | 295 | log_error(mdot_radio, "ERROR: Failed to set TX Data Rate", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 296 | } |
pferland | 0:dd2c9d4723e7 | 297 | |
pferland | 0:dd2c9d4723e7 | 298 | // Setting Packet ACK to 1 try. |
pferland | 0:dd2c9d4723e7 | 299 | printf("Setting Packet Retry to 1...\r\n"); |
pferland | 0:dd2c9d4723e7 | 300 | if ((mdot_ret = mdot_radio->setAck(1)) != mDot::MDOT_OK) { |
pferland | 0:dd2c9d4723e7 | 301 | log_error(mdot_radio, "ERROR: Failed to set Packet Retry\r\n", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 302 | } |
pferland | 0:dd2c9d4723e7 | 303 | |
pferland | 0:dd2c9d4723e7 | 304 | // setNetworkName is used for private networks. |
pferland | 0:dd2c9d4723e7 | 305 | // Use setNetworkID(AppID) for public networks |
pferland | 0:dd2c9d4723e7 | 306 | // config_app_id.assign(app_id,app_id+7); |
pferland | 0:dd2c9d4723e7 | 307 | |
pferland | 0:dd2c9d4723e7 | 308 | printf("Setting Network Name...\r\n"); |
pferland | 0:dd2c9d4723e7 | 309 | if ((mdot_ret = mdot_radio->setNetworkName(config_network_name)) != mDot::MDOT_OK) { |
pferland | 0:dd2c9d4723e7 | 310 | // if ((mdot_ret = mdot_radio->setNetworkID(config_app_id)) != mDot::MDOT_OK) { |
pferland | 0:dd2c9d4723e7 | 311 | log_error(mdot_radio, "ERROR: Failed to set Network Name", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 312 | } |
pferland | 0:dd2c9d4723e7 | 313 | |
pferland | 0:dd2c9d4723e7 | 314 | // setNetworkPassphrase is used for private networks |
pferland | 0:dd2c9d4723e7 | 315 | // Use setNetworkKey for public networks |
pferland | 0:dd2c9d4723e7 | 316 | // config_app_key.assign(app_key,app_key+15); |
pferland | 0:dd2c9d4723e7 | 317 | |
pferland | 0:dd2c9d4723e7 | 318 | printf("Setting Network Password...\r\n"); |
pferland | 0:dd2c9d4723e7 | 319 | if ((mdot_ret = mdot_radio->setNetworkPassphrase(config_network_pass)) != mDot::MDOT_OK) { |
pferland | 0:dd2c9d4723e7 | 320 | // if ((mdot_ret = mdot_radio->setNetworkKey(config_app_key)) != mDot::MDOT_OK) { |
pferland | 0:dd2c9d4723e7 | 321 | log_error(mdot_radio, "ERROR: Failed to set Network Password", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 322 | } |
pferland | 0:dd2c9d4723e7 | 323 | |
pferland | 0:dd2c9d4723e7 | 324 | mdot_mutex.unlock(); // unlock mdot mutex before join attempt so SW1 can work |
pferland | 0:dd2c9d4723e7 | 325 | |
pferland | 0:dd2c9d4723e7 | 326 | // attempt to join the network |
pferland | 0:dd2c9d4723e7 | 327 | printf("Joining LoRa Network...\r\n"); |
pferland | 0:dd2c9d4723e7 | 328 | do { |
pferland | 0:dd2c9d4723e7 | 329 | mdot_mutex.lock(); // lock mdot mutex before join attempt |
pferland | 0:dd2c9d4723e7 | 330 | mdot_ret = mdot_radio->joinNetwork(); |
pferland | 0:dd2c9d4723e7 | 331 | mdot_mutex.unlock(); // unlock mdot mutex after join attempt so SW1 can work |
pferland | 0:dd2c9d4723e7 | 332 | |
pferland | 0:dd2c9d4723e7 | 333 | if (mdot_ret != mDot::MDOT_OK) |
pferland | 0:dd2c9d4723e7 | 334 | { |
pferland | 0:dd2c9d4723e7 | 335 | log_error(mdot_radio,"ERROR: Failed to Join Network:", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 336 | |
pferland | 0:dd2c9d4723e7 | 337 | join_delay = 100; |
pferland | 0:dd2c9d4723e7 | 338 | |
pferland | 0:dd2c9d4723e7 | 339 | printf("Join Delay = %lu\r\n",join_delay); |
pferland | 0:dd2c9d4723e7 | 340 | osDelay(join_delay + 1); |
pferland | 0:dd2c9d4723e7 | 341 | toggle_text = !toggle_text; |
pferland | 0:dd2c9d4723e7 | 342 | } |
pferland | 0:dd2c9d4723e7 | 343 | |
pferland | 0:dd2c9d4723e7 | 344 | /* |
pferland | 0:dd2c9d4723e7 | 345 | * Setting TX power and Data Rate for radio just in case user requested by SW2 |
pferland | 0:dd2c9d4723e7 | 346 | */ |
pferland | 0:dd2c9d4723e7 | 347 | mdot_mutex.lock(); // lock mdot mutex before setting change |
pferland | 0:dd2c9d4723e7 | 348 | mdot_radio->setTxPower(pwr_val); |
pferland | 0:dd2c9d4723e7 | 349 | mdot_radio->setTxDataRate(sf_val); |
pferland | 0:dd2c9d4723e7 | 350 | mdot_mutex.unlock(); // unlock mdot mutex after settings change so SW1 can work |
pferland | 0:dd2c9d4723e7 | 351 | |
pferland | 0:dd2c9d4723e7 | 352 | } while (mdot_ret != mDot::MDOT_OK); |
pferland | 0:dd2c9d4723e7 | 353 | |
pferland | 0:dd2c9d4723e7 | 354 | printf("Successfully Joined LoRa Network...\r\n"); |
pferland | 0:dd2c9d4723e7 | 355 | } |
pferland | 0:dd2c9d4723e7 | 356 | else |
pferland | 0:dd2c9d4723e7 | 357 | { |
pferland | 0:dd2c9d4723e7 | 358 | printf("ERROR: Unable to Join LoRa Network...\r\n"); |
pferland | 0:dd2c9d4723e7 | 359 | printf("getInstance... Radio Initialization Failed!\r\n"); |
pferland | 0:dd2c9d4723e7 | 360 | |
pferland | 0:dd2c9d4723e7 | 361 | exit(1); |
pferland | 0:dd2c9d4723e7 | 362 | } |
pferland | 0:dd2c9d4723e7 | 363 | |
pferland | 0:dd2c9d4723e7 | 364 | printf("Initialization/Configuration Completed...\r\n"); |
pferland | 0:dd2c9d4723e7 | 365 | |
pferland | 0:dd2c9d4723e7 | 366 | osDelay(1500); |
pferland | 0:dd2c9d4723e7 | 367 | |
pferland | 0:dd2c9d4723e7 | 368 | // Enter Main Data Acquisition Loop... |
pferland | 0:dd2c9d4723e7 | 369 | printf("Processing Data Acquisition Scan Loop...\r\n"); |
pferland | 0:dd2c9d4723e7 | 370 | |
pferland | 0:dd2c9d4723e7 | 371 | i = 0; |
pferland | 0:dd2c9d4723e7 | 372 | cycle_cnt = 100; |
pferland | 0:dd2c9d4723e7 | 373 | |
pferland | 0:dd2c9d4723e7 | 374 | bool s2_last = 0; |
pferland | 0:dd2c9d4723e7 | 375 | int lum_last = 0; |
pferland | 0:dd2c9d4723e7 | 376 | int lum_delta = 0; |
pferland | 0:dd2c9d4723e7 | 377 | |
pferland | 0:dd2c9d4723e7 | 378 | do |
pferland | 0:dd2c9d4723e7 | 379 | { |
pferland | 0:dd2c9d4723e7 | 380 | // Read Pushbutton #2 (S2) State... |
pferland | 0:dd2c9d4723e7 | 381 | if( s2 > 0 ) |
pferland | 0:dd2c9d4723e7 | 382 | { |
pferland | 0:dd2c9d4723e7 | 383 | printf("S2 Pressed... State: %d\r\n", (int) s2); |
pferland | 0:dd2c9d4723e7 | 384 | } |
pferland | 0:dd2c9d4723e7 | 385 | |
pferland | 0:dd2c9d4723e7 | 386 | int delta = rand()%16; |
pferland | 0:dd2c9d4723e7 | 387 | int temperature = 20 + delta; |
pferland | 0:dd2c9d4723e7 | 388 | int luminosity = lux.getData(); |
pferland | 0:dd2c9d4723e7 | 389 | int current = s2; |
pferland | 0:dd2c9d4723e7 | 390 | |
pferland | 0:dd2c9d4723e7 | 391 | printf("Scan... Temperature: %d degC (delta=%d), Light: %d lux, Button: %d\r\n", temperature, delta, luminosity, current ); |
pferland | 0:dd2c9d4723e7 | 392 | |
pferland | 0:dd2c9d4723e7 | 393 | lum_delta = abs( luminosity - lum_last ); |
pferland | 0:dd2c9d4723e7 | 394 | |
pferland | 0:dd2c9d4723e7 | 395 | if( s2 != s2_last || lum_delta > 20 ) |
pferland | 0:dd2c9d4723e7 | 396 | { |
pferland | 0:dd2c9d4723e7 | 397 | printf("Data Change Event...\r\n"); |
pferland | 0:dd2c9d4723e7 | 398 | |
pferland | 0:dd2c9d4723e7 | 399 | xmitDataPayload( temperature, luminosity, current ); |
pferland | 0:dd2c9d4723e7 | 400 | |
pferland | 0:dd2c9d4723e7 | 401 | cycle_cnt = 0; |
pferland | 0:dd2c9d4723e7 | 402 | } |
pferland | 0:dd2c9d4723e7 | 403 | |
pferland | 0:dd2c9d4723e7 | 404 | if( cycle_cnt > 30 ) |
pferland | 0:dd2c9d4723e7 | 405 | { |
pferland | 0:dd2c9d4723e7 | 406 | printf("Transmitting Data... \r\n"); |
pferland | 0:dd2c9d4723e7 | 407 | |
pferland | 0:dd2c9d4723e7 | 408 | sprintf(sensor_text, "t:%d,l:%d,c:%d", |
pferland | 0:dd2c9d4723e7 | 409 | temperature, |
pferland | 0:dd2c9d4723e7 | 410 | luminosity, |
pferland | 0:dd2c9d4723e7 | 411 | current ); |
pferland | 0:dd2c9d4723e7 | 412 | |
pferland | 0:dd2c9d4723e7 | 413 | if((mdot_ret = sendString((const std::string)sensor_text)) != mDot::MDOT_OK) |
pferland | 0:dd2c9d4723e7 | 414 | { |
pferland | 0:dd2c9d4723e7 | 415 | log_error(mdot_radio, "ERROR: Failed to Send Data", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 416 | } |
pferland | 0:dd2c9d4723e7 | 417 | else |
pferland | 0:dd2c9d4723e7 | 418 | { |
pferland | 0:dd2c9d4723e7 | 419 | printf("Ok, Successfully Sent Data to Gateway...\r\n"); |
pferland | 0:dd2c9d4723e7 | 420 | } |
pferland | 0:dd2c9d4723e7 | 421 | |
pferland | 0:dd2c9d4723e7 | 422 | /* |
pferland | 0:dd2c9d4723e7 | 423 | //--------------------------------------------------------------------------- |
pferland | 0:dd2c9d4723e7 | 424 | // Binary Encoded Format: Most Data Payload, Not Human Readible |
pferland | 0:dd2c9d4723e7 | 425 | //--------------------------------------------------------------------------- |
pferland | 0:dd2c9d4723e7 | 426 | mdot_data.clear(); |
pferland | 0:dd2c9d4723e7 | 427 | mdot_data.push_back(0x0E); // key for Current Acceleration 3-Axis Value |
pferland | 0:dd2c9d4723e7 | 428 | converts.f_s = accel_data._x *4; // shift data 2 bits while retaining sign |
pferland | 0:dd2c9d4723e7 | 429 | mdot_data.push_back(converts.t_u[1]); // get 8 MSB of 14 bit value |
pferland | 0:dd2c9d4723e7 | 430 | converts.f_s = accel_data._y * 4; // shift data 2 bits while retaining sign |
pferland | 0:dd2c9d4723e7 | 431 | mdot_data.push_back(converts.t_u[1]); // get 8 MSB of 14 bit value |
pferland | 0:dd2c9d4723e7 | 432 | converts.f_s = accel_data._z * 4; // shift data 2 bits while retaining sign |
pferland | 0:dd2c9d4723e7 | 433 | mdot_data.push_back(converts.t_u[1]); // get 8 MSB of 14 bit value |
pferland | 0:dd2c9d4723e7 | 434 | mdot_data.push_back(0x08); // key for Current Pressure Value |
pferland | 0:dd2c9d4723e7 | 435 | convertl.f_u = pressure; // pressure data is 20 bits unsigned |
pferland | 0:dd2c9d4723e7 | 436 | mdot_data.push_back(convertl.t_u[2]); |
pferland | 0:dd2c9d4723e7 | 437 | mdot_data.push_back(convertl.t_u[1]); |
pferland | 0:dd2c9d4723e7 | 438 | mdot_data.push_back(convertl.t_u[0]); |
pferland | 0:dd2c9d4723e7 | 439 | mdot_data.push_back(0x05); // key for Current Ambient Light Value |
pferland | 0:dd2c9d4723e7 | 440 | converts.f_u = lux_data; // data is 16 bits unsigned |
pferland | 0:dd2c9d4723e7 | 441 | mdot_data.push_back(converts.t_u[1]); |
pferland | 0:dd2c9d4723e7 | 442 | mdot_data.push_back(converts.t_u[0]); |
pferland | 0:dd2c9d4723e7 | 443 | mdot_data.push_back(0x0B); // key for Current Temperature Value |
pferland | 0:dd2c9d4723e7 | 444 | converts.f_s = baro_data._temp; // temperature is signed 12 bit |
pferland | 0:dd2c9d4723e7 | 445 | mdot_data.push_back(converts.t_u[1]); |
pferland | 0:dd2c9d4723e7 | 446 | mdot_data.push_back(converts.t_u[0]); |
pferland | 0:dd2c9d4723e7 | 447 | |
pferland | 0:dd2c9d4723e7 | 448 | if ((mdot_ret = mdot_radio->send(mdot_data)) != mDot::MDOT_OK) |
pferland | 0:dd2c9d4723e7 | 449 | { |
pferland | 0:dd2c9d4723e7 | 450 | log_error(mdot_radio, "ERROR: Failed to Send Data", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 451 | } |
pferland | 0:dd2c9d4723e7 | 452 | else |
pferland | 0:dd2c9d4723e7 | 453 | { |
pferland | 0:dd2c9d4723e7 | 454 | printf("Ok, Successfully Sent Data to Gateway...\r\n"); |
pferland | 0:dd2c9d4723e7 | 455 | } |
pferland | 0:dd2c9d4723e7 | 456 | */ |
pferland | 0:dd2c9d4723e7 | 457 | |
pferland | 0:dd2c9d4723e7 | 458 | osDelay(500); |
pferland | 0:dd2c9d4723e7 | 459 | |
pferland | 0:dd2c9d4723e7 | 460 | printf("Scanning... \r\n"); |
pferland | 0:dd2c9d4723e7 | 461 | cycle_cnt = 0; |
pferland | 0:dd2c9d4723e7 | 462 | } |
pferland | 0:dd2c9d4723e7 | 463 | |
pferland | 0:dd2c9d4723e7 | 464 | s2_last = s2; |
pferland | 0:dd2c9d4723e7 | 465 | lum_last = luminosity; |
pferland | 0:dd2c9d4723e7 | 466 | |
pferland | 0:dd2c9d4723e7 | 467 | osDelay(1000); |
pferland | 0:dd2c9d4723e7 | 468 | cycle_cnt++; |
pferland | 0:dd2c9d4723e7 | 469 | |
pferland | 0:dd2c9d4723e7 | 470 | // Put Thread to Sleep for 30 Seconds... |
pferland | 0:dd2c9d4723e7 | 471 | // osDelay(30000); |
pferland | 0:dd2c9d4723e7 | 472 | |
pferland | 0:dd2c9d4723e7 | 473 | } while(i < 86400); |
pferland | 0:dd2c9d4723e7 | 474 | |
pferland | 0:dd2c9d4723e7 | 475 | printf("End of Data Collection Cycle (24 Hours) - Ending Application, GoodBye...\r\n"); |
pferland | 0:dd2c9d4723e7 | 476 | } |
pferland | 0:dd2c9d4723e7 | 477 | |
pferland | 0:dd2c9d4723e7 | 478 | /*=================================================================================== |
pferland | 0:dd2c9d4723e7 | 479 | Send String Payload to Conduit Gateway |
pferland | 0:dd2c9d4723e7 | 480 | ===================================================================================*/ |
pferland | 0:dd2c9d4723e7 | 481 | int32_t sendString(const std::string text) |
pferland | 0:dd2c9d4723e7 | 482 | { |
pferland | 0:dd2c9d4723e7 | 483 | int32_t ret; |
pferland | 0:dd2c9d4723e7 | 484 | if (mdot_radio->getNextTxMs() != 0) |
pferland | 0:dd2c9d4723e7 | 485 | { |
pferland | 0:dd2c9d4723e7 | 486 | printf("Sending in %lu ms...\r\n", mdot_radio->getNextTxMs()); |
pferland | 0:dd2c9d4723e7 | 487 | return false; |
pferland | 0:dd2c9d4723e7 | 488 | } |
pferland | 0:dd2c9d4723e7 | 489 | |
pferland | 0:dd2c9d4723e7 | 490 | printf("Sending: '%s'\r\n", text.c_str()); |
pferland | 0:dd2c9d4723e7 | 491 | std::vector<uint8_t> data(text.begin(), text.end()); |
pferland | 0:dd2c9d4723e7 | 492 | if ((ret = mdot_radio->send(data, 1)) != mDot::MDOT_OK) |
pferland | 0:dd2c9d4723e7 | 493 | { |
pferland | 0:dd2c9d4723e7 | 494 | log_error(mdot_radio, "ERROR: Failed to Send Data", ret); |
pferland | 0:dd2c9d4723e7 | 495 | } |
pferland | 0:dd2c9d4723e7 | 496 | |
pferland | 0:dd2c9d4723e7 | 497 | led = 0; |
pferland | 0:dd2c9d4723e7 | 498 | |
pferland | 0:dd2c9d4723e7 | 499 | return ret; |
pferland | 0:dd2c9d4723e7 | 500 | } |
pferland | 0:dd2c9d4723e7 | 501 | |
pferland | 0:dd2c9d4723e7 | 502 | /*=================================================================================== |
pferland | 0:dd2c9d4723e7 | 503 | Transmit Data Payload to Cloud Platform |
pferland | 0:dd2c9d4723e7 | 504 | ===================================================================================*/ |
pferland | 0:dd2c9d4723e7 | 505 | int32_t xmitDataPayload( int temperature, int luminosity, int current ) |
pferland | 0:dd2c9d4723e7 | 506 | { |
pferland | 0:dd2c9d4723e7 | 507 | int32_t mdot_ret; |
pferland | 0:dd2c9d4723e7 | 508 | |
pferland | 0:dd2c9d4723e7 | 509 | printf("Transmitting Data... \r\n"); |
pferland | 0:dd2c9d4723e7 | 510 | |
pferland | 0:dd2c9d4723e7 | 511 | sprintf(sensor_text, "t:%d,l:%d,c:%d", temperature, luminosity, current ); |
pferland | 0:dd2c9d4723e7 | 512 | |
pferland | 0:dd2c9d4723e7 | 513 | if((mdot_ret = sendString((const std::string)sensor_text)) != mDot::MDOT_OK) |
pferland | 0:dd2c9d4723e7 | 514 | { |
pferland | 0:dd2c9d4723e7 | 515 | log_error(mdot_radio, "ERROR: Failed to Send Data", mdot_ret); |
pferland | 0:dd2c9d4723e7 | 516 | } |
pferland | 0:dd2c9d4723e7 | 517 | else |
pferland | 0:dd2c9d4723e7 | 518 | { |
pferland | 0:dd2c9d4723e7 | 519 | printf("Ok, Successfully Sent Data to Gateway...\r\n"); |
pferland | 0:dd2c9d4723e7 | 520 | } |
pferland | 0:dd2c9d4723e7 | 521 | |
pferland | 0:dd2c9d4723e7 | 522 | return mdot_ret; |
pferland | 0:dd2c9d4723e7 | 523 | } |
pferland | 0:dd2c9d4723e7 | 524 | |
pferland | 0:dd2c9d4723e7 | 525 | /*=================================================================================== |
pferland | 0:dd2c9d4723e7 | 526 | Print clear text verion of mDot/EVB errors |
pferland | 0:dd2c9d4723e7 | 527 | ===================================================================================*/ |
pferland | 0:dd2c9d4723e7 | 528 | void log_error(mDot* dot, const char* msg, int32_t retval) |
pferland | 0:dd2c9d4723e7 | 529 | { |
pferland | 0:dd2c9d4723e7 | 530 | printf("%s - %ld:%s, %s\r\n", msg, retval, mDot::getReturnCodeString(retval).c_str(), dot->getLastError().c_str()); |
pferland | 0:dd2c9d4723e7 | 531 | } |