summaryrefslogtreecommitdiffstats
path: root/bta/include/bta_op_api.h
blob: b2a624c47d3361b14172aa5071ba15d3d65f5d59 (plain)
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
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
/*****************************************************************************
**
**  Name:           bta_op_api.h
**
**  Description:    This is the public interface file for the object push
**                  (OP) client and server subsystem of BTA, Widcomm's
**                  Bluetooth application layer for mobile phones.
**
**  Copyright (c) 2003-2006, Broadcom Corp., All Rights Reserved.
**  Widcomm Bluetooth Core. Proprietary and confidential.
**
*****************************************************************************/
#ifndef BTA_OP_API_H
#define BTA_OP_API_H

#include "bta_api.h"

/*****************************************************************************
**  Constants and data types
*****************************************************************************/
/* Extra Debug Code */
#ifndef BTA_OPS_DEBUG
#define BTA_OPS_DEBUG           FALSE
#endif

#ifndef BTA_OPC_DEBUG
#define BTA_OPC_DEBUG           FALSE
#endif


/* Object format */
#define BTA_OP_VCARD21_FMT          1       /* vCard 2.1 */
#define BTA_OP_VCARD30_FMT          2       /* vCard 3.0 */
#define BTA_OP_VCAL_FMT             3       /* vCal 1.0 */
#define BTA_OP_ICAL_FMT             4       /* iCal 2.0 */
#define BTA_OP_VNOTE_FMT            5       /* vNote */
#define BTA_OP_VMSG_FMT             6       /* vMessage */
#define BTA_OP_OTHER_FMT            0xFF    /* other format */

typedef UINT8 tBTA_OP_FMT;

/* Object format mask */
#define BTA_OP_VCARD21_MASK         0x01    /* vCard 2.1 */
#define BTA_OP_VCARD30_MASK         0x02    /* vCard 3.0 */
#define BTA_OP_VCAL_MASK            0x04    /* vCal 1.0 */
#define BTA_OP_ICAL_MASK            0x08    /* iCal 2.0 */
#define BTA_OP_VNOTE_MASK           0x10    /* vNote */
#define BTA_OP_VMSG_MASK            0x20    /* vMessage */
#define BTA_OP_ANY_MASK             0x40    /* Any type of object. */

typedef UINT8 tBTA_OP_FMT_MASK;

/* Status */
#define BTA_OP_OK                   0       /* Operation successful. */
#define BTA_OP_FAIL                 1       /* Operation failed. */
#define BTA_OP_MEM                  2       /* Not enough memory to complete operation. */

typedef UINT8 tBTA_OP_STATUS;

/* vCal Object Type */
#define BTA_OP_VCAL_EVENT           0       /* Object is an "Event" object. */
#define BTA_OP_VCAL_TODO            1       /* Object is a "ToDo" object. */

typedef UINT8 tBTA_OP_VCAL;

/* vCard Property Names */
#define BTA_OP_VCARD_ADR            1       /* Address. */
#define BTA_OP_VCARD_EMAIL          2       /* Email address. */
#define BTA_OP_VCARD_FN             3       /* Formatted name. */
#define BTA_OP_VCARD_NOTE           4       /* Note. */
#define BTA_OP_VCARD_NICKNAME       5       /* Nickname. */
#define BTA_OP_VCARD_N              6       /* Name. */
#define BTA_OP_VCARD_ORG            7       /* Organization. */
#define BTA_OP_VCARD_TEL            8       /* Telephone number. */
#define BTA_OP_VCARD_TITLE          9       /* Title. */
#define BTA_OP_VCARD_URL            10      /* URL. */
#define BTA_OP_VCARD_LUID           11      /* Locally Unique Identifier. */
#define BTA_OP_VCARD_BDAY           12      /* Birthday. */
#define BTA_OP_VCARD_PHOTO          13      /* Photo. */
#define BTA_OP_VCARD_SOUND          14      /* Sound. */
#define BTA_OP_VCARD_CALL           15      /* Call date-time */

