-20-
v7.3
Software
4.7.2. Sending SMSs
The
sendSMS()
function sends an SMS to the given phone number. The maximum length of the message to be
sent is 164 bytes.
Example of use:
{
char phone_number[] = “*********”;
char text_message[] = “This_is_a_text_message”;
_4G.sendSMS(phone_number, text_message);
}
Possible error codes for this function:
•
1: not registered, ME is not currently searching for a new operator to register to
•
2: not registered, but ME is currently searching for a new operator to register to
•
3: registration denied
•
4: unknown connection error
•
5: if error setting the phone number
•
6: if error sending the body
Example of sending a text message:
www.libelium.com/development/waspmote/examples/4g-04-sending-sms
4.7.3. Reading SMSs
The
readSMS()
function reads an SMS from the module storage. The user must give the index of the SMS to be
read from memory. In the case a new SMS is received, all SMS related parameters are stored in the Waspmote’s
library structures: index number, status, sender number, date and time. The SMS text field can be found in
_4G._
buffer
.
Example of use:
{
uint8_t index = 5;
_4G.readSMS(index);
}
The
readNewSMS()
function reads the last unread SMS received by the module. There are 2 function prototypes:
with or without timeout. If the user needs to wait for a new text message for a period of time, the timeout must
be specified as input. If no input is defined, the request for new text messages is instantly performed. In the case
a new SMS is received, all SMS related parameters are stored in the Waspmote’s library structures: index number,
status, sender number, date and time. The SMS text field can be found in
_4G._buffer
.
Example of use:
{
_4G.readNewSMS(30000);
}
Содержание LE910
Страница 1: ...Waspmote 4G Networking Guide ...