comparison g23m-aci/aci/cmh_tsts.c @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : CMH_TSTS
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 provides test functions for debugging
18 | puposes.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef CMH_TSTS_C
23 #define CMH_TSTS_C
24 #endif
25
26 #include "config.h"
27 #include "fixedconf.h"
28 #include "condat-features.h"
29 #include "aci_conf.h"
30
31 #include "aci_all.h"
32 /*==== INCLUDES ===================================================*/
33 #include "aci.h"
34 #include "aci_cmh.h"
35
36 #ifdef FAX_AND_DATA
37 #include "aci_fd.h"
38 #endif /* of #ifdef FAX_AND_DATA */
39
40 #ifdef UART
41 #include "dti.h"
42 #include "dti_conn_mng.h"
43 #endif
44
45 #include "psa.h"
46 #include "psa_cc.h"
47 #include "psa_mm.h"
48 #include "psa_sim.h"
49 #include "cmh.h"
50 #include "cmh_cc.h"
51 #include "cmh_mm.h"
52 #include "cmh_sim.h"
53
54 #ifdef FAX_AND_DATA
55
56 #ifdef FF_FAX
57 #include "psa_t30.h"
58 #include "cmh_t30.h"
59 #endif
60
61 #include "psa_ra.h"
62 #include "cmh_ra.h"
63 #include "cmh_fsim.h" /* remove after testing */
64
65 #endif /* FAX_AND_DATA */
66
67 /*==== CONSTANTS ==================================================*/
68
69 /*==== EXPORT =====================================================*/
70
71 /*==== VARIABLES ==================================================*/
72 /*==== FUNCTIONS ==================================================*/
73
74 #ifdef FAX_AND_DATA
75
76 #ifdef _SIMULATE_FAX_DATA_
77 /*
78 +-------------------------------------------------------------------+
79 | PROJECT : GSM-PS (6147) MODULE : CMH_TSTS |
80 | ROUTINE : TST_rstSimData |
81 +-------------------------------------------------------------------+
82
83 PURPOSE : reset simulated FAX data
84
85 */
86
87 GLOBAL void TST_rstSimData( void )
88 {
89
90 TRACE_FUNCTION ("TST_rstSimData()");
91
92 pSimBuf = simDataBuf; /* remove after testing ??? */
93 sentData = 0;
94 }
95
96 /*
97 +-------------------------------------------------------------------+
98 | PROJECT : GSM-PS (6147) MODULE : CMH_TSTS |
99 | ROUTINE : TST_getSimData |
100 +-------------------------------------------------------------------+
101
102 PURPOSE : get simulated FAX data
103
104 */
105
106 GLOBAL void TST_getSimData(UBYTE *data, USHORT nomLen,
107 USHORT *actLen, UBYTE *final)
108 {
109 SHORT seq;
110
111 TRACE_FUNCTION ("TST_getSimData()");
112
113 *final = FALSE;
114 *actLen = (USHORT)(((SIM_DATA_LEN - sentData)>nomLen)?
115 nomLen:(SIM_DATA_LEN - sentData));
116
117 for( seq = *actLen/50; seq > 0; seq-- )
118 {
119 memcpy( data, pSimBuf, 50 );
120 pSimBuf += 50;
121 data += 50;
122 /* vsi_t_sleep( VSI_CALLER 0 ); */
123 }
124
125 if( (*actLen)%50 )
126 {
127 memcpy( data, pSimBuf, *actLen%50 );
128 pSimBuf += 50;
129 }
130
131 sentData += *actLen;
132
133 /*sprintf( buf, "DATA COPIED: %d DATA SENT: %d", *actLen, sentData );
134 TRACE_EVENT( "DATA COPIED" ); */
135
136 if( sentData >= SIM_DATA_LEN )
137 {
138 *final = TRUE;
139 }
140 }
141
142 #endif /*_SIMULATE_FAX_DATA_*/
143
144 #endif
145
146 /*==== EOF ========================================================*/