-
Notifications
You must be signed in to change notification settings - Fork 319
/
at_response.h
85 lines (70 loc) · 1.5 KB
/
at_response.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
/*
Copyright (C) 2010 bg <[email protected]>
*/
#ifndef CHAN_DONGLE_AT_RESPONSE_H_INCLUDED
#define CHAN_DONGLE_AT_RESPONSE_H_INCLUDED
#include "export.h" /* EXPORT_DECL EXPORT_DEF */
struct pvt;
struct iovec;
/* magic order!!! keep this enum order same as in at_responses_list */
typedef enum {
RES_PARSE_ERROR = -1,
RES_MIN = RES_PARSE_ERROR,
RES_UNKNOWN = 0,
RES_BOOT,
RES_BUSY,
RES_CEND,
RES_CMGR,
RES_CMS_ERROR,
RES_CMTI,
RES_CNUM,
RES_CONF,
RES_CONN,
RES_COPS,
RES_CPIN,
RES_CREG,
RES_CSQ,
RES_CSSI,
RES_CSSU,
RES_CUSD,
RES_ERROR,
RES_MODE,
RES_NO_CARRIER,
RES_NO_DIALTONE,
RES_OK,
RES_ORIG,
RES_RING,
RES_RSSI,
RES_SMMEMFULL,
RES_SMS_PROMPT,
RES_SRVST,
RES_CVOICE,
RES_CMGS,
RES_CPMS,
RES_CSCA,
RES_CLCC,
RES_CCWA,
RES_MAX = RES_CCWA,
} at_res_t;
/*! response description */
typedef struct at_response_t
{
at_res_t res;
const char* name;
const char* id;
unsigned idlen;
} at_response_t;
/*! responses control */
typedef struct at_responses_t
{
const at_response_t* responses;
unsigned ids_first; /*!< index of first id */
unsigned ids; /*!< number of ids */
int name_first; /*!< value of enum for first name */
int name_last; /*!< value of enum for last name */
} at_responses_t;
/*! responses description */
EXPORT_DECL const at_responses_t at_responses;
EXPORT_DECL const char* at_res2str (at_res_t res);
EXPORT_DECL int at_response (struct pvt* pvt, const struct iovec * iov, int iovcnt, at_res_t at_res);
#endif /* CHAN_DONGLE_AT_RESPONSE_H_INCLUDED */