Skip to content

Commit 2051e29

Browse files
Merge pull request #12 from pennam/location-rename
Rename Location to CellularLocation
2 parents 67270bf + 51be44a commit 2051e29

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

Diff for: docs/api.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
`class ` [`ModemInterface`](#class_modem_interface) | Represents the interface to the 4G modem module which extends the TinyGsmBG96 class.
77
`class ` [`SMS`](#class_s_m_s) | Represents an [SMS](#class_s_m_s) message.
88
`class ` [`Time`](#class_time) | Represents a point in time with year, month, day, hour, minute, second, and offset.
9-
`struct ` [`Location`](#struct_location) | Represents a geographic location with latitude and longitude coordinates.
9+
`struct ` [`Geolocation`](#struct_location) | Represents a geographic location with latitude and longitude coordinates.
1010

1111
# class `ArduinoCellular` <a id="class_arduino_cellular" class="anchor"></a>
1212

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

144144
Gets the GPS location. (Blocking call)
@@ -824,7 +824,7 @@ Returns the timezone offset of the time.
824824
The timezone offset of the time.
825825
<hr />
826826

827-
# struct `Location` <a id="struct_location" class="anchor"></a>
827+
# struct `Geolocation` <a id="struct_location" class="anchor"></a>
828828

829829
Represents a geographic location with latitude and longitude coordinates.
830830

Diff for: examples/GetLocation/GetLocation.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void setup(){
2828
}
2929

3030
void loop(){
31-
Location location = cellular.getGPSLocation();
31+
Geolocation location = cellular.getGPSLocation();
3232
Serial.println("GPS Location:");
3333
Serial.print("* Latitude: "); Serial.println(location.latitude, 6);
3434
Serial.print("* Longitude: "); Serial.println(location.longitude, 6);

Diff for: examples/GetTime/GetTime.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void setup(){
2828
}
2929

3030
void loop(){
31-
Location location = cellular.getGPSLocation(10000);
31+
Geolocation location = cellular.getGPSLocation(10000);
3232

3333
if(location.latitude == 0.0 && location.longitude == 0.0){
3434
Serial.println("Failed to get GPS location");

Diff for: src/ArduinoCellular.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ bool ArduinoCellular::connect(String apn, String username, String password){
8888
}
8989

9090

91-
Location ArduinoCellular::getGPSLocation(unsigned long timeout){
91+
Geolocation ArduinoCellular::getGPSLocation(unsigned long timeout){
9292
if (model == ModemModel::EG25){
9393
float latitude = 0.00000;
9494
float longitude = 0.00000;
@@ -99,7 +99,7 @@ Location ArduinoCellular::getGPSLocation(unsigned long timeout){
9999
delay(1000);
100100
}
101101

102-
Location loc;
102+
Geolocation loc;
103103
loc.latitude = latitude;
104104
loc.longitude = longitude;
105105

@@ -108,7 +108,7 @@ Location ArduinoCellular::getGPSLocation(unsigned long timeout){
108108
if(this->debugStream != nullptr){
109109
this->debugStream->println("Unsupported modem model");
110110
}
111-
return Location();
111+
return Geolocation();
112112
}
113113
}
114114

Diff for: src/ArduinoCellular.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ class SMS {
7878

7979

8080
/**
81-
* @struct Location
81+
* @struct Geolocation
8282
* @brief Represents a geographic location with latitude and longitude coordinates.
8383
*/
84-
struct Location {
84+
struct Geolocation {
8585
float latitude; /**< The latitude coordinate of the location. */
8686
float longitude; /**< The longitude coordinate of the location. */
8787
};
@@ -146,7 +146,7 @@ class ArduinoCellular {
146146
* @param timeout The timeout (In milliseconds) to wait for the GPS location.
147147
* @return The GPS location. If the location is not retrieved, the latitude and longitude will be 0.0.
148148
*/
149-
Location getGPSLocation(unsigned long timeout = 60000);
149+
Geolocation getGPSLocation(unsigned long timeout = 60000);
150150

151151
/**
152152
* @brief Gets the current time from the network.

0 commit comments

Comments
 (0)