WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

readMessage

Attempt to read an incoming message from a particular SIM card slot.
The SIM card slots are normally numbered 1 to 10 but you would normally be using the number returned from 'messageWaiting'.
The function will return FALSE if the specified slot is empty, invalid, or is not an incoming message.
If the function returns TRUE then two member string variables are set: one holds the phone number of the sender, and the other is the message body.
Syntax
DroneCell. readMessage(msgIndex)
Where DroneCell is the name you have given to the device in Project Designer.
Parameters
TypeNameDescription
'msgIndex'
The index number of the message .
Returns
boolean
Note
Once you have proessed an incoming message then you should delete it to free up space on the SIM card.
Example
Assuming your device is called myDroneCell in Project Designer:
// Get next received msg no
uint8_t msgNo = myDroneCell.messageWaiting();
 
if(msgNo != 0){
    cout << "Message No.: " << msgNo;
    if(myDroneCell.readMessage(msgNo)){
        cout << "Msg: From " << myDroneCell.getMessagePhoneNumber();
        cout << "=" << myDroneCell.getMessageBody();
    }
}
See Also
getMessagePhoneNumber
getMessageBody
deleteMessage

 

 

Valid XHTML 1.0 Transitional