Hardware Reference
In-Depth Information
if(sms.peek()=='#')
Serial.println("This message has been discarded");
To discard a message, you can use flush() :
sms .flush();
This function deletes the SMS at the current buffer index from the modem's
memory.
VoiceCall Class
You can use the VoiceCall class to place and to answer voice calls. An Arduino
can place voice calls but cannot send voice data without additional hardware.
Most shields have an audio input and output port, allowing users to add addi-
tional components as required. This can be in the form of a microphone and
speaker, or for distress calls, it can also be an electronic component capable
of outputting wave audio. The GSM component accepts text instructions and
encodes/decodes the audio as required. Instructions include dialing numbers,
picking up and hanging up, as well as caller identity functions.
The i rst thing you must do is create an instance of the GSMVoiceCall class:
GSMVoiceCall vcs;
To place a phone call, use VoiceCall() :
result = vcs.voiceCall(number);
The number parameter is a char array and is the telephone number to call.
The function returns an int : 1 if the call were placed or 0 if it were unable to
call. This can be used as follows:
// Check if the receiving end has picked up the call
if(vcs.voiceCall(phoneNumber))
{
Serial.println("Call Established");
}
Serial.println("Call Finished");
This function places only the call and returns if the call were established. To
check on the call status, use getVoiceCallStatus() :
result = vcs .getVoiceCallStatus();
This function takes no parameters and returns IDLE_CALL , CALLING ,
RECEIVINGCALL , or TALKING , which is described in Table 17-1.
 
Search WWH ::




Custom Search