comparison src/aci2/aci/cmh_tsts.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 : 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 "aci_all.h"
27 /*==== INCLUDES ===================================================*/
28 #include "aci.h"
29 #include "aci_cmh.h"
30
31 #ifdef FAX_AND_DATA
32 #include "aci_fd.h"
33 #endif /* of #ifdef FAX_AND_DATA */
34
35 #ifdef UART
36 #include "dti.h"
37 #include "dti_conn_mng.h"
38 #endif
39
40 #include "psa.h"
41 #include "psa_cc.h"
42 #include "psa_mm.h"
43 #include "psa_sim.h"
44 #include "cmh.h"
45 #include "cmh_cc.h"
46 #include "cmh_mm.h"
47 #include "cmh_sim.h"
48
49 #ifdef FAX_AND_DATA
50
51 #ifdef FF_FAX
52 #include "psa_t30.h"
53 #include "cmh_t30.h"
54 #endif
55
56 #include "psa_ra.h"
57 #include "cmh_ra.h"
58 #include "cmh_fsim.h" /* remove after testing */
59
60 #endif /* FAX_AND_DATA */
61
62 /*==== CONSTANTS ==================================================*/
63
64 /*==== EXPORT =====================================================*/
65
66 /*==== VARIABLES ==================================================*/
67 /*==== FUNCTIONS ==================================================*/
68
69 #ifdef FAX_AND_DATA
70
71 #ifdef _SIMULATE_FAX_DATA_
72 /*
73 +-------------------------------------------------------------------+
74 | PROJECT : GSM-PS (6147) MODULE : CMH_TSTS |
75 | ROUTINE : TST_rstSimData |
76 +-------------------------------------------------------------------+
77
78 PURPOSE : reset simulated FAX data
79
80 */
81
82 GLOBAL void TST_rstSimData( void )
83 {
84
85 TRACE_FUNCTION ("TST_rstSimData()");
86
87 pSimBuf = simDataBuf; /* remove after testing ??? */
88 sentData = 0;
89 }
90
91 /*
92 +-------------------------------------------------------------------+
93 | PROJECT : GSM-PS (6147) MODULE : CMH_TSTS |
94 | ROUTINE : TST_getSimData |
95 +-------------------------------------------------------------------+
96
97 PURPOSE : get simulated FAX data
98
99 */
100
101 GLOBAL void TST_getSimData(UBYTE *data, USHORT nomLen,
102 USHORT *actLen, UBYTE *final)
103 {
104 SHORT seq;
105
106 TRACE_FUNCTION ("TST_getSimData()");
107
108 *final = FALSE;
109 *actLen = (USHORT)(((SIM_DATA_LEN - sentData)>nomLen)?
110 nomLen:(SIM_DATA_LEN - sentData));
111
112 for( seq = *actLen/50; seq > 0; seq-- )
113 {
114 memcpy( data, pSimBuf, 50 );
115 pSimBuf += 50;
116 data += 50;
117 /* vsi_t_sleep( VSI_CALLER 0 ); */
118 }
119
120 if( (*actLen)%50 )
121 {
122 memcpy( data, pSimBuf, *actLen%50 );
123 pSimBuf += 50;
124 }
125
126 sentData += *actLen;
127
128 /*sprintf( buf, "DATA COPIED: %d DATA SENT: %d", *actLen, sentData );
129 TRACE_EVENT( "DATA COPIED" ); */
130
131 if( sentData >= SIM_DATA_LEN )
132 {
133 *final = TRUE;
134 }
135 }
136
137 #endif /*_SIMULATE_FAX_DATA_*/
138
139 #endif
140
141 /*==== EOF ========================================================*/