SMS Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
SMS Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld

Allows you to send an SMS to a phone number when a certain trigger is on.

This shield is one of the communication shields.Communication shields allow you to use your smartphone as a gateway between Arduino and other phones, they make it easier to communicate with your Arduino board by sending and receiving data to or from another phone.Learn more from the communication shields tutorial.

SMS  library allows your Arduino to send and receive SMS’s to phones.

Adding #define CUSTOM_SETTINGS along with #define INCLUDE_SMS_SHIELD is a key that will let you unlock the SMS shield only amongst all shields and prevent 1Sheeld library from eating your memory specially for UNO board.

Note

– For Android M(6) or greater, there are permissions to be granted before using the Data Logger shield, please make sure to grant the permissions or else it may affect the application’s performance.
– This Shield is currently supported by Android application only and not IOS due to some software/hardware limitations.

void send(const char *,const char *)

Sends an SMS to a certain phone.

SYNTAX
SMS.send (phoneNumber,bodyMessage);

RETURNS
None.

PARAMETERS
-1st Parameter takes a const char array holding the phone number.
-2nd Parameter takes a const char array holding the body message.

USAGE
SMS.send(“XXXXXXXX”,”bodyMessage”);

 

void send(String,String)

Sends an SMS to a certain phone.

SYNTAX
SMS.send (phoneNumber,bodyMessage);

RETURNS
None.

PARAMETERS
-1st Parameter takes a string object holding the phone number.
-2nd Parameter takes a string object holding the body message.

USAGE
String number= “XXXXXXXX” ;
String message= “bodyMessage” ;
SMS.send(number,message);

 

bool isNewSms(void)

Checks if a new SMS received.
Note: using this function individual without invoking getNumber or getSms functions will always hit true as an indication that the last SMS is the newest one, So rather than using isNewSms individually “in case you are not interested in the SMS or even the number” then use the callback function setOnNewSmsReceive and whenever an SMS is received it will invoke your customized function.

SYNTAX
SMS.isNewSms();

RETURNS
None.

PARAMETERS
None.

USAGE
SMS.isNewSms();

 

char * getNumber(void)

Gets back the number messaged the smartphone.

SYNTAX
SMS.getNumber();

RETURNS
Returns a char array holding the number sent the SMS.

PARAMETERS
None.

USAGE
char* number = SMS.getNumber( );

 

String getNumberAsString(void)

Gets back the number messaged the smartphone.

SYNTAX
SMS.getNumberAsString();

RETURNS
Returns a string object holding the number sent the SMS.

PARAMETERS
None.

USAGE
String number = SMS.getNumberAsString();

 

char * getSms(void)

Gets back the sms body message.

SYNTAX
SMS.getSms();

RETURNS
Returns a char array holding the body message.

PARAMETERS
None.

USAGE
char* smsMessage = SMS.getSms( );

 

char * getSmsAsString(void)

Gets back the sms body message.

SYNTAX
SMS.getSms();

RETURNS
Returns a string object holding the body message.

PARAMETERS
None.

USAGE
String smsMessage = SMS.getSmsAsString( );

 

void setOnSmsReceive(void(*userFunction)(char*,char*))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a new SMS is received by the smartphone.

SYNTAX
Slider.setOnSmsReceive(&userFunctionName);

RETURNS
None.

PARAMETERS
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

USAGE
SMS.setOnSmsReceive(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new sms comes to smratphone. */
void myFunction (char * phoneNumber ,char * messageBody)
{
    /* Print out the phone Number and message on Terminal shield. */
    Terminal.println(phoneNumber);
    Terminal.println(mesageBody);
}

 

void setOnSmsReceive(void(*userFunction)(String,String))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a new SMS is received by the smartphone.

SYNTAX
Slider.setOnSmsReceive(&userFunctionName);

RETURNS
None.

PARAMETERS
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

USAGE
SMS.setOnSmsReceive(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new sms comes to smratphone. */
void myFunction (String phoneNumber ,String messageBody)
{
    /* Print out the phone Number and message on Terminal shield. */
    Terminal.println(phoneNumber);
    Terminal.println(mesageBody);
}