Skip to content

class_tiny_gsm_cellular_data

Sara Damiano edited this page Oct 27, 2026 · 1 revision

TinyGsmCellularData (class)

Module: TinyGsmCellularData The CRTP parent class for SIM card, cellular network and cellular data functions.

#include <src/TinyGsmCellularData.tpp>

SIM card functions

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.

Cellular data functions

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.

Public Functions Documentation

SIM card functions

function simUnlock(const char *)

​

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

function getSimCCID()

​

String getSimCCID()
  • Return: The SIM card's CCID as a String.

function getIMEI()

​

String getIMEI()
  • Return: The modem's IMEI as a String.

function getIMSI()

​

String getIMSI()
  • Return: The modem's IMSI as a String.

function getSimStatus(uint32_t)

​

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.

Cellular data functions

Tip

These functions are labeled GPRS for historical reasons - when the library was first developed, GPRS was the primary cellular data technology.

function dataConnect(const char *, const char *, const char *)

​

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.

function dataDisconnect()

​

bool dataDisconnect()
  • Return: True if the disconnection was successful, false otherwise.

function isDataConnected()

​

bool isDataConnected()
  • Return: True if connected, false otherwise.

function gprsConnect(const char *, const char *, const char *)

​

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.

function gprsDisconnect()

​

bool gprsDisconnect()
  • Return: True if the disconnection was successful, false otherwise. This is an overload for historical reasons. Use dataDisconnect() instead.

function isGprsConnected()

​

bool isGprsConnected()
  • Return: True if connected, false otherwise. This is an overload for historical reasons. Use isDataConnected() instead.

function getOperator()

​

String getOperator()
  • Return: The current network operator as a String.

function getProvider()

​

String getProvider()
  • Return: The current network provider as a String.

Generated by Doxygen and m.css with templates from doxybook2

Clone this wiki locally