config.h
14.8 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
#ifndef __CONFIG_H
#define __CONFIG_H
#include "btdrv_config.h"
/***************************************************************************
*
* File:
* $Workfile:config.h$ for iAnywhere Blue SDK, Version 2.1.1
* $Revision:43$
*
* Description:
* This file contains declarations for default protocol stack
* configuration.
*
* Created:
* November 19, 1996
*
* Copyright 1999-2005 Extended Systems, Inc.
* Portions copyright 2005 iAnywhere Solutions, Inc.
* All rights reserved. All unpublished rights reserved.
*
* Unpublished Confidential Information of iAnywhere Solutions, Inc.
* Do Not Disclose.
*
* No part of this work may be used or reproduced in any form or by any
* means, or stored in a database or retrieval system, without prior written
* permission of iAnywhere Solutions, Inc.
*
* Use of this work is governed by a license granted by iAnywhere Solutions,
* Inc. This work contains confidential and proprietary information of
* iAnywhere Solutions, Inc. which is protected by copyright, trade secret,
* trademark and other intellectual property rights.
*
****************************************************************************/
/*---------------------------------------------------------------------------
* General Configuration API layer
*
* The constants in this layer provide general configuration to
* communication protocol stacks compiled into the system. To change
* a constant, simply #define it in your overide.h include file.
*
* Configuration constants here and in other configuration API files
* are used to make the stack more appropriate for a particular
* environment. Constants can be modified to allow tradeoffs
* between code size, RAM usage, functionality, and throughput.
*
* Some constants are numeric, and others indicate whether a feature
* is enabled (defined as XA_ENABLED) or disabled (defined as
* XA_DISABLED).
*/
/****************************************************************************
*
* Constants
*
****************************************************************************/
//Move to \mcu\interface\hal\bluetooth\btdrv_config.h
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#ifndef XA_DEBUG
#if defined(XADEBUG) || defined(_DEBUG)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#else /* defined(XADEBUG) || defined(_DEBUG) */
/* under construction !*/
#endif /* defined(XADEBUG) || defined(_DEBUG) */
#endif /* XA_DEBUG */
/* under construction !*/
#endif
#ifndef XA_DEBUG_PRINT
/*---------------------------------------------------------------------------
* XA_DEBUG_PRINT constant
*
* When XA_DEBUG_PRINT is enabled, calls to OS_Report are
* enabled throughout the stack. These calls provide useful information
* about the internal state of the stack.
*
* When XA_DEBUG is disabled, OS_Report calls are not compiled into the
* stack. This results in a significant code size savings.
*
* By default, XA_DEBUG_PRINT inherits the state of the XA_DEBUG option.
* By setting it manually, you can control whether debug output messages
* appear independently of XA_DEBUG.
*/
#define XA_DEBUG_PRINT XA_DEBUG
#endif /* XA_DEBUG_PRINT */
#ifndef IRDA_STACK
/*---------------------------------------------------------------------------
* IRDA_STACK constant
*
* Controls whether IrDA-specific functionality is compiled into the
* system. This option is used in systems that can accommodate multiple
* transport mechanisms.
*
* By default, the IrDA stack is disabled.
*/
#define IRDA_STACK XA_DISABLED
#endif /* IRDA_STACK */
#ifndef BT_STACK
/*---------------------------------------------------------------------------
* BT_STACK constant
*
* Controls whether Bluetooth-specific functionality is compiled into
* the system. This option is used in systems that can accommodate
* multiple transport mechanisms.
*/
#define BT_STACK XA_ENABLED
#endif /* BT_STACK */
#ifndef OEM_STACK
#define OEM_STACK XA_DISABLED
#endif
#ifndef TCP_STACK
#define TCP_STACK XA_DISABLED
#endif
#ifndef XA_ERROR_CHECK
/*---------------------------------------------------------------------------
* XA_ERROR_CHECK constant
*
* Controls whether error checking code is compiled into the system.
*
* When XA_ERROR_CHECK is enabled, error checking code protects the
* stack API from illegal usage by verifying the entrance conditions
* for API call. This includes checking to make sure the API was called
* at the correct time, and checking each parameter for correctness
* before proceeding with any other processing.
*
* If an API returns a value marked XA_ERROR_CHECK only, the calling
* application has made a defective call which must be fixed.
*
* When XA_ERROR_CHECK is disabled, error checking code is not
* compiled into the system. This means that invalid API calls may
* cause strange errors to occur.
*
* Disabling error checking will result in significant code size savings,
* but it must only be disabled if you are confident that applications
* will not call stack APIs at inappropriate times or with invalid
* parameters.
*
* By default, error checking is enabled.
*/
#define XA_ERROR_CHECK XA_ENABLED
#endif /* XA_ERROR_CHECK */
#ifndef XA_CONTEXT_PTR
/*---------------------------------------------------------------------------
* XA_CONTEXT_PTR constant
*
* Controls whether stack RAM is allocated dynamically or statically.
* All RAM used by stack components is kept in a stack context structure.
*
* When XA_CONTEXT_PTR is enabled, accesses to the context structure
* are performed using the "->" operand. This is required when
* the context structure is allocated dynamically (at run time).
*
* When XA_CONTEXT_PTR is disabled, accesses to the context structure
* are performed using the more efficient "." operand. This is allowed
* only if the context structure is allocated statically (at load time).
* This is more time- and ROM-efficient because references to stack
* variables are resolved at compile time rather than run time.
*
* Internally, all accesses to the stack context are protected through
* special macros. These macros are defined based on this configuration
* constant.
*
* By default, XA_CONTEXT_PTR is disabled.
*/
#define XA_CONTEXT_PTR XA_DISABLED
#endif /* XA_CONTEXT_PTR */
//Move to \mcu\interface\hal\bluetooth\btdrv_config.h
#if 0
#ifndef XA_INTEGER_SIZE
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* XA_INTEGER_SIZE */
#endif
#ifndef XA_USE_ENDIAN_MACROS
/*---------------------------------------------------------------------------
* XA_USE_ENDIAN_MACROS constant
*
* Controls how endian conversions are executed by the stack.
*
* When XA_USE_ENDIAN_MACROS is enabled, macros are used to perform
* big-endian and little-endian conversions. This increases overall
* ROM code size, but reduces RAM usage of the calling stack and
* reduces code execution time. Enabling XA_USE_ENDIAN_MACROS is similar
* to "inlining" all endian conversion routines.
*
* When XA_USE_ENDIAN_MACROS is disabled, function calls are substituted
* to convert big- and little-endian values. This increases execution
* time and calling stack RAM usage slightly, but decreases ROM code
* size.
*
* By default, endian macros are disabled (functions are used instead).
*/
#define XA_USE_ENDIAN_MACROS XA_DISABLED
#endif /* XA_USE_ENDIAN_MACROS */
#ifndef XA_MULTITASKING
/*---------------------------------------------------------------------------
* XA_MULTITASKING constant
*
* Controls whether the stack uses multitasking functions.
*
* When XA_MULTITASKING is enabled, the stack uses calls that protect
* the stack from reentrancy and minimize CPU usage. These calls include
* OS_StartTimer, OS_CancelTimer, OS_NotifyEvm, OS_LockStack, and
* OS_UnlockStack. This setting is appropriate when using a pre-emptive
* multitasking system.
*
* When XA_MULTITASKING is disabled, the functions listed above are not
* called by the stack. This is appropriate when using round-robin
* task scheduler that does not allow task blocking.
*
* By default, multitasking features are disabled.
*/
#define XA_MULTITASKING XA_ENABLED
#endif /* XA_MULTITASKING */
#ifndef MS_TO_TICKS
/*---------------------------------------------------------------------------
* MS_TO_TICKS()
*
* Defines the conversion between system ticks and milliseconds. On some
* platforms, OS_GetSystemTime returns values in ticks instead of
* milliseconds. In this case, MS_TO_TICKS must be defined to
* convert a duration expressed in milliseconds to ticks.
*
* For example, a system with 4.4 millisecond ticks should define this
* macro in overide.h as follows:
*
* #define MS_TO_TICKS(ms) ((ms)*10/44)
*
* By default, no conversion is performed. This is appropriate when
* OS_GetSystemTime is able to return values in milliseconds.
*/
#define MS_TO_TICKS(ms) (ms/4.615)
#endif /* MS_TO_TICKS */
#ifndef ContainingRecord
/*---------------------------------------------------------------------------
* ContainingRecord()
* Calculate the address of the base of the structure given its type
* and the address of a field within the structure.
*
* While this definition is within ANSI standards, there will probably
* be some compiler that has a problem with it. When in XA_DEBUG mode,
* a function called VerifyMacros exists that checks the behavior of
* this macro. This function will assert if this implementation of
* ContainingRecord does not work with your compiler.
*
* You may redefine the behavior of this macro by declaring a different
* version of it in your overide.h file.
*
* Parameters:
* fieldAddr - address of 'memberName'
*
* structType - structure type that contains 'memberName'
*
* memberName - name of structure member located at 'fieldAddr'
*
* Returns:
* The address of 'structType' that contains 'memberName' at 'fieldAddr'
*/
#define ContainingRecord(fieldAddr, structType, memberName) ((structType *)( \
(U8 *)(fieldAddr) - (U8 *)(&((structType *)0)->memberName)))
#endif /* ContainingRecord */
#ifndef XA_EVENTMGR
/*---------------------------------------------------------------------------
* XA_EVENTMGR constant
*
* Controls whether the Event Manager functionality is compiled into the
* system. This option is used to enable the Event Manager when the stack
* transport does not automatically include it. Note that Event Manager
* support is always included in IrDA and Bluetooth stack builds.
*
* By default, the Event Manager is disabled.
*/
#define XA_EVENTMGR XA_DISABLED
#endif /* XA_EVENTMGR */
#if !defined(XA_SNIFFER) || (XA_DEBUG == XA_DISABLED)
/*---------------------------------------------------------------------------
* XA_SNIFFER constant
*
* Controls whether the protocol sniffer hooks in various protocol layers
* are compiled into the system. The sniffer uses an endpoint registration
* function to manage a connection table which is used as a guide when
* decoding data packets. When enabled, the function SnifferRegisterEndpoint
* as described in debug.h must be implemented. When disabled, the sniffer
* functionality can still be accessed, but protocol specific decoding will
* stop at the L2CAP layer.
*
* By default, this option is disabled.
*/
#undef XA_SNIFFER
#define XA_SNIFFER XA_DISABLED
#endif /* !defined(XA_SNIFFER) || (XA_DEBUG == XA_DISABLED) */
#ifndef XA_LOAD_LIST
/*---------------------------------------------------------------------------
* XA_LOAD_LIST constant
*
* Specifies any optional protocol or profile components in this build,
* which require initialization. The core IrDA and Bluetooth protocols are
* not used in this constant. The components will be initialized in the
* order specified by this constant. If a component requires inclusion on
* this load list, it will be stated along with the initialization function
* prototype, in the main header file for the component and in the Implementer's
* Guide under the section for the profile or component being implemented.
*
* An example usage of this constant to initialize an OBEX based application is:
* #define XA_LOAD_LIST XA_MODULE(OBEX)
*
* Which will insert the following code in the event manager:
* extern BOOL OBEX_Init(void);
* if ((OBEX_Init && TRUE) != TRUE) { return FALSE; }
*
* An example of a implementation using GOEP and OBEX is:
* #define XA_LOAD_LIST XA_MODULE(OBEX) XA_MODULE(GOEP)
*
* By default, no optional protocol or profile modules are initialized.
*/
#define XA_LOAD_LIST
#endif /* XA_LOAD_LIST */
//Move to \mcu\interface\hal\bluetooth\btdrv_config.h
#if 0
#ifndef XA_STATISTICS
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* XA_STATISTICS */
/* under construction !*/
#if XA_DEBUG == XA_DISABLED
/* under construction !*/
/* under construction !*/
#endif /* XA_DEBUG == XA_DISABLED */
#endif
#if 0
#ifndef __SPP_AUTO_TX__
/* under construction !*/
#endif
#endif /* 0 */
#ifndef AG_SECURITY
#define AG_SECURITY XA_ENABLED
#endif
#endif /* __CONFIG_H */