-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmodem_commands.h
111 lines (86 loc) · 3.34 KB
/
modem_commands.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
* modem_commands.h
* Typedefs for and declarations of modem command and response structs.
*
* Copyright 2018, 2019 Matt Rounds
*
* This file is part of ExplorerLink.
*
* ExplorerLink is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* ExplorerLink is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* ExplorerLink. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef MODEM_COMMANDS_H_
#define MODEM_COMMANDS_H_
#include <stdbool.h>
#include <stdint.h>
/* A command to be sent to the modem */
typedef struct {
uint8_t *pucData;
} ModemCommand_t;
/* A response from the modem. ulCheckLength is the hard-coded length of the
* response string, used when the response contains variable data after the
* initial set of characters. This allows for checking only the initial
* characters when confirming a response. */
typedef struct {
uint8_t *pucData; /* The response string */
uint32_t ulCheckLength; /* The number of characters to check for */
} ModemResponse_t;
/*
* Common responses
*/
extern const ModemResponse_t rspOK;
extern const ModemResponse_t rspERROR;
/*
* Commands, grouped with their unique responses
*/
extern const ModemCommand_t cmdAT;
extern const ModemCommand_t cmdATE0;
extern const ModemResponse_t rspATE0Echo;
extern const ModemCommand_t cmdATCCLK;
extern const ModemResponse_t rspATCCLK;
extern const ModemCommand_t cmdATCBC;
extern const ModemResponse_t rspATCBC;
extern const ModemCommand_t cmdATCSQ;
extern const ModemResponse_t rspATCSQ;
extern const ModemCommand_t cmdATCIPMODEQuery;
extern const ModemResponse_t rspATCIPMODECommandMode;
extern const ModemResponse_t rspATCIPMODEDataMode;
extern const ModemCommand_t cmdATCIPMODE0;
extern const ModemCommand_t cmdATCIPMODE1;
extern const ModemCommand_t cmdATNETOPENQuery;
extern const ModemResponse_t rspATNETOPENTrue;
extern const ModemResponse_t rspATNETOPENFalse;
extern const ModemCommand_t cmdATNETOPEN;
extern const ModemResponse_t rspATNETOPENSuccess;
extern const ModemResponse_t rspATNETOPENIPErr;
extern const ModemCommand_t cmdATNETCLOSE;
extern const ModemResponse_t rspATNETCLOSESuccess;
extern const ModemCommand_t cmdATCIPOPENQuery;
extern const ModemResponse_t rspATCIPOPENTrue;
extern const ModemResponse_t rspATCIPOPENFalse;
extern const ModemResponse_t rspATCIPOPENRest;
extern const ModemCommand_t cmdATCIPOPEN;
extern const ModemResponse_t rspATCIPOPENConnect;
extern const ModemResponse_t rspATCIPOPENSuccess;
extern const ModemResponse_t rspATCIPOPENFail;
extern const ModemResponse_t rspATCIPRcv;
extern const ModemResponse_t rspATCIPIPD;
extern const ModemResponse_t rspCLOSED;
extern const ModemCommand_t cmdPlus;
extern const ModemCommand_t cmdATO;
extern const ModemCommand_t cmdATCIPCLOSE;
extern const ModemResponse_t rspATCIPCLOSESuccess;
extern const ModemCommand_t cmdATCIPSEND;
extern const ModemResponse_t rspATCIPSENDPrompt;
extern const ModemResponse_t rspServerCommand;
#endif /* MODEM_COMMANDS_H_ */