-
Notifications
You must be signed in to change notification settings - Fork 1
/
A6Services.h
53 lines (51 loc) · 1.75 KB
/
A6Services.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
#ifndef A6SERVICE_H
#define A6SERVICE_H
#include "A6ModemNew.h"
class A6GPRS: public virtual A6GPRSDevice
{
public:
enum eCIPstatus {IP_INITIAL,IP_START,IP_CONFIG,IP_IND,IP_GPRSACT,IP_STATUS,TCPUDP_CONNECTING,IP_CLOSE,CONNECT_OK,IP_STATUS_UNKNOWN };
enum ePSstate { DETACHED,ATTACHED,PS_UNKNOWN };
enum ecallState {IDLE,CALLER_RINGING,SPEAKING,DIALLING_OUT,CALLERID,DISCONNECTED};
A6GPRS(Stream &comm,unsigned,unsigned); // constructor uartstream, circular buffer size, max message size
~A6GPRS(); // destructor
bool getIMEI(char[]);
bool getCIMI(char[]);
bool getRTC(char[]);
bool setRTC(char[]);
enum eCIPstatus getCIPstatus();
char *getCIPstatusString(enum eCIPstatus);
char *getCIPstatusString(); // current value
bool startIP(char []); // apn
bool startIP(char [],char[],char []); // apn, username, password
ePSstate getPSstate();
bool setPSstate(ePSstate);
bool stopIP();
bool getLocalIP(char []);
bool connectTCPserver(char*,int);
bool sendToServer(char[]); // single C string
bool sendToServer(char*[],unsigned); // array of C strings
bool sendToServer(char[],int); // for ascii strings, no delimiter
bool sendToServer(byte[],int); // for byte arrays
bool connectedToServer;
byte *Parse(unsigned *);
bool dial(char[]);
bool answer();
bool hangup();
bool callerID(bool);
enum ecallState callState;
bool sendDTMF(char,unsigned);
bool sendDTMF(char);
bool sendSMS(char [],char []);
bool setSmsTextMode();
private:
eCIPstatus CIPstatus;
unsigned maxMessageLength;
volatile unsigned modemMessageLength;
byte *modemmessage;
enum eParseState {GETMM,GETLENGTH,GETDATA,GETTELEVENT};
eParseState ParseState;
unsigned clientMsgLength;
bool nextLineSMS;
};
#endif