Skip to content

Commit 64ff08a

Browse files
authored
Merge pull request #10 from arduino-libraries/docs
Update documentation
2 parents 691e3da + 82da5b6 commit 64ff08a

File tree

8 files changed

+26
-32
lines changed

8 files changed

+26
-32
lines changed

.github/workflows/render-documentation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
render-docs:
2222
permissions:
2323
contents: write
24-
uses: sebromero/render-docs-github-action/.github/workflows/render-docs.yml@main
24+
uses: sebromero/render-docs-github-action/.github/workflows/render-docs.yml@pr
2525
with:
2626
source-path: './src'
2727
target-path: './docs/api.md'

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ It allows you to connect to the internet, send and receive SMS messages, and get
2727
1. Insert your Arduino 4G module to the [Arduino Portenta Mid Carrier](https://store.arduino.cc/collections/portenta-family/products/portenta-mid-carrier)
2828
2. Insert a valid SIM card either in the **PCIE_SIM** connector on the Portenta Mid Carrier
2929
3. Connect the 5 **SERIAL1** header pins to their corresponding pins on the **PCIE_BREAKOUT** header using jumpers
30-
![](https://raw.githubusercontent.com/arduino-libraries/Arduino_Cellular/main/extras/connection_img/header.jpg?token=GHSAT0AAAAAACNPRJPUBHNVP3J3KMRPUULUZQVDLKQ)
30+
![](./docs/header.jpg)
3131
4. Connect the **3V3 PCIE** pin to the **3V3 Buck**
32-
![](https://raw.githubusercontent.com/arduino-libraries/Arduino_Cellular/main/extras/connection_img/buck.jpg?token=GHSAT0AAAAAACNPRJPUBUCALG2FUCDZ7AVCZQVDLJA)
32+
![](./docs/buck.jpg)
3333
5. Connect external power to the Mid Carrier, via the **VIN** (5V) because modems use a lot of power when connecting or getting a GPS location. Make sure your supply can handle around 3A.
3434
6. Get the APN settings from your network operator and add them to the "arduino_secrets.h" file for each sketch
3535
```cpp

docs/api.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This class provides methods to interact with the Arduino Pro Modem, such as conn
2222
| [`connect`](#class_arduino_cellular_1a7fb3c3e841b39c4faacef32cec6277b4) | Registers with the cellular network and connects to the Internet if the APN, GPRS username, and GPRS password are provided. |
2323
| [`isConnectedToOperator`](#class_arduino_cellular_1af7453ef90702e9042e2b4b18fa89db03) | Checks if the modem is registered on the network. |
2424
| [`isConnectedToInternet`](#class_arduino_cellular_1a6f8251e06de1810897b8bd8f8fb1b1a2) | Checks if the GPRS network is connected. |
25-
| [`enableGPS`](#class_arduino_cellular_1abe77a53e0eba6e8d62ba5db3bb6f5e92) | Enables or disables the GPS module. |
25+
| [`enableGPS`](#class_arduino_cellular_1abe77a53e0eba6e8d62ba5db3bb6f5e92) | Enables or disables the GPS functionality. |
2626
| [`getGPSLocation`](#class_arduino_cellular_1aee57a2eec5be06172b2fb7cd574d9106) | Gets the GPS location. (Blocking call) |
2727
| [`getCellularTime`](#class_arduino_cellular_1a6b3ce5485badff582584d539e790aff4) | Gets the current time from the network. |
2828
| [`getGPSTime`](#class_arduino_cellular_1a4aeb898c958e6eb001d606f0c7da8799) | Gets the current time from the GPS module. |
@@ -126,13 +126,13 @@ True if the GPRS network is connected, false otherwise.
126126
bool enableGPS(bool assisted)
127127
```
128128
129-
Enables or disables the GPS module.
129+
Enables or disables the GPS functionality.
130130
131131
#### Parameters
132132
* `assisted` True to enable assisted GPS, false to disable it. Assist GPS uses the network to get the GPS location faster, so cellular needs to be enabled.
133133
134134
#### Returns
135-
True if the GPS module is enabled, false otherwise.
135+
True if GPS was enabled successfully, false otherwise.
136136
<hr />
137137
138138
### `getGPSLocation` <a id="class_arduino_cellular_1aee57a2eec5be06172b2fb7cd574d9106" class="anchor"></a>
File renamed without changes.
File renamed without changes.

docs/readme.md

+18-23
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
# Arduino Cellular Library
1+
# 📡 Arduino Cellular Library
22

3-
4-
## Initialising
3+
## ⤵️ Initialising
54
This guide outlines the steps to establish cellular network connectivity using an Arduino equipped with a cellular modem. The process involves initializing the modem, setting necessary configurations, and establishing a connection to the network.
65

76
First, you need to include the ArduinoCellular library in your sketch. This library facilitates communication between your Arduino board and the cellular module.
87

9-
```c
8+
```cpp
109
#include <ArduinoCellular.h>
1110
```
1211

1312
Create an instance of the ArduinoCellular class. This instance will be used to interact with the cellular module.
1413

15-
```c
14+
```cpp
1615
ArduinoCellular cellular = ArduinoCellular();
1716
```
1817

1918
To begin, initialize the modem with basic configurations such as setting the modem to text mode, enabling intrrerupts etc. This is done by calling the begin() method on your cellular instance.
20-
```c
19+
```cpp
2120
cellular.begin();
2221
```
2322

24-
To connect to your mobile network and start a cellular data session, use the connect() method. This requires the APN (Access Point Name), login credentials (if any), and your SIM card's PIN number (if it's locked).
23+
To connect to your mobile network and start a cellular data session, use the connect() method. This requires the APN (Access Point Name) and login credentials (if any). You can unlock your SIM card's using its PIN number (if it's locked).
2524

26-
```c
27-
cellular.connect(SECRET_GPRS_APN, SECRET_GPRS_LOGIN, SECRET_GPRS_PASSWORD, SECRET_PINNUMBER);
25+
```cpp
26+
cellular.unlockSIM(SECRET_PINNUMBER)
27+
cellular.connect(SECRET_GPRS_APN, SECRET_GPRS_LOGIN, SECRET_GPRS_PASSWORD);
2828

2929
```
3030

@@ -33,7 +33,7 @@ Note: It's a best practice to store sensitive information like the GPRS APN, log
3333
**arduino_secrets.h**
3434
Create or edit the arduino_secrets.h file in your project directory and define the necessary secrets as follows:
3535

36-
```c
36+
```cpp
3737
#define SECRET_GPRS_APN "your_apn_here"
3838
#define SECRET_GPRS_LOGIN "your_login_here"
3939
#define SECRET_GPRS_PASSWORD "your_password_here"
@@ -43,7 +43,7 @@ Create or edit the arduino_secrets.h file in your project directory and define t
4343
Replace the placeholder values with the actual APN, login, password, and PIN number provided by your mobile network operator or SIM card provider.
4444
4545
46-
## Network
46+
## 🌐 Network
4747
The Arduino environment provides a set of classes designed to abstract the complexities of handling network communications. Among these, the Client class plays a crucial role as it defines a standard interface for network communication across various Arduino-compatible networking libraries.
4848
4949
The Arduino networking stack is designed to simplify the process of implementing network communication for IoT (Internet of Things) projects. This stack encompasses both hardware (e.g., Ethernet shields, WiFi modules) and software components (libraries that interface with the hardware). The stack is built in a way that allows sketches (Arduino programs) to communicate over the network using common protocols like TCP and UDP without needing to delve into the low-level mechanics of these protocols.
@@ -63,13 +63,13 @@ This layered approach is not only modular but also highly flexible, allowing dev
6363
6464
### Network Client (OSI Layer 3)
6565
Represents a basic client for network communication, suitable for protocols like TCP/IP.
66-
```c
66+
```cpp
6767
TinyGSMClient client = cellular.getNetworkClient();
6868
```
6969

7070
### Secure Network Client
7171
Adds a layer of security by implementing SSL/TLS encryption over the basic client.
72-
```c
72+
```cpp
7373
BearSSLClient secureClient = cellular.getSecureNetworkClient();
7474
```
7575

@@ -78,28 +78,28 @@ For convenience we added getters for http and https clients.
7878
### HTTP and HTTPS Clients:
7979
These are high-level clients designed for web communication. They abstract the complexities of HTTP/HTTPS protocols, making it easy to send web requests and process responses.
8080

81-
```c
81+
```cpp
8282
HttpClient http = cellular.getHTTPClient(server, port);
8383
HttpClient http = cellular.getHTTPSClient(server, port);
8484
```
8585

8686

8787

88-
## SMS
88+
## 📨 SMS
8989
The SMS functionality allows devices to exchange information with users or other systems through simple text messages, enabling a wide range of applications from remote monitoring to control systems or a fallback communication method when the others are not available.
9090

9191
### Reading SMS Messages
9292
**getReadSMS():** This method returns a vector containing SMS messages that have already been read. It's particularly useful for applications that need to process or display messages that have been acknowledged.
9393

94-
**getUnreadSMS(): **This method fetches a vector of unread SMS messages, allowing the application to process or notify users about new messages.
94+
**getUnreadSMS():** This method fetches a vector of unread SMS messages, allowing the application to process or notify users about new messages.
9595

9696
Each SMS message is represented as an instance of the `SMS` class, which contains the sender's number, the message text, and a timestamp marking when the message was received.
9797

9898

9999
### The SMS Class
100100
The SMS class serves as a container for information related to a single SMS message. It includes the following attributes:
101101

102-
* `number`: The phone number from which the SMS was sent.
102+
* `sender`: The phone number from which the SMS was sent.
103103
* `message`: The body of the SMS message.
104104
* `timestamp`: A timestamp indicating when the message was received by the module.
105105

@@ -115,7 +115,7 @@ The method sendSMS() is designed for this purpose, taking two parameters:
115115

116116
This functionality allows Arduino devices to communicate outwardly to users or other systems, sending alerts, data, or control commands via SMS.
117117

118-
## Time and Location
118+
## ⌚️📍 Time and Location
119119
These features enable precise tracking of device locations and ensure synchronized operations across different systems. This guide focuses on utilizing GPS and cellular network capabilities for location tracking and time synchronization. It's important to note that GPS functionality is exclusively available in the Global Version of the modem, highlighting the need for appropriate hardware selection based on the project requirements.
120120

121121
### GPS Location
@@ -125,11 +125,6 @@ GPS Location is ideal for applications requiring high-precision location data, s
125125

126126
To enable GPS Location you will need to call `enableGPS(bool assisted)`. Assisted GPS or A-GPS is an enhancement of GPS that uses the cellular network to get the location, it performs that much quicker than without assistance but depends on Cellular network coverage.
127127

128-
### Cellular Location
129-
**Method Overview:** `getCellularLocation(unsigned long timeout = 10000)` also provides location tracking but utilizes the cellular network. Similar to the GPS method, it's a blocking call with a specified timeout, returning latitude and longitude values through a Location structure. If the location is not obtained, the values default to 0.0.
130-
131-
Cellular location is suitable for scenarios where GPS signals are weak or unavailable, offering a broader coverage area at the expense of location accuracy. This method leverages the cellular network's infrastructure to approximate the device's location.
132-
133128
### Time Synchronization
134129
Time synchronization is crucial for maintaining accurate timing across IoT devices, especially for data logging, scheduled tasks, and time-stamped communications.
135130

src/ArduinoCellular.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ unsigned long ArduinoCellular::getTime() {
1010
}
1111

1212
ArduinoCellular::ArduinoCellular() {
13-
1413
}
1514

1615
void ArduinoCellular::begin() {

src/ArduinoCellular.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ class ArduinoCellular {
124124
bool isConnectedToInternet();
125125

126126
/**
127-
* @brief Enables or disables the GPS module.
127+
* @brief Enables or disables the GPS functionality.
128128
* @param assisted True to enable assisted GPS, false to disable it. Assist GPS uses the network to get the GPS location faster, so cellular needs to be enabled.
129-
* @return True if the GPS module is enabled, false otherwise.
129+
* @return True if GPS was enabled successfully, false otherwise.
130130
*/
131131
bool enableGPS(bool assisted = false);
132132

0 commit comments

Comments
 (0)