Skip to content

Commit cb9a563

Browse files
committed
Remove unused GetGeoCoordinate() code
Signed-off-by: John Walicki <[email protected]>
1 parent 3636f53 commit cb9a563

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

WatsonIoT/src/main.cpp

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -376,34 +376,6 @@ bool FirmwareVersionCheck( char *firmware_latest, String firmware_ota_url ) {
376376
}
377377

378378

379-
void GetGeoCoordinates( float *, float *);
380-
void GetGeoCoordinates( float *latitude, float *longitude) {
381-
HTTPClient http;
382-
#define GEOCOORD_APIKEY "9f0acd1eb4c51704c2f4429be20ba4c6"
383-
http.begin( "http://api.ipstack.com/check?access_key=9f0acd1eb4c51704c2f4429be20ba4c6" );
384-
int httpResponseCode = http.GET();
385-
Serial.print("GetGeoCoordinates() ipstack HTTP Response code: ");
386-
Serial.println(httpResponseCode);
387-
String payload = http.getString();
388-
http.end(); // free resources
389-
Serial.print("ipstack HTTP get response payload: ");
390-
Serial.println( payload );
391-
392-
if( httpResponseCode == 200 ) { // Success
393-
DynamicJsonDocument ReceiveDoc(900);
394-
DeserializationError err = deserializeJson(ReceiveDoc, payload);
395-
if (err) {
396-
Serial.print(F("deserializeJson() failed with code : "));
397-
Serial.println(err.c_str());
398-
} else {
399-
JsonObject GeoCoordData = ReceiveDoc.as<JsonObject>();
400-
*latitude = GeoCoordData["latitude"];
401-
*longitude = GeoCoordData["longitude"];
402-
}
403-
}
404-
}
405-
406-
407379
// Call the OpenEEW Device Activation endpoint to retrieve MQTT OrgID
408380
bool OpenEEWDeviceActivation() {
409381
// OPENEEW_ACTIVATION_ENDPOINT "https://openeew-earthquakes.mybluemix.net/activation?ver=1"
@@ -412,14 +384,6 @@ bool OpenEEWDeviceActivation() {
412384
Serial.println("Contacting the OpenEEW Device Activation Endpoint :");
413385
Serial.println(OPENEEW_ACTIVATION_ENDPOINT);
414386

415-
/*
416-
float lat, lng ;
417-
GetGeoCoordinates( &lat, &lng );
418-
Serial.print("GetGeoCoordinates() reported latitude,longitude : ");
419-
Serial.print(lat,5);
420-
Serial.print(",");
421-
Serial.println(lng,5);
422-
*/
423387
HTTPClient http;
424388
// Domain name with URL path or IP address with path
425389
http.begin( OPENEEW_ACTIVATION_ENDPOINT );
@@ -431,9 +395,7 @@ bool OpenEEWDeviceActivation() {
431395
// '{"macaddress":"112233445566","lat":40.00000,"lng":-74.00000,"firmware_device":"1.0.0"}'
432396
DynamicJsonDocument httpSendDoc(120);
433397
String httpRequestData;
434-
httpSendDoc["macaddress"] = deviceID;
435-
//httpSendDoc["lat"] = lat;
436-
//httpSendDoc["lng"] = lng;
398+
httpSendDoc["macaddress"] = deviceID;
437399
httpSendDoc["firmware_device"] = OPENEEW_FIRMWARE_VERSION;
438400
// Serialize the entire string to be transmitted
439401
serializeJson(httpSendDoc, httpRequestData);

0 commit comments

Comments
 (0)