Repository navigation
class_tiny_gsm_cellular_data
Sara Damiano edited this page Oct 27, 2026
·
1 revision
Module: TinyGsmCellularData The CRTP parent class for SIM card, cellular network and cellular data functions.
#include <src/TinyGsmCellularData.tpp>
| Name | |
|---|---|
| bool |
simUnlock(const char * pin) Unlock the SIM card with a PIN code. |
| String |
getSimCCID() Get the SIM card's CCID via AT+CCID. |
| String |
getIMEI() Get the modem's TA Serial Number Identification (IMEI) via AT+GSN. |
| String |
getIMSI() Get the modem's International Mobile Subscriber Identity (IMSI) via AT+CIMI. |
| SimStatus |
getSimStatus(uint32_t timeout_ms = 10000L) Get the SIM card status. |
Tip
These functions are labeled GPRS for historical reasons - when the library was first developed, GPRS was the primary cellular data technology.
| Name | |
|---|---|
| bool |
dataConnect(const char * apn, const char * user = nullptr, const char * pwd = nullptr) Connect to a cellular data network. |
| bool |
dataDisconnect() Disconnect from the cellular data network. |
| bool |
isDataConnected() Check if currently attached to the cellular data network. |
| bool |
gprsConnect(const char * apn, const char * user = nullptr, const char * pwd = nullptr) Connect to a cellular data network. |
| bool |
gprsDisconnect() Disconnect from the cellular data network. |
| bool |
isGprsConnected() Check if currently attached to the cellular data network. |
| String |
getOperator() Get the current network operator. |
| String |
getProvider() Get the current network provider. |
bool simUnlock(const char * pin)-
Parameters:
- pin The PIN code to unlock the SIM card.
- Return: True if the SIM card was successfully unlocked, false otherwise
String getSimCCID()- Return: The SIM card's CCID as a String.
String getIMEI()- Return: The modem's IMEI as a String.
String getIMSI()- Return: The modem's IMSI as a String.
SimStatus getSimStatus(uint32_t timeout_ms = 10000L)-
Parameters:
- timeout_ms The timeout in milliseconds to wait for a response.
- Return: The SIM card status as a SimStatus enum value.
Tip
These functions are labeled GPRS for historical reasons - when the library was first developed, GPRS was the primary cellular data technology.
bool dataConnect(const char * apn, const char * user = nullptr, const char * pwd = nullptr)-
Parameters:
- apn The Access Point Name (APN) for the network.
- user The username for the APN (optional).
- pwd The password for the APN (optional).
- Return: True if the connection was successful, false otherwise.
bool dataDisconnect()- Return: True if the disconnection was successful, false otherwise.
bool isDataConnected()- Return: True if connected, false otherwise.
bool gprsConnect(const char * apn, const char * user = nullptr, const char * pwd = nullptr)-
Parameters:
- apn The Access Point Name (APN) for the network.
- user The username for the APN (optional).
- pwd The password for the APN (optional).
-
Return: True if the connection was successful, false otherwise. This is an overload for historical reasons. Use
dataConnect()instead.
bool gprsDisconnect()-
Return: True if the disconnection was successful, false otherwise. This is an overload for historical reasons. Use
dataDisconnect()instead.
bool isGprsConnected()-
Return: True if connected, false otherwise. This is an overload for historical reasons. Use
isDataConnected()instead.
String getOperator()- Return: The current network operator as a String.
String getProvider()- Return: The current network provider as a String.
Generated by Doxygen and m.css with templates from doxybook2
If you like TinyGSM library - give it a star, or fork it and contribute!