-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathURC.h
91 lines (77 loc) · 1.99 KB
/
URC.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef URC_h
#define URC_h
#include <Arduino.h>
#include "SMS.h"
// Library Interface Description
class URC {
private:
protected:
public:
struct CallReady {
bool updated = false;
};
struct EnterPin {
bool updated = false;
char code[11];
};
struct HttpAction {
bool updated = false;
unsigned char method;
unsigned int statusCode;
unsigned int dataLength;
};
struct Psuttz {
bool updated = false;
unsigned int year;
unsigned char month;
unsigned char day;
unsigned char hour;
unsigned char minute;
unsigned char second;
unsigned char timezone;
unsigned char dst;
};
struct NewMessageIndication {
bool updated = false;
char mem[3];
unsigned char index;
};
struct NewMessage {
bool updated = false;
struct Message *message;
bool waiting = false;
};
struct ServiceDataIndication {
bool updated = false;
unsigned char n;
char str[200];
unsigned char dcs;
};
/** Get Local Timestamp Unsolicited Result Code */
struct Psuttz psuttz;
/** Call Ready Unsolicited Result Code */
struct CallReady callReady;
/** +CPIN Unsolicited Result Code */
struct EnterPin enterPin;
/** +HTTPACTION Unsolicited Result Code */
struct HttpAction httpAction;
/** +CMTI Unsolicited Result Code */
struct NewMessageIndication newMessageIndication;
/** +CMT Unsolicited Result Code */
struct NewMessage newMessage;
/** +CUSD Unsolicited Result Code */
struct ServiceDataIndication serviceDataIndication;
URC();
/**
* Unsolicited Result Code (URC) check, if it URC,
* then update URC Object member value
* @param urc Unsolicited Result Code string
* @return true: If it is URC, false: If it is not
*/
bool unsolicitedResultCode(const char urcResponse[]);
bool unsolicitedResultCode(const __FlashStringHelper *urc);
/** Reset URC Object member value. This should be called if Module Reset */
void resetUnsolicitedResultCode(void);
};
extern URC Urc;
#endif