-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcore.h
73 lines (54 loc) · 1.72 KB
/
core.h
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
/*----------------------------------------------------
Name: core.h
Platform: Arduino
Autor: SunDro
Date: 2015
Copyright: See license.txt file
Description:
Header file for library of SunDroid v0.2-Nightlie
----------------------------------------------------*/
#ifndef __GPRS_SHIELD_ARDUINO_H__
#define __GPRS_SHIELD_ARDUINO_H__
#include <sim900_suli.h>
/* Message Length */
#define MESSAGE_LENGTH 20
class GPRS
{
public:
/* Create GPRS instance */
GPRS(int tx, int rx, uint32_t baudRate = 9600, const char* apn = NULL, const char* userName = NULL, const char *passWord = NULL);
/* get instance of GPRS class */
static GPRS* getInstance() {
return inst;
};
/* Send message */
int send_message(char* num, char* data);
/* Check if there is unread sms */
int is_message_unread();
/* Read sms & change status to readed */
int read_message(int smsIndex, char *msg, int length, char *phone, char *date);
/* Read Messages */
int read_message(int smsIndex, char *msg, int length);
/* Delete messages on sim card */
int delete_message(int index);
/* Function for call */
int make_call(char* num);
/* Auto answer for incoming call */
int answer(void);
/* Check sim status */
int sim_status(void);
/* initialize GPRS module including SIM card check & signal strength */
int init(void);
/* check if GPRS module is readable or not */
int readable(void);
/** wait a few time to check if gprs module is readable or not */
int wait_readable(int wait_time);
private:
SoftwareSerial gprsSerial;
PIN_T _powerPin;
static GPRS* inst;
const char* pass;
const char* m_apn;
const char* user;
};
#endif