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
|
#include <stdint.h>
#include "../event.h"
#define EOS_CELL_MTYPE_DEV 0x10
#define EOS_CELL_MTYPE_VOICE 0x20
#define EOS_CELL_MTYPE_SMS 0x30
#define EOS_CELL_MTYPE_CBS 0x40
#define EOS_CELL_MTYPE_USSD 0x50
#define EOS_CELL_MTYPE_PDP 0x60
#define EOS_CELL_MTYPE_MASK 0xf0
#define EOS_CELL_MAX_MTYPE 8
/* EOS_CELL_MTYPE_DEV subtypes */
#define EOS_CELL_MTYPE_STATUS 1
#define EOS_CELL_MTYPE_UART_DATA 2
#define EOS_CELL_MTYPE_UART_TAKE 3
#define EOS_CELL_MTYPE_UART_GIVE 4
#define EOS_CELL_MTYPE_RESET 5
#define EOS_CELL_MTYPE_VOICE_PCM 1
#define EOS_CELL_MTYPE_VOICE_DIAL 2
#define EOS_CELL_MTYPE_VOICE_RING 3
#define EOS_CELL_MTYPE_VOICE_ANSWER 4
#define EOS_CELL_MTYPE_VOICE_HANGUP 5
#define EOS_CELL_MTYPE_VOICE_BEGIN 6
#define EOS_CELL_MTYPE_VOICE_END 7
#define EOS_CELL_MTYPE_VOICE_MISS 8
#define EOS_CELL_MTYPE_VOICE_BUSY 9
#define EOS_CELL_MTYPE_VOICE_ERR 10
#define EOS_CELL_MTYPE_SMS_MSG 1
#define EOS_CELL_MTYPE_SMS_LIST 2
#define EOS_CELL_MTYPE_SMS_LIST_ITEM 3
#define EOS_CELL_MTYPE_USSD_REQUEST 1
#define EOS_CELL_MTYPE_USSD_REPLY 2
#define EOS_CELL_MTYPE_USSD_CANCEL 3
#define EOS_CELL_MTYPE_PDP_GET_APN 1
#define EOS_CELL_MTYPE_PDP_GET_USR 2
#define EOS_CELL_MTYPE_PDP_GET_PWD 3
#define EOS_CELL_MTYPE_PDP_SET_APN 4
#define EOS_CELL_MTYPE_PDP_SET_USR 5
#define EOS_CELL_MTYPE_PDP_SET_PWD 6
#define EOS_CELL_MTYPE_PDP_CONNECT 7
#define EOS_CELL_MTYPE_PDP_DISCONNECT 8
#define EOS_CELL_STATUS_RESET 0
#define EOS_CELL_STATUS_IDLE 1
#define EOS_CELL_STATUS_RELAY 2
#define EOS_CELL_STATUS_PPP 3
#define EOS_CELL_SMS_ADDRTYPE_INTL 1
#define EOS_CELL_SMS_ADDRTYPE_ALPHA 2
#define EOS_CELL_SMS_ADDRTYPE_OTHER 3
#define EOS_CELL_SIZE_PHNUM 16
#define EOS_CELL_SMS_SIZE_ADDR 20
#define EOS_CELL_SMS_SIZE_TS 25
#define EOS_CELL_SMS_SIZE_TXT 160
#define EOS_CELL_USSD_SIZE_REQ 128
#define EOS_CELL_PDP_SIZE_APN 63
#define EOS_CELL_PDP_SIZE_USR 63
#define EOS_CELL_PDP_SIZE_PWD 63
#define EOS_CELL_PDP_SIZE_ARG 63
void eos_cell_init(void);
void eos_cell_set_handler(unsigned char mtype, eos_evt_handler_t handler);
eos_evt_handler_t eos_cell_get_handler(unsigned char mtype);
int eos_cell_send_buffer(unsigned char *buffer, uint16_t buf_len, uint16_t offset, int sync);
int eos_cell_status_parse(unsigned char *buffer, uint16_t len, uint8_t *status, uint8_t *connected);
int eos_cell_status(uint8_t *status, uint8_t *connected, unsigned char *buffer);
int eos_cell_uart_take(unsigned char *buffer, int sync);
int eos_cell_uart_give(unsigned char *buffer, int sync);
unsigned char *eos_cell_uart_data_buffer(uint16_t *offset);
int eos_cell_voice_dial(char *num, unsigned char *buffer, int sync);
int eos_cell_voice_answer(unsigned char *buffer, int sync);
int eos_cell_voice_hangup(unsigned char *buffer, int sync);
unsigned char *eos_cell_voice_pcm_buffer(uint16_t *offset);
int eos_cell_sms_send(char *addr, char *txt, unsigned char *buffer, int sync);
int _eos_cell_sms_parse(unsigned char *buffer, uint16_t len, char **addr, uint16_t *addr_len, char **txt, uint16_t *txt_len);
int eos_cell_sms_parse(unsigned char *buffer, uint16_t len, char *addr, uint16_t addr_size, char *txt, uint16_t txt_size);
int eos_cell_pdp_get(unsigned char atype, char *arg, uint16_t arg_size, unsigned char *buffer);
int eos_cell_pdp_set(unsigned char atype, char *arg, unsigned char *buffer, int sync);
int eos_cell_pdp_get_apn(char *apn, uint16_t apn_size, unsigned char *buffer);
int eos_cell_pdp_set_apn(char *apn, unsigned char *buffer, int sync);
int eos_cell_pdp_get_usr(char *usr, uint16_t usr_size, unsigned char *buffer);
int eos_cell_pdp_set_usr(char *usr, unsigned char *buffer, int sync);
int eos_cell_pdp_get_pwd(char *pwd, uint16_t pwd_size, unsigned char *buffer);
int eos_cell_pdp_set_pwd(char *pwd, unsigned char *buffer, int sync);
int eos_cell_pdp_connect(unsigned char *buffer, int sync);
int eos_cell_pdp_disconnect(unsigned char *buffer, int sync);
|