/* vCal Property Names */
#define BTA_OP_VCAL_CATEGORIES      1       /* Categories of event. */
#define BTA_OP_VCAL_COMPLETED       2       /* Time event is completed. */
#define BTA_OP_VCAL_DESCRIPTION     3       /* Description of event. */
#define BTA_OP_VCAL_DTEND           4       /* End date and time of event. */
#define BTA_OP_VCAL_DTSTART         5       /* Start date and time of event. */
#define BTA_OP_VCAL_DUE             6       /* Due date and time of event. */
#define BTA_OP_VCAL_LOCATION        7       /* Location of event. */
#define BTA_OP_VCAL_PRIORITY        8       /* Priority of event. */
#define BTA_OP_VCAL_STATUS          9       /* Status of event. */
#define BTA_OP_VCAL_SUMMARY         10      /* Summary of event. */
#define BTA_OP_VCAL_LUID            11      /* Locally Unique Identifier. */

/* vNote Property Names */
#define BTA_OP_VNOTE_BODY           1       /* Message body text. */
#define BTA_OP_VNOTE_LUID           2       /* Locally Unique Identifier. */

/* Structure of the 32-bit parameters mask:
**
**                  + property-specific
** +reserved        |        + character set
** |                |        |     + encoding
** |                |        |     |
** 0000000000000000 00000000 00000 000
*/
          
/* Encoding Parameter */
#define BTA_OP_ENC_QUOTED_PRINTABLE (1<<0)  /* Quoted-Printable encoding. */
#define BTA_OP_ENC_8BIT             (2<<0)  /* 8-bit encoding */
#define BTA_OP_ENC_BINARY           (3<<0)  /* Binary encoding */
// btla-specific ++
#define BTA_OP_ENC_BASE64           (4<<0)  /* base64 encoding */
// btla-specific --

/* Character Set Parameter */
#define BTA_OP_CHAR_BIG5            (1<<3)  /* Big5 character set. */
#define BTA_OP_CHAR_EUC_JP          (2<<3)  /* EUC-JP character set. */
#define BTA_OP_CHAR_EUC_KR          (3<<3)  /* EUC-KR character set. */
#define BTA_OP_CHAR_GB2312          (4<<3)  /* GB2312 character set. */
#define BTA_OP_CHAR_ISO_2022_JP     (5<<3)  /* ISO-2022-JP character set. */
#define BTA_OP_CHAR_ISO_8859_1      (6<<3)  /* ISO-8859-1 character set. */
#define BTA_OP_CHAR_ISO_8859_2      (7<<3)  /* ISO-8859-2 character set. */
#define BTA_OP_CHAR_ISO_8859_3      (8<<3)  /* ISO-8859-3 character set. */
#define BTA_OP_CHAR_ISO_8859_4      (9<<3)  /* ISO-8859-4 character set. */
#define BTA_OP_CHAR_ISO_8859_5      (10<<3) /* ISO-8859-5 character set. */
#define BTA_OP_CHAR_ISO_8859_6      (11<<3) /* ISO-8859-6 character set. */
#define BTA_OP_CHAR_ISO_8859_7      (12<<3) /* ISO-8859-7 character set. */
#define BTA_OP_CHAR_ISO_8859_8      (13<<3) /* ISO-8859-8 character set. */
#define BTA_OP_CHAR_KOI8_R          (14<<3) /* KOI8-R character set. */
#define BTA_OP_CHAR_SHIFT_JIS       (15<<3) /* Shift_JIS character set. */
#define BTA_OP_CHAR_UTF_8           (16<<3) /* UTF-8 character set. */

/* Address Type Parameter */
#define BTA_OP_ADR_DOM              (1<<8)  /* Domestic address. */
#define BTA_OP_ADR_INTL             (1<<9)  /* International address. */
#define BTA_OP_ADR_POSTAL           (1<<10) /* Postal address. */
#define BTA_OP_ADR_PARCEL           (1<<11) /* Parcel post address. */
#define BTA_OP_ADR_HOME             (1<<12) /* Home address. */
#define BTA_OP_ADR_WORK             (1<<13) /* Work address. */

/* EMAIL Type Parameter */
#define BTA_OP_EMAIL_PREF           (1<<8)  /* Preferred email. */
#define BTA_OP_EMAIL_INTERNET       (1<<9)  /* Internet email. */
#define BTA_OP_EMAIL_X400           (1<<10) /* x400 emaill */

/* Telephone Number Type Parameter */
#define BTA_OP_TEL_PREF             (1<<8)  /* Preferred number. */
#define BTA_OP_TEL_WORK             (1<<9)  /* Work number. */
#define BTA_OP_TEL_HOME             (1<<10) /* Home number. */
#define BTA_OP_TEL_VOICE            (1<<11) /* Voice number. */
#define BTA_OP_TEL_FAX              (1<<12) /* Fax number. */
#define BTA_OP_TEL_MSG              (1<<13) /* Message number. */
#define BTA_OP_TEL_CELL             (1<<14) /* Cell phone number. */
#define BTA_OP_TEL_PAGER            (1<<15) /* Pager number. */

