forked from PetrArduinotech/ArduinotechGSMShield
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadmeEN.txt
126 lines (106 loc) · 4.23 KB
/
readmeEN.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
ArduinotechGSMShield library description
The library is written for the Arduinotech GSM shield, see details here (Sorry, Czech only at this moment, use google translator or just look at the pictures, you will understand what is it about):
http://www.arduinotech.cz/inpage/jak-jednoduse-na-gsm-v-dil-arduinotech-gsm-shield/
Class AGS
Class namey: AGS (abbreviation ArduinotechGSMShield)
Input parameteres: debug mód -> 1=on, 0=off
Output parameters: none
Example:
creation of class instance:
AGS modul(1); //debug mode on
AGS modul(0); //debug mode off
begin();
Description: shield initialization, defines softwareSerial on RX=2, TX=3 pins, baud rate 9600 b/s, initialization of Arduino's serial port at 9600b/s, runs config procedure SIM800Init()
Input parameteres: none
Output parameteres: none
Example:
modul.begin();
SIM800Init();
Description: Config [rocedure for SIM800 module, can be used separately for handling with incorrect status of SIM800 wherever within a code. The procedure is involved in begin();
Input parameteres: none
Output parameteres: none
Example:
modul.SIM800Init();
checkCallAndSMS();
Description: Tests if call or new SMS is present. I recommend to put it into main loop.
Input parameteres: none
Output parameteresy: 0 = no call, no new SMS, 1 = new call present, 2 = new SMS
Example:
loop()
{
infoStatus = modul.checkCallAndSMS();
if (infoStatus == 1)
{
//code for call handling
}
if (infoStatus == 2)
{
//acode for SMS handling
}
}
callEnd();
Description: Sends end call command to SIM800, active call is then terminated
Input parameteres: none
Output parameteres: none
Example:
modul.callEnd();
makeCall(String callNumber);
Description: Makes call set up to given number
Input parameteres: String telephone number in national or international form without + character
Output parameteres: none
Example:
modul.makeCall(“739822476“);
getNumber();
Description: Returns string with telephon number - subscriber who called or sent SMS. Mostly getNumber() is called immediatelly after checkCallAndSMS() to work further with incomming activity.
Input parameteres: none
Output parameteres: String telephone number
Example:
infoStatus = modul.checkCallAndSMS();
if (infoStatus == 1) Serial.println(“Call from:” + modul.getNumber());
if (infoStatus == 2) Serial.println(“SMS from:” + modul.getNumber());
getSMSContent();
Description: Get content of a received SMS
Input parameteres: none
Output parameteresy: String with content of the SMS
Example:
if (infoStatus == 2)
{
Serial.println(“SMS from:” + modul.getNumber());
Serial.println(“SMS content:” + modul.getSMSContent());
}
sendSMS(String number,String sms);
Description: Sends SMS with given nuber and content
Input parameteres: String telephone number of recipient and String content of SMS
Output parameteres: none
Example:
modul.sendSMS(“73982246”,”Hello!”);
getProviderName();
Description: Returns string with name of GSM provider obtainet from the celluar network
Input parameteres: none
Output parameteres: String provider name
Example:
Serial.println(“GSM operator:” + getProviderName());
getQuality();
Description: Returns string with GSM signal quality which is paramter calculated from signal strength, latency and other parameters. This is definitely NOT a signal strength only! Values can be 0 = no signal, 1 to 30 - signal is present, the higher value, the better, 31 = overboosted.
Input parameteres: none
Output parameteres: String GSM signal quality
Pøíklad:
Serial.println(“GSM signal quality:” + getQuality());
timeStamp();
Description: Returns string with time stamp obtained from GSM network, quite accurate one.
Input parameteres: none
Output parameteres: String time stamp
Example:
Serial.println(“GSM time:” + timeStamp());
GPRSInit(String APN)
Description: Initialize of GPRS with given APN
Input parameteres: String APN
Output parameteres: bool, 1 = GPRS successfuly attached
Example:
modul.GPRSInit("internet.t-mobile.cz");
sendDataGPRS(String dataToSend)
Description: sends data over GPRS using HTTP GET method
Input parameteres String data to send - mostly HTTP link
Output parameteres: String with returned data from HTTP GET, if communication failed, then response is COMMUNICATION FAILURE
Example:
modul.sendDataGPRS("api.thingspeak.com/update?api_key=54DLXE3I1PETR61C&field1=25");