whatever
Dependencies: C027 C027_Support M2XStreamClient PowerControl jsonlite mbed-rtos mbed
Fork of PONY_Ph0-uAXIS by
Diff: main.cpp
- Revision:
- 44:bd259a4c83bb
- Parent:
- 43:80aa0c933e1a
- Child:
- 45:0d8cb417a9e2
--- a/main.cpp Tue Dec 29 07:01:54 2015 +0000 +++ b/main.cpp Tue Dec 29 07:07:06 2015 +0000 @@ -45,8 +45,6 @@ //------------------------------------------------------------------------------------ // PIN Config -DigitalIn jostle(P2_13); - DigitalOut led1(LED1); DigitalOut led2(LED2); @@ -54,7 +52,7 @@ AnalogIn tempGnd(P0_24); //I2C axis(P0_0, P0_1); // SDA, SCL -LIS331 axle(P0_0, P0_1); // Library object +//LIS331 axle(P0_0, P0_1); // Library object //------------------------------------------------------------------------------------ @@ -109,7 +107,7 @@ MDMSerial mdm; MDMParser::DevStatus devStatus = {}; - MDMParser::NetStatus netStatus = {}; + MDMParser::NetStatus netStatus = {}; bool mdmOk = mdm.init(SIMPIN, &devStatus); #ifdef MDMDEBUG //mdm.setDebug(4); @@ -119,11 +117,22 @@ // LOCATION READING - // Open modem connection + // OPEN MODEM CONNECTION if (!mdm.connect(SIMPIN, APN,USERNAME,PASSWORD)) - return -1; + return -1; + + // SET DEEP SCAN MODE + printf("Configure deep scan mode\r\n"); + int locConf = mdm.cellLocConfigSensor(1); + - + + + + + + + // Cell location call variables const int sensorMask = 2; // 1 = GNSS, 2 = CellLocate, 3 = Hybrid: GNSS + CellLocate @@ -132,9 +141,8 @@ // Cell location data MDMSerial::CellLocData ponyLoc, thisLoc; + - printf("Configure deep scan mode\r\n"); - int locConf = mdm.cellLocConfigSensor(1); // Set deep scan mode // Loop driving variables @@ -151,21 +159,13 @@ // Location reporting loop while(true) { + // Set some important variables M2X_response = 0; locLock = false; loopIter++; - - //M2X_response = logTemp(&tempPin, &m2xClient); printf("tick\r\n"); - - /* - while(!M2X_response) { - printf("Waiting on temperature log\r\n"); - delay(1000); - } - */ delay(5000); // Delay to ensure that the modem isn't talking over itself transmitting temp and requesting location @@ -229,12 +229,7 @@ if(M2X_response == 202) printf("Location Confidence (%d) POST successful\r\n", ponyLoc.uncertainty); - - // Report temperature - M2X_response = logTemp(&tempPin, &kTemp, &m2xClient); - - if(M2X_response == 202) - printf("Temperature POST successful\r\n"); + locLock = true;