/* Photo Parameter */
#define BTA_OP_PHOTO_VALUE_URI      (1<<8)  /* URI value */
#define BTA_OP_PHOTO_VALUE_URL      (1<<9)  /* URL value */
#define BTA_OP_PHOTO_TYPE_JPEG      (1<<10) /* JPEG photo */
#define BTA_OP_PHOTO_TYPE_GIF       (1<<11) /* GIF photo */

/* Sound Parameter */
#define BTA_OP_SOUND_VALUE_URI      (1<<8)  /* URI value */
#define BTA_OP_SOUND_VALUE_URL      (1<<9)  /* URL value */
#define BTA_OP_SOUND_TYPE_BASIC     (1<<10) /* BASIC sound */
#define BTA_OP_SOUND_TYPE_WAVE      (1<<11) /* WAVE sound */

/* vCard filter mask */
#define BTA_OP_FILTER_VERSION  (1<<0)  /* vCard Version */
#define BTA_OP_FILTER_FN       (1<<1)  /* Formatted Name */
#define BTA_OP_FILTER_N        (1<<2)  /* Structured Presentation of Name */
#define BTA_OP_FILTER_PHOTO    (1<<3)  /* Associated Image or Photo */
#define BTA_OP_FILTER_BDAY     (1<<4)  /* Birthday */
#define BTA_OP_FILTER_ADR      (1<<5)  /* Delivery Address */
#define BTA_OP_FILTER_LABEL    (1<<6)  /* Delivery */
#define BTA_OP_FILTER_TEL      (1<<7)  /* Telephone Number */
#define BTA_OP_FILTER_EMAIL    (1<<8)  /* Electronic Mail Address */
#define BTA_OP_FILTER_MAILER   (1<<9)  /* Electronic Mail */
#define BTA_OP_FILTER_TZ       (1<<10)  /* Time Zone */
#define BTA_OP_FILTER_GEO      (1<<11) /* Geographic Position */
#define BTA_OP_FILTER_TITLE    (1<<12) /* Job */
#define BTA_OP_FILTER_ROLE     (1<<13) /* Role within the Organization */
#define BTA_OP_FILTER_LOGO     (1<<14) /* Organization Logo */
#define BTA_OP_FILTER_AGENT    (1<<15) /* vCard of Person Representing */
#define BTA_OP_FILTER_ORG      (1<<16) /* Name of Organization */
#define BTA_OP_FILTER_NOTE     (1<<17) /* Comments */
#define BTA_OP_FILTER_REV      (1<<18) /* Revision */
#define BTA_OP_FILTER_SOUND    (1<<19) /* Pronunciation of Name */
#define BTA_OP_FILTER_URL      (1<<20) /* Uniform Resource Locator */
#define BTA_OP_FILTER_UID      (1<<21) /* Unique ID */
#define BTA_OP_FILTER_KEY      (1<<22) /* Public Encryption Key */
#define BTA_OP_FILTER_NICKNAME (1<<23) /* Nickname */
#define BTA_OP_FILTER_CATEGORIES (1<<24) /* Categories */
#define BTA_OP_FILTER_PROID    (1<<25) /* Product ID */
#define BTA_OP_FILTER_CLASS    (1<<26) /* Class Information */
#define BTA_OP_FILTER_SORT_STRING (1<<27) /* String used for sorting operations */
#define BTA_OP_FILTER_TIME_STAMP (1<<28) /* Time Stamp */
#define BTA_OP_FILTER_ALL      (0)

/* This structure describes an object property, or individual item, inside an object. */
typedef struct
{
    UINT8       *p_data;            /* Pointer to property data. */
    UINT32      parameters;         /* Property parameters. */
    UINT16      name;               /* Property name. */
    UINT16      len;                /* Length of data. */
    UINT8       *p_param;           /* Pointer to the Parameters */
    UINT16      param_len;          /* Param Len */
} tBTA_OP_PROP;


/* Access response types */
#define BTA_OP_ACCESS_ALLOW     0   /* Allow the requested operation */
#define BTA_OP_ACCESS_FORBID    1   /* Disallow the requested operation */
#define BTA_OP_ACCESS_NONSUP    2   /* Requested operation is not supported */

