SIM900
|
A class for interfacing with the SIM900 GSM/GPRS module using Arduino and SoftwareSerial. More...
#include <sim900.h>
Public Member Functions | |
SIM900 (Stream &_sim900) | |
Constructor for the SIM900 class. More... | |
bool | handshake () |
Initialize communication with the SIM900 module and perform a handshake. More... | |
void | close () |
Close the communication with the SIM900 module. | |
bool | isCardReady () |
Check if the SIM card is ready. More... | |
bool | changeCardPin (uint8_t pin) |
Change the PIN code of the SIM card. More... | |
SIM900Signal | signal () |
Get the signal strength and bit error rate of the network connection. More... | |
SIM900DialResult | dialUp (String number) |
Initiate an outgoing call to a phone number. More... | |
SIM900DialResult | redialUp () |
Redial the last outgoing call. More... | |
SIM900DialResult | acceptIncomingCall () |
Accept an incoming call. More... | |
bool | hangUp () |
Hang up an active call. More... | |
bool | sendSMS (String number, String message) |
Send an SMS (Short Message Service). More... | |
bool | connectAPN (SIM900APN apn) |
Connect to an Access Point Name (APN) for mobile data. More... | |
bool | enableGPRS () |
Enable the General Packet Radio Service (GPRS) for data communication. More... | |
SIM900HTTPResponse | request (SIM900HTTPRequest request) |
Send an HTTP request to a remote server. More... | |
SIM900Operator | networkOperator () |
Get information about the current network operator. More... | |
SIM900CardAccount | cardNumber () |
Get the SIM card number. More... | |
SIM900RTC | rtc () |
Get the real-time clock (RTC) information. More... | |
bool | updateRtc (SIM900RTC config) |
Update the SIM900 module's real-time clock (RTC). More... | |
bool | savePhonebook (uint8_t index, SIM900CardAccount account) |
Save a contact in the SIM card's phonebook. More... | |
bool | deletePhonebook (uint8_t index) |
Delete a contact from the SIM card's phonebook. More... | |
SIM900CardAccount | retrievePhonebook (uint8_t index) |
Retrieve a contact from the SIM card's phonebook. More... | |
SIM900PhonebookCapacity | phonebookCapacity () |
Get information about the capacity of the SIM card's phonebook. More... | |
String | manufacturer () |
Get the manufacturer name of the SIM900 module. More... | |
String | softwareRelease () |
Get the software release version of the SIM900 module. More... | |
String | imei () |
Get the International Mobile Equipment Identity (IMEI) number of the SIM900 module. More... | |
String | chipModel () |
Get the chip model of the SIM900 module. More... | |
String | chipName () |
Get the chip name of the SIM900 module. More... | |
String | ipAddress () |
Get the IP address assigned to the SIM900 module. More... | |
A class for interfacing with the SIM900 GSM/GPRS module using Arduino and SoftwareSerial.
This class provides a wide range of functionalities for working with the SIM900 module, including sending and receiving calls, sending and receiving SMS, updating and extracting real-time clock data, sending HTTP requests, and retrieving various information about the SIM900 module's status and the network it is connected to.
SIM900::SIM900 | ( | Stream & | _sim900 | ) |
Constructor for the SIM900 class.
_sim900 | A pointer to the SoftwareSerial object for communication with the SIM900 module. |
Definition at line 84 of file sim900.cpp.
SIM900DialResult SIM900::acceptIncomingCall | ( | ) |
Accept an incoming call.
This function accepts an incoming call from another phone number.
Definition at line 165 of file sim900.cpp.
SIM900CardAccount SIM900::cardNumber | ( | ) |
Get the SIM card number.
This function retrieves information about the SIM card, including the card's name, number, type, speed, the type of phonebook where the number is stored, and the card service.
Definition at line 388 of file sim900.cpp.
bool SIM900::changeCardPin | ( | uint8_t | pin | ) |
Change the PIN code of the SIM card.
pin | The new PIN code to set. |
Definition at line 96 of file sim900.cpp.
String SIM900::chipModel | ( | ) |
Get the chip model of the SIM900 module.
Definition at line 432 of file sim900.cpp.
String SIM900::chipName | ( | ) |
Get the chip name of the SIM900 module.
Definition at line 437 of file sim900.cpp.
bool SIM900::connectAPN | ( | SIM900APN | apn | ) |
Connect to an Access Point Name (APN) for mobile data.
This function establishes a connection to an APN, enabling mobile data connectivity.
apn | An instance of the SIM900APN structure containing APN, username, and password information. |
Definition at line 217 of file sim900.cpp.
bool SIM900::deletePhonebook | ( | uint8_t | index | ) |
Delete a contact from the SIM card's phonebook.
This function deletes a contact entry from the SIM card's phonebook at the specified index.
index | The index of the contact entry to delete. |
Definition at line 365 of file sim900.cpp.
SIM900DialResult SIM900::dialUp | ( | String | number | ) |
Initiate an outgoing call to a phone number.
number | The phone number to call. |
Definition at line 125 of file sim900.cpp.
bool SIM900::enableGPRS | ( | ) |
Enable the General Packet Radio Service (GPRS) for data communication.
This function enables GPRS for data transmission over the mobile network.
Definition at line 235 of file sim900.cpp.
bool SIM900::handshake | ( | ) |
Initialize communication with the SIM900 module and perform a handshake.
Definition at line 86 of file sim900.cpp.
bool SIM900::hangUp | ( | ) |
Hang up an active call.
This function terminates an ongoing call.
Definition at line 179 of file sim900.cpp.
String SIM900::imei | ( | ) |
Get the International Mobile Equipment Identity (IMEI) number of the SIM900 module.
Definition at line 427 of file sim900.cpp.
String SIM900::ipAddress | ( | ) |
Get the IP address assigned to the SIM900 module.
Definition at line 442 of file sim900.cpp.
bool SIM900::isCardReady | ( | ) |
Check if the SIM card is ready.
Definition at line 91 of file sim900.cpp.
String SIM900::manufacturer | ( | ) |
Get the manufacturer name of the SIM900 module.
Definition at line 413 of file sim900.cpp.
SIM900Operator SIM900::networkOperator | ( | ) |
Get information about the current network operator.
This function retrieves information about the mobile network operator, including its operating mode, format, and name.
Definition at line 198 of file sim900.cpp.
SIM900PhonebookCapacity SIM900::phonebookCapacity | ( | ) |
Get information about the capacity of the SIM card's phonebook.
This function provides information about the capacity of the SIM card's phonebook memory type, including the memory type, used entries, and the maximum number of entries.
Definition at line 370 of file sim900.cpp.
SIM900DialResult SIM900::redialUp | ( | ) |
Redial the last outgoing call.
This function redials the last outgoing call to the same phone number.
Definition at line 145 of file sim900.cpp.
SIM900HTTPResponse SIM900::request | ( | SIM900HTTPRequest | request | ) |
Send an HTTP request to a remote server.
This function sends an HTTP request to a specified server with the provided request parameters.
request | An instance of the SIM900HTTPRequest structure representing the HTTP request. |
Definition at line 245 of file sim900.cpp.
SIM900CardAccount SIM900::retrievePhonebook | ( | uint8_t | index | ) |
Retrieve a contact from the SIM card's phonebook.
This function retrieves a contact entry from the SIM card's phonebook at the specified index.
index | The index of the contact entry to retrieve. |
Definition at line 342 of file sim900.cpp.
SIM900RTC SIM900::rtc | ( | ) |
Get the real-time clock (RTC) information.
This function retrieves the current date and time from the SIM900 module, including day, month, year, hour, minute, second, and the GMT offset.
Definition at line 296 of file sim900.cpp.
bool SIM900::savePhonebook | ( | uint8_t | index, |
SIM900CardAccount | account | ||
) |
Save a contact in the SIM card's phonebook.
This function saves a contact entry in the SIM card's phonebook at the specified index.
index | The index at which to save the contact entry. |
account | An instance of the SIM900CardAccount structure containing the contact's information. |
Definition at line 332 of file sim900.cpp.
bool SIM900::sendSMS | ( | String | number, |
String | message | ||
) |
Send an SMS (Short Message Service).
This function sends an SMS message to a specified phone number.
number | The recipient's phone number. |
message | The SMS message content. |
Definition at line 184 of file sim900.cpp.
SIM900Signal SIM900::signal | ( | ) |
Get the signal strength and bit error rate of the network connection.
Definition at line 104 of file sim900.cpp.
String SIM900::softwareRelease | ( | ) |
Get the software release version of the SIM900 module.
Definition at line 418 of file sim900.cpp.
bool SIM900::updateRtc | ( | SIM900RTC | config | ) |
Update the SIM900 module's real-time clock (RTC).
This function allows you to configure the SIM900 module's RTC with a new date, time, and GMT offset.
config | An instance of the SIM900RTC structure containing the new RTC configuration. |
Definition at line 282 of file sim900.cpp.