diff --git a/docs/api.md b/docs/api.md index bd2cd17..87b9510 100644 --- a/docs/api.md +++ b/docs/api.md @@ -6,7 +6,7 @@ `class ` [`ModemInterface`](#class_modem_interface) | Represents the interface to the 4G modem module which extends the TinyGsmBG96 class. `class ` [`SMS`](#class_s_m_s) | Represents an [SMS](#class_s_m_s) message. `class ` [`Time`](#class_time) | Represents a point in time with year, month, day, hour, minute, second, and offset. -`struct ` [`Location`](#struct_location) | Represents a geographic location with latitude and longitude coordinates. +`struct ` [`CellularLocation`](#struct_location) | Represents a geographic location with latitude and longitude coordinates. # class `ArduinoCellular` @@ -138,7 +138,7 @@ True if GPS was enabled successfully, false otherwise. ### `getGPSLocation` ```cpp -Location getGPSLocation(unsigned long timeout) +CellularLocation getGPSLocation(unsigned long timeout) ``` Gets the GPS location. (Blocking call) @@ -824,7 +824,7 @@ Returns the timezone offset of the time. The timezone offset of the time.
-# struct `Location` +# struct `CellularLocation` Represents a geographic location with latitude and longitude coordinates. diff --git a/examples/GetLocation/GetLocation.ino b/examples/GetLocation/GetLocation.ino index 7ec02a7..448a362 100644 --- a/examples/GetLocation/GetLocation.ino +++ b/examples/GetLocation/GetLocation.ino @@ -28,7 +28,7 @@ void setup(){ } void loop(){ - Location location = cellular.getGPSLocation(); + CellularLocation location = cellular.getGPSLocation(); Serial.println("GPS Location:"); Serial.print("* Latitude: "); Serial.println(location.latitude, 6); Serial.print("* Longitude: "); Serial.println(location.longitude, 6); diff --git a/examples/GetTime/GetTime.ino b/examples/GetTime/GetTime.ino index af4e2b4..a4dcef1 100644 --- a/examples/GetTime/GetTime.ino +++ b/examples/GetTime/GetTime.ino @@ -28,7 +28,7 @@ void setup(){ } void loop(){ - Location location = cellular.getGPSLocation(10000); + CellularLocation location = cellular.getGPSLocation(10000); if(location.latitude == 0.0 && location.longitude == 0.0){ Serial.println("Failed to get GPS location"); diff --git a/src/ArduinoCellular.cpp b/src/ArduinoCellular.cpp index 4477d75..480f53d 100644 --- a/src/ArduinoCellular.cpp +++ b/src/ArduinoCellular.cpp @@ -87,7 +87,7 @@ bool ArduinoCellular::connect(String apn, String username, String password){ } -Location ArduinoCellular::getGPSLocation(unsigned long timeout){ +CellularLocation ArduinoCellular::getGPSLocation(unsigned long timeout){ if (model == ModemModel::EG25){ float latitude = 0.00000; float longitude = 0.00000; @@ -98,7 +98,7 @@ Location ArduinoCellular::getGPSLocation(unsigned long timeout){ delay(1000); } - Location loc; + CellularLocation loc; loc.latitude = latitude; loc.longitude = longitude; @@ -107,7 +107,7 @@ Location ArduinoCellular::getGPSLocation(unsigned long timeout){ if(this->debugStream != nullptr){ this->debugStream->println("Unsupported modem model"); } - return Location(); + return CellularLocation(); } } diff --git a/src/ArduinoCellular.h b/src/ArduinoCellular.h index c671b83..fd9142c 100644 --- a/src/ArduinoCellular.h +++ b/src/ArduinoCellular.h @@ -68,10 +68,10 @@ class SMS { /** - * @struct Location + * @struct CellularLocation * @brief Represents a geographic location with latitude and longitude coordinates. */ -struct Location { +struct CellularLocation { float latitude; /**< The latitude coordinate of the location. */ float longitude; /**< The longitude coordinate of the location. */ }; @@ -136,7 +136,7 @@ class ArduinoCellular { * @param timeout The timeout (In milliseconds) to wait for the GPS location. * @return The GPS location. If the location is not retrieved, the latitude and longitude will be 0.0. */ - Location getGPSLocation(unsigned long timeout = 60000); + CellularLocation getGPSLocation(unsigned long timeout = 60000); /** * @brief Gets the current time from the network.