typedef UINT8 tBTA_OP_ACCESS;

/* Access event operation types */
#define BTA_OP_OPER_PUSH        1
#define BTA_OP_OPER_PULL        2

typedef UINT8 tBTA_OP_OPER;


/* Client callback function event */
#define BTA_OPC_ENABLE_EVT          0   /* Object push client is enabled. */
#define BTA_OPC_OPEN_EVT            1   /* Connection to peer is open. */
#define BTA_OPC_PROGRESS_EVT        2   /* push/pull in progres */ 
#define BTA_OPC_OBJECT_EVT          3   /* Object Pulled */
#define BTA_OPC_OBJECT_PSHD_EVT     4   /* Object pushed */
#define BTA_OPC_CLOSE_EVT           5   /* Connection to peer closed. */

typedef UINT8 tBTA_OPC_EVT;

/* Client callback function result */
#define BTA_OPC_OK             0   /* Object push succeeded. */
#define BTA_OPC_FAIL           1   /* Object push failed. */
#define BTA_OPC_NOT_FOUND      2   /* Object not found. */
#define BTA_OPC_NO_PERMISSION  3   /* Operation not authorized. */
#define BTA_OPC_SRV_UNAVAIL    4   /* Service unavaliable */
#define BTA_OPC_ON_BT          5   /* only used for BTA_OPC_MOVE_CH_EVT */
#define BTA_OPC_RSP_FORBIDDEN  6   /* Operation forbidden */
#define BTA_OPC_RSP_NOT_ACCEPTABLE  7  /* Operation not acceptable */ 

typedef UINT8 tBTA_OPC_STATUS;

/* Structure associated with BTA_OPC_OBJECT_EVT */
typedef struct
{
    char                *p_name;        /* Object name. */
    tBTA_OPC_STATUS    status;
} tBTA_OPC_OBJECT;

typedef struct
{
    UINT32          obj_size;   /* Total size of object (BTA_FS_LEN_UNKNOWN if unknown) */
    UINT16          bytes;      /* Number of bytes read or written since last progress event */
    tBTA_OP_OPER    operation;  /* Is progress for Push or Pull */
} tBTA_OPC_PROGRESS;

/* Union of all client callback structures */
typedef union
{
    tBTA_OPC_OBJECT   object;
    tBTA_OPC_PROGRESS prog;
    tBTA_OPC_STATUS   status;
} tBTA_OPC;

/* Client callback function */
typedef void (tBTA_OPC_CBACK)(tBTA_OPC_EVT event, tBTA_OPC *p_data);

/* Server callback function event */
#define BTA_OPS_ENABLE_EVT          0   /* Object push server is enabled. */
#define BTA_OPS_OPEN_EVT            1   /* Connection to peer is open. */
#define BTA_OPS_PROGRESS_EVT        2   /* Object being sent or received. */
#define BTA_OPS_OBJECT_EVT          3   /* Object has been received. */
#define BTA_OPS_CLOSE_EVT           4   /* Connection to peer closed. */
#define BTA_OPS_ACCESS_EVT          5   /* Request for access to push or pull object */

typedef UINT8 tBTA_OPS_EVT;

typedef UINT8 tBTA_OPS_STATUS;

/* Structure associated with BTA_OPS_OBJECT_EVT */
typedef struct
{
    char                *p_name;        /* Object name. */
    tBTA_OP_FMT         format;         /* Object format. */
} tBTA_OPS_OBJECT;

typedef struct
{
    UINT32              obj_size;       /* Total size of object (BTA_FS_LEN_UNKNOWN if unknown) */
    UINT16              bytes;          /* Number of bytes read or written since last progress event */
    tBTA_OP_OPER        operation;      /* Is progress for Push or Pull */
} tBTA_OPS_PROGRESS;

typedef struct
{
    char                *p_name;        /* Object name */
    char                *p_type;        /* Object type (NULL if not specified) */
    UINT32              size;           /* Object size */
    tBTM_BD_NAME        dev_name;       /* Name of device, "" if unknown */
    BD_ADDR             bd_addr;        /* Address of device */
    tBTA_OP_OPER        oper;           /* Operation (push or pull) */
    tBTA_OP_FMT         format;         /* Object format */
} tBTA_OPS_ACCESS;

