Skip to content

Rename Location to CellularLocation #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ` [`Geolocation`](#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 `Geolocation` <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();
Geolocation 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);
Geolocation 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){
Geolocation 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;
Geolocation 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 Geolocation();
}
}

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 Geolocation
* @brief Represents a geographic location with latitude and longitude coordinates.
*/
struct Location {
struct Geolocation {
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);
Geolocation getGPSLocation(unsigned long timeout = 60000);

/**
* @brief Gets the current time from the network.
Expand Down
Loading