comparison src/aci2/aci/psa_btip.c @ 3:93999a60b835

src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Sep 2016 00:29:36 +0000
parents
children
comparison
equal deleted inserted replaced
2:c41a534f33c6 3:93999a60b835
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : PSA_BTIP
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 : This module defines the processing functions for the
18 | primitives send to the protocol stack adapter by BTI.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef PSA_BTIP_C
23 #define PSA_BTIP_C
24 #endif
25
26 #ifdef MFW
27 #define ENTITY_MFW
28 #else
29 #ifdef SMI
30 #define ENTITY_SMI
31 #else
32 #define ENTITY_ACI
33 #endif
34 #endif
35
36 #define ACI_MEMBER
37
38 /*==== INCLUDES ===================================================*/
39
40 #include <string.h>
41 #include <stdlib.h>
42 #include <stdio.h>
43 #include "typedefs.h"
44 #include "pconst.cdg"
45 #include "mconst.cdg"
46 #include "message.h"
47 #include "ccdapi.h"
48 #include "vsi.h"
49 #include "custom.h"
50 #include "gsm.h"
51 #include "prim.h"
52 #include "cnf_aci.h"
53 #include "mon_aci.h"
54 #include "pei.h"
55 #include "tok.h"
56 #include "dti.h" /* functionality of the dti library */
57 #include "aci_cmh.h"
58 #include "ati_cmd.h"
59 #include "aci_cmd.h"
60
61 #include "aci_fd.h"
62 #include "aci_io.h"
63 #include "aci.h"
64 #include "psa.h"
65 #include "cmh.h"
66
67 #include "aci_lst.h"
68 #include "psa_uart.h"
69 #include "cmh_uart.h"
70
71 #include "psa_cc.h"
72
73 #include "psa_bti.h"
74
75 /*==== CONSTANTS ==================================================*/
76 /*==== TYPES ======================================================*/
77 /*==== EXPORT =====================================================*/
78 /*==== VARIABLES ==================================================*/
79 /*==== FUNCTIONS ==================================================*/
80
81 /*
82 +-------------------------------------------------------------------+
83 | PROJECT : GSM-PS (6147) MODULE : PSA_BTI |
84 | ROUTINE : psa_btp_dti_cnf |
85 +-------------------------------------------------------------------+
86
87 PURPOSE : processes the BTP_DTI_CNF primitive sent by BTI.
88
89 */
90
91 GLOBAL const void psa_btp_dti_cnf (T_BTP_DTI_CNF *btp_dti_cnf)
92 {
93 TRACE_FUNCTION("psa_btp_dti_cnf");
94
95 switch( btp_dti_cnf->dti_conn )
96 {
97 case BTI_CONNECT_DTI:
98 /* tell DTI MNG that connection is closed */
99 dti_entity_connected (
100 (UBYTE)btp_dti_cnf->link_id,
101 DTI_ENTITY_BLUETOOTH,
102 DTI_MNG_AWAIT_UNKNOWN
103 );
104 break;
105
106 case BTI_DISCONNECT_DTI:
107 /* tell DTI MNG that connection is established */
108 dti_entity_connected( (UBYTE)btp_dti_cnf->link_id, CONNECTED, UNIT_BLUETOOTH );
109 break;
110
111 case BTI_ERROR_DTI:
112 TRACE_EVENT ("psa_btp_dti_cnf(): unable to open dti_connection.");
113
114 /* tell DTI manager that establishment has failed */
115 dti_entity_connected( (UBYTE)btp_dti_cnf->link_id, ERROR, UNIT_BLUETOOTH);
116 break;
117
118 default:
119 TRACE_ERROR ("psa_btp_dti_cnf(): unknown dti_conn parameter!");
120 break;
121 }
122
123 PFREE (btp_dti_cnf);
124 }
125
126
127 /*
128 +-------------------------------------------------------------------+
129 | PROJECT : GSM-PS (6147) MODULE : PSA_BTI |
130 | ROUTINE : psa_btp_dti_ind |
131 +-------------------------------------------------------------------+
132
133 PURPOSE : processes the BTI_DTI_IND primitive sent by BTI.
134
135 */
136
137 GLOBAL const void psa_btp_dti_ind( T_BTP_DTI_IND *btp_dti_ind )
138 {
139 TRACE_FUNCTION("psa_btp_dti_ind");
140
141 switch( btp_dti_ind->dti_conn )
142 {
143 case BTI_CONNECT_DTI:
144 /* tell DTI MNG that connection is closed */
145 dti_entity_disconnected (
146 (UBYTE)btp_dti_ind->link_id,
147 UNIT_BLUETOOTH,
148 DTI_MNG_AWAIT_UNKNOWN
149 );
150 break;
151
152 case BTI_DISCONNECT_DTI:
153 /* tell DTI MNG that connection is established */
154 dti_entity_connected( (UBYTE)btp_dti_ind->link_id, CONNECTED, UNIT_BLUETOOTH );
155 break;
156
157 case BTI_ERROR_DTI:
158 TRACE_EVENT ("psa_btp_dti_ind(): unable to open dti_connection.");
159
160 /* tell DTI manager that establishment has failed */
161 dti_entity_connected( (UBYTE)btp_dti_ind->link_id, ERROR, UNIT_BLUETOOTH );
162 break;
163
164 default:
165 TRACE_ERROR ("psa_btp_dti_ind(): unknown dti_conn parameter!");
166 break;
167 }
168
169 PFREE(btp_dti_ind);
170 }
171
172 /*==== EOF =========================================================*/
173