/* Union of all server callback structures */
typedef union
{
    tBTA_OPS_STATUS     status;
    tBTA_OPS_OBJECT     object;
    tBTA_OPS_PROGRESS   prog;
    tBTA_OPS_ACCESS     access;
    BD_ADDR             bd_addr;
} tBTA_OPS;

/* Server callback function */
typedef void (tBTA_OPS_CBACK)(tBTA_OPS_EVT event, tBTA_OPS *p_data);


/*****************************************************************************
**  External Function Declarations
*****************************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif

/*******************************************************************************
**
** Function         BTA_OpcEnable
**
** Description      Enable the object push client.  This function must be
**                  called before any other functions in the OP API are called.
**                  When the enable operation is complete the callback function
**                  will be called with a BTA_OPC_ENABLE_EVT.
**                  
**                  If single_op is FALSE, the connection stays open after
**                  the operation finishes (until BTA_OpcClose is called).
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void BTA_OpcEnable(tBTA_SEC sec_mask, tBTA_OPC_CBACK *p_cback,
                                  BOOLEAN single_op, BOOLEAN srm, UINT8 app_id);

/*******************************************************************************
**
** Function         BTA_OpcDisable
**
** Description      Disable the object push client.  If the client is currently
**                  connected to a peer device the connection will be closed.
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void BTA_OpcDisable(void);

/*******************************************************************************
**
** Function         BTA_OpcPush
**
** Description      Push an object to a peer device.  p_name must point to 
**                  a fully qualified path and file name.
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void BTA_OpcPush(BD_ADDR bd_addr, tBTA_OP_FMT format, char *p_name);

/*******************************************************************************
**
** Function         BTA_OpcPullCard
**
** Description      Pull default card from peer. p_path must point to a fully
**                  qualified path specifying where to store the pulled card.
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void BTA_OpcPullCard(BD_ADDR bd_addr, char *p_path);


/*******************************************************************************
**
** Function         BTA_OpcExchCard
**
** Description      Exchange business cards with a peer device. p_send points to 
**                  a fully qualified path and file name of vcard to push.
**                  p_recv_path points to a fully qualified path specifying
**                  where to store the pulled card.
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void BTA_OpcExchCard(BD_ADDR bd_addr, char *p_send,
                                    char *p_recv_path);


/*******************************************************************************
**
** Function         BTA_OpcClose
**
** Description      Close the current connection.  This function is called if
**                  the phone wishes to close the connection before the object
**                  push is completed.  In a typical connection this function
**                  does not need to be called; the connection will be closed
**                  automatically when the object push is complete.
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void BTA_OpcClose(void);

/*******************************************************************************
**
** Function         BTA_OpsEnable
**
** Description      Enable the object push server.  This function must be
**                  called before any other functions in the OPS API are called.
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void BTA_OpsEnable(tBTA_SEC sec_mask, tBTA_OP_FMT_MASK formats,
                                  char *p_service_name, tBTA_OPS_CBACK *p_cback,
                                  BOOLEAN srm, UINT8 app_id);

/*******************************************************************************
**
** Function         BTA_OpsDisable
**
** Description      Disable the object push server.  If the server is currently
**                  connected to a peer device the connection will be closed.
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void BTA_OpsDisable(void);

/*******************************************************************************
**
** Function         BTA_OpsClose
**
** Description      Close the current connection.  This function is called if
**                  the phone wishes to close the connection before the object
**                  push is completed.
**                  
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void BTA_OpsClose(void);

/*******************************************************************************
**
** Function         BTA_OpsAccessRsp
**
** Description      Sends a reply to an access request event (BTA_OPS_ACCESS_EVT).
**                  This call MUST be made whenever the event occurs.
**
** Returns          void
**
*******************************************************************************/
BTA_API extern void BTA_OpsAccessRsp(tBTA_OP_OPER oper, tBTA_OP_ACCESS access,
                                     char *p_name);

/*******************************************************************************
**
** Function         BTA_OpBuildCard
**
** Description      Build a vCard object. The input to this function is
**                  requested format(2.1/3.0), an array of vCard properties
**                  and a pointer to memory to store the card.
**                  The output is a formatted vCard.
**                  
**
** Returns          BTA_OP_OK if operation successful.
**                  BTA_OP_FAIL if invalid property data.
**                  BTA_OP_MEM if not enough memory to complete build.
**
*******************************************************************************/
BTA_API extern tBTA_OP_STATUS BTA_OpBuildCard(UINT8 *p_card, UINT16 *p_len,
                                              tBTA_OP_FMT fmt,
                                              tBTA_OP_PROP *p_prop,
                                              UINT8 num_prop);

