Skip to content

Commit

Permalink
Rename Location to CellularLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed May 2, 2024
1 parent 6531063 commit c651122
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` <a id="class_arduino_cellular" class="anchor"></a>

Expand Down Expand Up @@ -138,7 +138,7 @@ True if GPS was enabled successfully, false otherwise.
### `getGPSLocation` <a id="class_arduino_cellular_1aee57a2eec5be06172b2fb7cd574d9106" class="anchor"></a>
```cpp
Location getGPSLocation(unsigned long timeout)
CellularLocation getGPSLocation(unsigned long timeout)
```

Gets the GPS location. (Blocking call)
Expand Down Expand Up @@ -824,7 +824,7 @@ Returns the timezone offset of the time.
The timezone offset of the time.
<hr />

# struct `Location` <a id="struct_location" class="anchor"></a>
# struct `CellularLocation` <a id="struct_location" class="anchor"></a>

Represents a geographic location with latitude and longitude coordinates.

Expand Down
2 changes: 1 addition & 1 deletion examples/GetLocation/GetLocation.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion examples/GetTime/GetTime.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions src/ArduinoCellular.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -98,7 +98,7 @@ Location ArduinoCellular::getGPSLocation(unsigned long timeout){
delay(1000);
}

Location loc;
CellularLocation loc;
loc.latitude = latitude;
loc.longitude = longitude;

Expand All @@ -107,7 +107,7 @@ Location ArduinoCellular::getGPSLocation(unsigned long timeout){
if(this->debugStream != nullptr){
this->debugStream->println("Unsupported modem model");
}
return Location();
return CellularLocation();
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/ArduinoCellular.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
};
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c651122

Please # to comment.