comparison src/g23m-aci/bat/bat_types.h @ 162:53929b40109c

src/g23m-aci: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 11 Oct 2016 02:02:43 +0000
parents
children
comparison
equal deleted inserted replaced
161:4557e2a9c18e 162:53929b40109c
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-F&D (8411)
4 | Modul : BAT library
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : types for binary AT commands
18 +-----------------------------------------------------------------------------
19 */
20
21 #ifndef BAT_TYPES_H
22 #define BAT_TYPES_H
23
24 #include "p_bat.h"
25 #include "bat_cfg.h"
26
27 /*********************************************************************************
28 *
29 * defines
30 *
31 *********************************************************************************/
32 typedef unsigned char T_BAT_instance;
33 typedef unsigned short T_BAT_client;
34
35 #define BAT_RCV_BUF_SIZE 800 /* response of %SIMEF comes with 784 bytes ! */
36
37 /*********************************************************************************
38 *
39 * enumerations
40 *
41 *********************************************************************************/
42 typedef enum
43 {
44 BAT_INSTANCE_IDLE = 0,
45 BAT_INSTANCE_ACTIVATING,
46 BAT_INSTANCE_READY,
47 BAT_INSTANCE_BUSY /* the busy state for direction from APP to GDD */
48 }T_BAT_instance_state;
49
50 typedef enum
51 {
52 BAT_CLIENT_IDLE = 0,
53 BAT_CLIENT_ACTIVATING,
54 BAT_CLIENT_READY,
55 BAT_CLIENT_BUSY, /* the busy state for direction from APP to GDD */
56 BAT_CLIENT_SENDING,
57 BAT_CLIENT_SENDING_AND_BUSY /* cmd sending + abort busy */
58 }T_BAT_client_state;
59
60
61 typedef enum
62 {
63 BAT_BUF_EMPTY,
64 BAT_BUF_FILLING,
65 BAT_BUF_FILLED
66 }T_BAT_buf_state;
67
68 typedef enum
69 {
70 BAT_NEW_INSTANCE_SUCCEED = 0,
71 BAT_NEW_INSTANCE_FAIL,
72 BAT_OPEN_CLIENT_SUCCEED,
73 BAT_OPEN_CLIENT_FAIL,
74 BAT_ABORT_COMMAND_SUCCEED,
75 BAT_ABORT_COMMAND_FAIL,
76 BAT_READY_RESOURCE
77 }T_BAT_signal;
78
79 typedef struct
80 {
81 T_GDD_BUF *gdd_buf; /* to memorize the address of the sent GDD buffer*/
82 T_GDD_BUF *gdd_buf_rcv; /* to memorize the address of the received GDD buffer*/
83 T_BAT_client dest;
84 T_BAT_buf_state buf_st;
85 T_BAT_cmd_response rsp;
86 char data[BAT_RCV_BUF_SIZE];
87 } T_BAT_buffer;
88
89 typedef struct
90 {
91 T_BAT_client_state client_state;
92 void (*signal_cb) (T_BAT_client client,
93 T_BAT_signal signal);
94 int (*response_cb) (T_BAT_client client,
95 T_BAT_cmd_response *response);
96 }T_BAT_client_maintain;
97
98
99 typedef struct
100 {
101 T_GDD_SEGMENT* desc;
102 U16 length;
103 } T_BAT_l2p_maintain;
104
105
106 typedef struct
107 {
108 unsigned long con_handle;
109 T_BAT_instance_state instance_state;
110 unsigned char max_client_num;
111 T_BAT_l2p_maintain l2p_mt;
112 T_BAT_buffer buffer;
113 T_BAT_config *config;
114 int sem_BAT; /* should be T_HANDLE, but we don't want to include "vsi.h" */
115 void (*instance_signal_cb) (T_BAT_signal signal);
116 int (*unsolicited_result_cb)(T_BAT_client client,
117 T_BAT_cmd_response *response);
118 }T_BAT_instance_maintain;
119
120 #endif /*BAT_TYPES_H*/
121
122