/*******************************************************************************
**
** Function         BTA_OpBuildNote
**
** Description      Build a vNote object.  The input to this function is an
**                  array of vNote properties and a pointer to memory to store
**                  the card.  The output is a formatted vNote.
**                  
**
** Returns          BTA_OP_OK if operation successful.
**                  BTA_OP_FAIL if invalid property data.
**                  BTA_OP_MEM if not enough memory to complete build.
**
*******************************************************************************/
BTA_API extern tBTA_OP_STATUS BTA_OpBuildNote(UINT8 *p_note, UINT16 *p_len,
                                              tBTA_OP_PROP *p_prop,
                                              UINT8 num_prop);

/*******************************************************************************
**
** Function         BTA_OpBuildCal
**
** Description      Build a vCal 1.0 object.  The input to this function is an
**                  array of vCaalproperties and a pointer to memory to store
**                  the card.  The output is a formatted vCal.
**                  
**
** Returns          BTA_OP_OK if operation successful.
**                  BTA_OP_FAIL if invalid property data.
**                  BTA_OP_MEM if not enough memory to complete build.
**
*******************************************************************************/
BTA_API extern tBTA_OP_STATUS BTA_OpBuildCal(UINT8 *p_cal, UINT16 *p_len,
                                             tBTA_OP_PROP *p_prop,
                                             UINT8 num_prop,
                                             tBTA_OP_VCAL vcal_type);

/*******************************************************************************
**
** Function         BTA_OpParseCard
**
** Description      Parse a vCard 2.1 object.  The input to this function is
**                  a pointer to vCard data.  The output is an array of parsed
**                  vCard properties.
**                  
**
** Returns          BTA_OP_OK if operation successful.
**                  BTA_OP_FAIL if invalid property data.
**                  BTA_OP_MEM if not enough memory to complete parsing.
**
*******************************************************************************/
BTA_API extern tBTA_OP_STATUS BTA_OpParseCard(tBTA_OP_PROP *p_prop,
                                              UINT8 *p_num_prop, UINT8 *p_card,
                                              UINT16 len);

/*******************************************************************************
**
** Function         BTA_OpGetCardProperty
**
** Description      Get Card property value by name.  The input to this function is
**                  property name.  The output is property value and len
**                  
**
** Returns          BTA_OP_OK if operation successful.
**                  BTA_OP_FAIL if invalid property data.
**
*******************************************************************************/
BTA_API extern tBTA_OP_STATUS BTA_OpGetCardProperty(UINT8 *p_value, UINT16 *p_len, tBTA_OP_PROP *p_prop, 
                                     UINT8 num_prop, UINT8 *p_name);

/*******************************************************************************
**
** Function         BTA_OpParseNote
**
** Description      Parse a vNote object.  The input to this function is a
**                  pointer to vNote data.  The output is an array of parsed
**                  vNote properties.
**                  
**
** Returns          BTA_OP_OK if operation successful.
**                  BTA_OP_FAIL if invalid property data.
**                  BTA_OP_MEM if not enough memory to complete parsing.
**
*******************************************************************************/
BTA_API extern tBTA_OP_STATUS BTA_OpParseNote(tBTA_OP_PROP *p_prop,
                                              UINT8 *p_num_prop,
                                              UINT8 *p_note, UINT16 len);

/*******************************************************************************
**
** Function         BTA_OpParseCal
**
** Description      Parse a vCal object.  The input to this function is a
**                  pointer to vCal data.  The output is an array of parsed
**                  vCal properties.
**                  
**
** Returns          BTA_OP_OK if operation successful.
**                  BTA_OP_FAIL if invalid property data.
**                  BTA_OP_MEM if not enough memory to complete parsing.
**
*******************************************************************************/
BTA_API extern tBTA_OP_STATUS BTA_OpParseCal(tBTA_OP_PROP *p_prop,
                                             UINT8 *p_num_prop, UINT8 *p_cal,
                                             UINT16 len, tBTA_OP_VCAL *p_vcal_type);

/*******************************************************************************
**
** Function         BTA_OpSetCardPropFilterMask
**
** Description      Set Property Filter Mask
**                  
**
** Returns          
**
*******************************************************************************/
BTA_API extern void BTA_OpSetCardPropFilterMask(UINT32 mask);

#ifdef __cplusplus
}
#endif

#endif /* BTA_OP_API_H */