diff options
author | Srikanth Uppala <suppala@broadcom.com> | 2012-06-17 21:44:48 -0700 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-07-14 11:19:23 -0700 |
commit | 1144d2b375fc67c9b48298e0ffd774d969cfd2cc (patch) | |
tree | 4d36d4f8be4942d769300c242caeb9b9096c6a35 /stack/include | |
parent | fed66f7b66d29da466e2e67befe3238e7ed8fc6a (diff) | |
download | external_bluetooth_bluedroid-1144d2b375fc67c9b48298e0ffd774d969cfd2cc.zip external_bluetooth_bluedroid-1144d2b375fc67c9b48298e0ffd774d969cfd2cc.tar.gz external_bluetooth_bluedroid-1144d2b375fc67c9b48298e0ffd774d969cfd2cc.tar.bz2 |
resubmit code-cleanup changes lost in gerrit merge
Change-Id: Iebc520d9b10ef220a83a16ff55efa46b4c5a0d27
Diffstat (limited to 'stack/include')
-rw-r--r-- | stack/include/a2d_m12.h | 145 | ||||
-rw-r--r-- | stack/include/a2d_m24.h | 122 | ||||
-rw-r--r-- | stack/include/avrc_defs.h | 5 | ||||
-rw-r--r-- | stack/include/dun_api.h | 201 | ||||
-rw-r--r-- | stack/include/goep_util.h | 265 | ||||
-rw-r--r-- | stack/include/hidd_api.h | 241 | ||||
-rw-r--r-- | stack/include/xml_bld_api.h | 113 | ||||
-rw-r--r-- | stack/include/xml_erp_api.h | 145 | ||||
-rw-r--r-- | stack/include/xml_flp_api.h | 162 | ||||
-rw-r--r-- | stack/include/xml_mlp_api.h | 169 | ||||
-rw-r--r-- | stack/include/xml_pars_api.h | 358 | ||||
-rw-r--r-- | stack/include/xml_vlist_api.h | 136 |
12 files changed, 0 insertions, 2062 deletions
diff --git a/stack/include/a2d_m12.h b/stack/include/a2d_m12.h deleted file mode 100644 index 2cc5ef9..0000000 --- a/stack/include/a2d_m12.h +++ /dev/null @@ -1,145 +0,0 @@ -/***************************************************************************** -** -** Name: a2d_m12.h -** -** Description:Interface to MPEG-1, 2 Audio -** -** Copyright (c) 2000-2004, WIDCOMM Inc., All Rights Reserved. -** WIDCOMM Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef A2D_M12_H -#define A2D_M12_H - -/***************************************************************************** -** Constants -*****************************************************************************/ -/* the length of the MPEG_1, 2 Audio Media Payload header. */ -#define A2D_M12_MPL_HDR_LEN 4 - -/* the LOSC of MPEG_1, 2 Audio media codec capabilitiy */ -#define A2D_M12_INFO_LEN 6 - -/* for Codec Specific Information Element */ -#define A2D_M12_IE_LAYER_MSK 0xE0 /* b7-b5 layer */ -#define A2D_M12_IE_LAYER1 0x80 /* b7: layer1 (mp1) */ -#define A2D_M12_IE_LAYER2 0x40 /* b6: layer2 (mp2) */ -#define A2D_M12_IE_LAYER3 0x20 /* b5: layer3 (mp3) */ - -#define A2D_M12_IE_CRC_MSK 0x10 /* b4: CRC */ - -#define A2D_M12_IE_CH_MD_MSK 0x0F /* b3-b0 channel mode */ -#define A2D_M12_IE_CH_MD_MONO 0x08 /* b3: mono */ -#define A2D_M12_IE_CH_MD_DUAL 0x04 /* b2: dual */ -#define A2D_M12_IE_CH_MD_STEREO 0x02 /* b1: stereo */ -#define A2D_M12_IE_CH_MD_JOINT 0x01 /* b0: joint stereo */ - -#define A2D_M12_IE_MPF_MSK 0x40 /* b6: MPF */ - -#define A2D_M12_IE_SAMP_FREQ_MSK 0x3F /* b5-b0 sampling frequency */ -#define A2D_M12_IE_SAMP_FREQ_16 0x20 /* b5:16 kHz */ -#define A2D_M12_IE_SAMP_FREQ_22 0x10 /* b4:22.05kHz */ -#define A2D_M12_IE_SAMP_FREQ_24 0x08 /* b3:24 kHz */ -#define A2D_M12_IE_SAMP_FREQ_32 0x04 /* b2:32 kHz */ -#define A2D_M12_IE_SAMP_FREQ_44 0x02 /* b1:44.1kHz */ -#define A2D_M12_IE_SAMP_FREQ_48 0x01 /* b0:48 kHz */ - -#define A2D_M12_IE_VBR_MSK 0x80 /* b7: VBR */ - -#define A2D_M12_IE_BITRATE_MSK 0x7FFF /* b6-b0 of octect 2, all of octect3*/ -#define A2D_M12_IE_BITRATE_0 0x0001 /* 0000 */ -#define A2D_M12_IE_BITRATE_1 0x0002 /* 0001 */ -#define A2D_M12_IE_BITRATE_2 0x0004 /* 0010 */ -#define A2D_M12_IE_BITRATE_3 0x0008 /* 0011 */ -#define A2D_M12_IE_BITRATE_4 0x0010 /* 0100 */ -#define A2D_M12_IE_BITRATE_5 0x0020 /* 0101 */ -#define A2D_M12_IE_BITRATE_6 0x0040 /* 0110 */ -#define A2D_M12_IE_BITRATE_7 0x0080 /* 0111 */ -#define A2D_M12_IE_BITRATE_8 0x0100 /* 1000 */ -#define A2D_M12_IE_BITRATE_9 0x0200 /* 1001 */ -#define A2D_M12_IE_BITRATE_10 0x0400 /* 1010 */ -#define A2D_M12_IE_BITRATE_11 0x0800 /* 1011 */ -#define A2D_M12_IE_BITRATE_12 0x1000 /* 1100 */ -#define A2D_M12_IE_BITRATE_13 0x2000 /* 1101 */ -#define A2D_M12_IE_BITRATE_14 0x4000 /* 1110 */ - -#define A2D_BLD_M12_PML_HDR(p_dst,frag_offset) {UINT16_TO_BE_STREAM(p_dst, 0); \ - UINT16_TO_BE_STREAM(p_dst, frag_offset); } - -#define A2D_PARS_M12_PML_HDR(p_src,frag_offset) {BE_STREAM_TO_UINT16(frag_offset, p_src); \ - BE_STREAM_TO_UINT16(frag_offset, p_src); } - - -/***************************************************************************** -** Type Definitions -*****************************************************************************/ - -/* data type for the MPEG-1, 2 Audio Codec Information Element*/ -typedef struct -{ - UINT8 layer; /* layers */ - BOOLEAN crc; /* Support of CRC protection or not */ - UINT8 ch_mode; /* Channel mode */ - UINT8 mpf; /* 1, if MPF-2 is supported. 0, otherwise */ - UINT8 samp_freq; /* Sampling frequency */ - BOOLEAN vbr; /* Variable Bit Rate */ - UINT16 bitrate; /* Bit rate index */ -} tA2D_M12_CIE; - -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif -/****************************************************************************** -** -** Function A2D_BldM12Info -** -** Description This function is called by an application to build -** the MPEG-1, 2 Audio Media Codec Capabilities byte sequence -** beginning from the LOSC octet. -** Input Parameters: -** media_type: Indicates Audio, or Multimedia. -** -** p_ie: The MPEG-1, 2 Audio Codec Information Element -** information. -** -** Output Parameters: -** p_result: the resulting codec info byte sequence. -** -** Returns A2D_SUCCESS if function execution succeeded. -** Error status code, otherwise. -******************************************************************************/ -A2D_API extern tA2D_STATUS A2D_BldM12Info(UINT8 media_type, tA2D_M12_CIE *p_ie, - UINT8 *p_result); - -/****************************************************************************** -** -** Function A2D_ParsM12Info -** -** Description This function is called by an application to parse -** the MPEG-1, 2 Audio Media Codec Capabilities byte sequence -** beginning from the LOSC octet. -** Input Parameters: -** p_info: the byte sequence to parse. -** -** for_caps: TRUE, if the byte sequence is for get capabilities -** response. -** -** Output Parameters: -** p_ie: The MPEG-1, 2 Audio Codec Information Element -** information. -** -** Returns A2D_SUCCESS if function execution succeeded. -** Error status code, otherwise. -******************************************************************************/ -A2D_API extern tA2D_STATUS A2D_ParsM12Info(tA2D_M12_CIE *p_ie, UINT8 *p_info, - BOOLEAN for_caps); - -#ifdef __cplusplus -} -#endif - -#endif /* A2D_M12_H */ diff --git a/stack/include/a2d_m24.h b/stack/include/a2d_m24.h deleted file mode 100644 index 0417a57..0000000 --- a/stack/include/a2d_m24.h +++ /dev/null @@ -1,122 +0,0 @@ -/***************************************************************************** -** -** Name: a2d_m24.h -** -** Description:Interface to MPEG-2, 4 Aac -** -** Copyright (c) 2000-2004, WIDCOMM Inc., All Rights Reserved. -** WIDCOMM Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef A2D_M24_H -#define A2D_M24_H - -/***************************************************************************** -** Constants -*****************************************************************************/ - -/* the LOSC of MPEG_2, 4 AAC media codec capabilitiy */ -#define A2D_M24_INFO_LEN 8 - -/* for Codec Specific Information Element */ -#define A2D_M24_IE_OBJ_MSK 0xF0 /* b7-b4 object type. b3-b0 is RFA,not used */ -#define A2D_M24_IE_OBJ_2LC 0x80 /* b7: MPEG-2 AAC LC */ -#define A2D_M24_IE_OBJ_4LC 0x40 /* b6: MPEG-4 AAC LC */ -#define A2D_M24_IE_OBJ_4LTP 0x20 /* b5: MPEG-4 AAC LTP */ -#define A2D_M24_IE_OBJ_4S 0x10 /* b4: MPEG-4 AAC scalable */ - -#define A2D_M24_IE_SAMP_FREQ_MSK 0xFFF0 /* sampling frequency */ -#define A2D_M24_IE_SAMP_FREQ_8 0x8000 /* b7:8 kHz */ -#define A2D_M24_IE_SAMP_FREQ_11 0x4000 /* b6:11 kHz */ -#define A2D_M24_IE_SAMP_FREQ_12 0x2000 /* b5:12 kHz */ -#define A2D_M24_IE_SAMP_FREQ_16 0x1000 /* b4:16 kHz */ -#define A2D_M24_IE_SAMP_FREQ_22 0x0800 /* b3:22.05kHz */ -#define A2D_M24_IE_SAMP_FREQ_24 0x0400 /* b2:24 kHz */ -#define A2D_M24_IE_SAMP_FREQ_32 0x0200 /* b1:32 kHz */ -#define A2D_M24_IE_SAMP_FREQ_44 0x0100 /* b0:44.1kHz */ -#define A2D_M24_IE_SAMP_FREQ_48 0x0080 /* b7:48 kHz */ -#define A2D_M24_IE_SAMP_FREQ_64 0x0040 /* b6:64 kHz */ -#define A2D_M24_IE_SAMP_FREQ_88 0x0020 /* b5:88 kHz */ -#define A2D_M24_IE_SAMP_FREQ_96 0x0010 /* b4:96 kHz */ - -#define A2D_M24_IE_CHNL_MSK 0x0C /* b3-b2 channels */ -#define A2D_M24_IE_CHNL_1 0x08 /* b3: 1 channel */ -#define A2D_M24_IE_CHNL_2 0x04 /* b2: 2 channels */ - -#define A2D_M24_IE_VBR_MSK 0x80 /* b7: VBR */ - -#define A2D_M24_IE_BITRATE3_MSK 0x7F0000 /* octect3*/ -#define A2D_M24_IE_BITRATE45_MSK 0x00FFFF /* octect4, 5*/ -#define A2D_M24_IE_BITRATE_MSK 0x7FFFFF /* b7-b0 of octect 3, all of octect4, 5*/ - - -/***************************************************************************** -** Type Definitions -*****************************************************************************/ - -/* data type for the MPEG-2, 4 AAC Codec Information Element*/ -typedef struct -{ - UINT8 obj_type; /* Object type */ - UINT16 samp_freq; /* Sampling frequency */ - UINT8 chnl; /* Channel mode */ - BOOLEAN vbr; /* Variable Bit Rate */ - UINT32 bitrate; /* Bit rate index */ -} tA2D_M24_CIE; - -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif -/****************************************************************************** -** -** Function A2D_BldM24Info -** -** Description This function is called by an application to build -** the MPEG-2, 4 AAC Media Codec Capabilities byte sequence -** beginning from the LOSC octet. -** Input Parameters: -** media_type: Indicates Audio, or Multimedia. -** -** p_ie: MPEG-2, 4 AAC Codec Information Element information. -** -** Output Parameters: -** p_result: the resulting codec info byte sequence. -** -** Returns A2D_SUCCESS if function execution succeeded. -** Error status code, otherwise. -******************************************************************************/ -A2D_API extern tA2D_STATUS A2D_BldM24Info(UINT8 media_type, tA2D_M24_CIE *p_ie, - UINT8 *p_result); - -/****************************************************************************** -** -** Function A2D_ParsM24Info -** -** Description This function is called by an application to parse -** the MPEG-2, 4 AAC Media Codec Capabilities byte sequence -** beginning from the LOSC octet. -** Input Parameters: -** p_info: the byte sequence to parse. -** -** for_caps: TRUE, if the byte sequence is for get -** capabilities response. -** -** Output Parameters: -** p_ie: MPEG-2, 4 AAC Codec Information Element information. -** -** Returns A2D_SUCCESS if function execution succeeded. -** Error status code, otherwise. -******************************************************************************/ -A2D_API extern tA2D_STATUS A2D_ParsM24Info(tA2D_M24_CIE *p_ie, UINT8 *p_info, - BOOLEAN for_caps); - -#ifdef __cplusplus -} -#endif - -#endif /* A2D_M24_H */ - diff --git a/stack/include/avrc_defs.h b/stack/include/avrc_defs.h index 188f5a4..b902bff 100644 --- a/stack/include/avrc_defs.h +++ b/stack/include/avrc_defs.h @@ -825,13 +825,8 @@ typedef union /* macros */ #define AVRC_IS_VALID_CAP_ID(a) (((a == AVRC_CAP_COMPANY_ID) || (a == AVRC_CAP_EVENTS_SUPPORTED)) ? TRUE : FALSE) -#if (AVRC_ADV_CTRL_INCLUDED == TRUE) -#define AVRC_IS_VALID_EVENT_ID(a) (((a >= AVRC_EVT_PLAY_STATUS_CHANGE) && \ - (a <= AVRC_EVT_VOLUME_CHANGE)) ? TRUE : FALSE) -#else /* AVRCP 1.3 */ #define AVRC_IS_VALID_EVENT_ID(a) (((a >= AVRC_EVT_PLAY_STATUS_CHANGE) && \ (a <= AVRC_EVT_APP_SETTING_CHANGE)) ? TRUE : FALSE) -#endif #define AVRC_IS_VALID_ATTRIBUTE(a) (((((a > 0) && a <= AVRC_PLAYER_SETTING_SCAN)) || \ ((a >= AVRC_PLAYER_SETTING_LOW_MENU_EXT) && \ diff --git a/stack/include/dun_api.h b/stack/include/dun_api.h deleted file mode 100644 index 2b3679f..0000000 --- a/stack/include/dun_api.h +++ /dev/null @@ -1,201 +0,0 @@ -/************************************************************************************ -** -** Name: dun_api.h -** -** Description: this file contains the DUN API declaration -** -** -** Copyright (c) 1999-2004, WIDCOMM Inc., All Rights Reserved. -** WIDCOMM Bluetooth Core. Proprietary and confidential. -*************************************************************************************/ -#ifndef DUN_API_H -#define DUN_API_H - -#include "bt_target.h" -#include "btm_api.h" -#include "sdp_api.h" -#include "port_api.h" - -/***************************************************************************** -** Constants -*****************************************************************************/ - -/* API function return values */ -#define DUN_SUCCESS 0 -#define DUN_FAIL 1 - -/* Values for the options parameter. It is an integer bit mask that -** contains information used in the DUN or Fax SDP record. These values -** can be or'ed together to indicate more than one option. Fax class options -** are not allowed for the DUN profile. -*/ -#define DUN_OPTIONS_AUDIO (1<<0) /* Audio feedback supported */ -#define DUN_OPTIONS_CLASS1 (1<<1) /* Fax class 1 supported */ -#define DUN_OPTIONS_CLASS20 (1<<2) /* Fax class 2.0 supported */ -#define DUN_OPTIONS_CLASS2 (1<<3) /* Fax class 2 supported */ - -/***************************************************************************** -** Type definitions -*****************************************************************************/ - -/* This callback function returns service discovery information to the -** application after the DUN_FindService() API function is called. The -** implementation of this callback function must copy the p_name parameter -** passed to it as it is not guaranteed to remain after the callback -** function exits. -*/ -typedef void (tDUN_FIND_CBACK)(BOOLEAN found, UINT8 scn, char* p_name, - UINT16 name_len, UINT16 options); - - -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - -/****************************************************************************** -** -** Function DUN_Listen -** -** Description This function opens a DUN or Fax connection in server mode. -** It configures the security settings for the connection, -** opens an RFCOMM connection in server mode, and sets the -** class of device as required by the profile. It returns -** the handle for the RFCOMM connection. -** -** Returns DUN_SUCCESS if function execution succeeded, -** DUN_FAIL if function execution failed. -** -******************************************************************************/ -DUN_API extern UINT8 DUN_Listen(UINT16 service_uuid, char *p_service_name, - UINT8 scn, UINT16 mtu, UINT8 security_mask, - UINT16 *p_handle, tPORT_CALLBACK *p_cback); - -/****************************************************************************** -** -** Function DUN_Connect -** -** Description This function opens a DUN or Fax client connection. -** It configures the security settings for the connection -** and opens an RFCOMM connection in server mode. -** It returns the handle for the RFCOMM connection. -** -** Returns DUN_SUCCESS if function execution succeeded, -** DUN_FAIL if function execution failed. -** -******************************************************************************/ -DUN_API extern UINT8 DUN_Connect(UINT16 service_uuid, BD_ADDR bd_addr, UINT8 scn, - UINT16 mtu, UINT8 security_mask, UINT16 *p_handle, - tPORT_CALLBACK *p_cback); - -/****************************************************************************** -** -** Function DUN_Close -** -** Description This function closes a DUN or Fax client connection -** previously opened with DUN_Connect(). -** -** Returns DUN_SUCCESS if function execution succeeded, -** DUN_FAIL if function execution failed. -** -******************************************************************************/ -DUN_API extern UINT8 DUN_Close(UINT16 handle); - -/****************************************************************************** -** -** Function DUN_Shutdown -** -** Description This function closes a DUN or Fax server connection -** previously opened with DUN_Listen(). It is called if -** the application wishes to close the DUN or Fax server -** connection at any time. -** -** Returns DUN_SUCCESS if function execution succeeded, -** DUN_FAIL if function execution failed. -** -******************************************************************************/ -DUN_API extern UINT8 DUN_Shutdown(UINT16 handle); - -/****************************************************************************** -** -** Function DUN_AddRecord -** -** Description This function is called by a server application to add -** DUN or Fax information to an SDP record. Prior to -** calling this function the application must call -** SDP_CreateRecord() to create an SDP record. -** -** Returns DUN_SUCCESS if function execution succeeded, -** DUN_FAIL if function execution failed. -** -******************************************************************************/ -DUN_API extern UINT8 DUN_AddRecord(UINT16 service_uuid, char *p_service_name, - UINT8 scn, UINT16 options, UINT32 sdp_handle); - -/****************************************************************************** -** -** Function DUN_FindService -** -** Description This function is called by a client application to -** perform service discovery and retrieve DUN or Fax SDP -** record information from a server. Information is -** returned for the first service record found on the -** server that matches the service UUID. The callback -** function will be executed when service discovery is -** complete. There can only be one outstanding call to -** DUN_FindService() at a time; the application must wait -** for the callback before it makes another call to -** the function. -** -** Returns DUN_SUCCESS if function execution succeeded, -** DUN_FAIL if function execution failed. -** -******************************************************************************/ -DUN_API extern UINT8 DUN_FindService(UINT16 service_uuid, BD_ADDR bd_addr, - tSDP_DISCOVERY_DB *p_db, UINT32 db_len, - tDUN_FIND_CBACK *p_cback); - -/****************************************************************************** -** -** Function DUN_SetTraceLevel -** -** Description Sets the trace level for DUN. If 0xff is passed, the -** current trace level is returned. -** -** Input Parameters: -** new_level: The level to set the DUN tracing to: -** 0xff-returns the current setting. -** 0-turns off tracing. -** >= 1-Errors. -** >= 2-Warnings. -** >= 3-APIs. -** >= 4-Events. -** >= 5-Debug. -** -** Returns The new trace level or current trace level if -** the input parameter is 0xff. -** -******************************************************************************/ -DUN_API extern UINT8 DUN_SetTraceLevel (UINT8 new_level); - -/******************************************************************************* -** -** Function DUN_Init -** -** Description This function is called before accessing the DUN APIs in order -** to initialize the control block. -** -** Returns void -** -*******************************************************************************/ -DUN_API extern void DUN_Init(void); - -#ifdef __cplusplus -} -#endif - -#endif /* DUN_API_H */ - diff --git a/stack/include/goep_util.h b/stack/include/goep_util.h deleted file mode 100644 index 600c6d0..0000000 --- a/stack/include/goep_util.h +++ /dev/null @@ -1,265 +0,0 @@ -/***************************************************************************** -** -** Name: goep_util.h -** -** File: Generic Object Exchange Profile utility API -** -** Copyright (c) 2000-2008, Broadcom Corp., All Rights Reserved. -** WIDCOMM Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef GOEP_UTIL_H -#define GOEP_UTIL_H - -#include "bt_target.h" -#include "sdp_api.h" /* for tSDP_DISC_REC */ - - -/***************************************************************************** -** Constants -*****************************************************************************/ - -#define GOEP_ENHANCED_VERSION 0x0102 -#define GOEP_LEGACY_VERSION 0x0100 - - -/***************************************************************************** -** Type Definitions -*****************************************************************************/ - -/*** Define goep error codes ***/ -enum -{ - GOEP_SUCCESS = 0, /* success */ - GOEP_ERROR, /* general failure */ - GOEP_RESOURCES, /* resources not available */ - GOEP_INVALID_PARAM /* bad parameter(s) */ -} ; -typedef UINT8 tGOEP_ERRORS; - - - - - -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - -/*** GOEP utility functions ***/ -/***************************************************************************** -** -** Function GOEP_SetSecurityLevel() -** -** Description Register security & encryption level for GOEP server. -** This is not to be used for the GOEP command server. -** -** Returns TRUE if OK, FALSE if a bad parameter -** -*****************************************************************************/ -GOEP_API extern BOOLEAN GOEP_SetSecurityLevel (BOOLEAN b_orig, - char *p_sz_name, - UINT32 service, - UINT8 sec, - UINT8 scn); - -/***************************************************************************** -** -** Function GOEP_SetTraceLevel -** -** Description This function changes the trace level (debugging levels) -** -** Returns void -** -*****************************************************************************/ -GOEP_API extern void GOEP_SetTraceLevel(UINT8 level); - -/******************************************************************************* -** -** Function GOEP_FreeBuf -** -** Description free memory for specified packet -** -** Returns void -** -*******************************************************************************/ -GOEP_API extern void GOEP_FreeBuf (void **p_buf); - -/******************************************************************************* -** -** Function GOEP_SendMsg -** -** Description send a message to BTU task -** -** Returns void -** -*******************************************************************************/ -GOEP_API extern void GOEP_SendMsg (void *p_msg); - -/******************************************************************************* -** -** Function GOEP_Init -** -** Description This function is called once at stack startup to allocate -** (if using dynamic memory) and initialize the -** control block, and initializes the -** debug tracing level. -** -** Returns void -** -*******************************************************************************/ -GOEP_API extern void GOEP_Init(void); - - - -/*** GOEP Service functions ***/ - - -/***************************************************************************** -** -** Function: GOEP_Register() -** -** Purpose: Register an OBEX profile with SDP -** -** Parameters: -** -** char *p_name service name; optional (may be NULL) -** UINT32 *phSDP handle to the created record; cannot be NULL -** UINT8 scn scn desired for the service; must be > 0 -** UINT16 version version of the service; optional (may be 0) -** -** Returns: (tGOEP_ERRORS) GOEP_SUCCESS if ok; GOEP_ERROR on error -** -** Notes: -** -** -** Preconditions: -** - phSDP must be set (to return the SDP record handle) -** - scn must be set -** -** Postconditions: -** - -** -*****************************************************************************/ -GOEP_API extern tGOEP_ERRORS GOEP_Register (char *p_name, - UINT32 *p_sdp_handle, - UINT8 scn, - UINT8 num_srv_class, - UINT16 *p_service_class, - UINT16 profile_id, - UINT16 version); -/***************************************************************************** -** -** Function: GOEP_Register2() -** -** Purpose: Register an OBEX 1.5 profile with SDP -** -** Parameters: -** -** char *p_name service name; optional (may be NULL) -** UINT32 *phSDP handle to the created record; cannot be NULL -** UINT16 psm psm desired for the service; must be an legal L2CAP dynamic PSM -** UINT16 version version of the service; optional (may be 0) -** -** Returns: (tGOEP_ERRORS) GOEP_SUCCESS if ok; GOEP_ERROR on error -** -** Notes: -** -** -** Preconditions: -** - phSDP must be set (to return the SDP record handle) -** - psm must be set -** -** Postconditions: -** - -** -*****************************************************************************/ -GOEP_API extern tGOEP_ERRORS GOEP_Register2 (char *p_name, - UINT32 *phSDP, - UINT16 psm, - UINT8 num_srv_class, - UINT16 *p_service_class, - UINT16 profile_id, - UINT16 version); - -/***************************************************************************** -** -** Function: GOEP_AddProtoLists() -** -** Purpose: Add the AdditionalProtocolDescriptorLists attribute -** to a SDP record -** -** Parameters: -** -** UINT32 sdp_hdl the SDP record handle -** UINT8 scn scn desired for the service; must be > 0 -** -** Returns: (tGOEP_ERRORS) GOEP_SUCCESS if ok; GOEP_ERROR on error -** -** Notes: -** -** -** Preconditions: -** - sdp_hdl must be set (to the SDP record handle from GOEP_Register()) -** - scn must be set -** -** Postconditions: -** - -** -*****************************************************************************/ -GOEP_API extern tGOEP_ERRORS GOEP_AddProtoLists ( UINT32 sdp_hdl, UINT8 scn); - - - -/*** Debug Tracing support ***/ -#if BT_USE_TRACES == TRUE - -GOEP_API extern char *GOEP_ErrorName (tGOEP_ERRORS error); -GOEP_API extern void GOEP_TraceSupportedDataTypes(UINT8 data_types, UINT8 *p_data_types); -#else -#ifndef BTE_SIM_APP -/* define these trace functions out */ -#define GOEP_CodeName(_x) "" -#define GOEP_ErrorName(_x) "" -#endif -#define GOEP_TraceSupportedDataTypes(x, y) -#endif - - -/***************************************************************************** -** -** Design notes: -** -** The responsibilities handle by this module include: -** -** a) Function signatures which assure the proper header fields are -** set for the GOEP connection establishment, GOEP put, and GOEP get. -** Required fields / headers are filled in through the API function -** parameters. Extensions beyond the required fields / headers -** must be set through the tOBEX_HEADERS *p_headers parameter. -** -** b) Debug error checking for required fields and prohibited fields -** for the GOEP connection establishment, GOEP put, and GOEP get. -** With debugging on, non-optional headers set in the p_headers -** parameter will generate a Widcomm assertion error. -** -** c) Does NOT include checks of any kind on the contents of the -** authentication or authentication response headers. In fact, -** the logic for encoding, decoding, validating, and calculating -** authentication data is outside the scope of GOEP and OBEX. -** Refer to IrOBEX v1.2 sections 2.2.13, 2.2.14, and 3.5. -** -** d) Does NOT include checks of any kind on the contents of the -** data (body headers) sent or received. -** -** -*****************************************************************************/ - -#ifdef __cplusplus -} -#endif - -#endif /* GOEP_UTIL_H */ diff --git a/stack/include/hidd_api.h b/stack/include/hidd_api.h deleted file mode 100644 index 180dc3e..0000000 --- a/stack/include/hidd_api.h +++ /dev/null @@ -1,241 +0,0 @@ -/**************************************************************************** -** -** Name: hidd_api.h -** -** Function: this file contains HID DEVICE side API definitions -** -** -** Copyright (c) 2002-2004, WIDCOMM Inc., All Rights Reserved. -** WIDCOMM Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef HIDD_API_H -#define HIDD_API_H - -#include "hiddefs.h" - - -/***************************************************************************** -** Type Definitions -*****************************************************************************/ - -/* Define the structures that the HID Device function should use to register -** callbacks with HID. -*/ - -typedef struct -{ - FLOW_SPEC ctrl_ch; - FLOW_SPEC int_ch; - FLOW_SPEC hci; -} tHID_DEV_QOS_INFO; - -typedef struct rep_data -{ - UINT8 rep_type; - UINT8 rep_id; -} tHID_DEV_GET_REP_DATA; - -/* HID-Device Callback Events -*/ -enum -{ - HID_DEV_EVT_OPEN, /*Connected to host with Interrupt and Control Data = 1 if Virtual Cable - Channels in OPEN state. pdata = Host BD-Addr.*/ - - HID_DEV_EVT_CLOSE, /*Connection with host is closed. Data=Reason Code. */ - HID_DEV_EVT_RETRYING, /*Lost connection is being re-connected. Data=Retrial number */ - HID_DEV_EVT_MODE_CHG, /*Device changed power mode. Data=new power mode */ - HID_DEV_EVT_PM_FAILED, - HID_DEV_EVT_CONTROL, /*Host sent HID_CONTROL Data=Control Operation */ - HID_DEV_EVT_GET_REPORT,/*Host sent GET_REPORT Data=Length pdata=structure - having details of get-report.*/ - HID_DEV_EVT_SET_REPORT,/*Host sent SET_REPORT Data=Length pdata=details.*/ - HID_DEV_EVT_GET_PROTO, /*Host sent GET_PROTOCOL Data=NA*/ - HID_DEV_EVT_SET_PROTO, /*Host sent SET_PROTOCOL Data=1 for Report, 0 for Boot*/ - HID_DEV_EVT_GET_IDLE, /*Host sent GET_IDLE Data=NA */ - HID_DEV_EVT_SET_IDLE, /*Host sent SET_IDLE Data=Idle Rate */ - HID_DEV_EVT_DATA, - HID_DEV_EVT_DATC, - - HID_DEV_EVT_L2CAP_CONGEST /* L2CAP channel congested */ -}; - -/* Define the possible states of the HID Device power manager. -*/ -enum -{ - HID_DEV_BUSY_CONN_ST, - HID_DEV_IDLE_CONN_ST, - HID_DEV_SUSP_CONN_ST -}; - -typedef union { - BD_ADDR host_bdaddr; - BT_HDR *buffer; - tHID_DEV_GET_REP_DATA get_rep; - UINT8 pm_err_code; - UINT16 pm_interval; -} tHID_DEV_CBACK_DATA; - -typedef void (tHID_DEV_CALLBACK) (UINT8 event, /* Event from HID-DEVICE. */ - UINT32 data, /* Integer data corresponding to the event. */ - tHID_DEV_CBACK_DATA *pdata ); /* Pointer data corresponding to the event.*/ - -typedef struct -{ - BD_ADDR host_addr;/* Host BD-ADDR */ - tHID_DEV_QOS_INFO *qos_info; /* This info is used only if HID_DEV_USE_GLB_QOS is set to FALSE.*/ - tHID_DEV_CALLBACK *app_cback; -} tHID_DEV_REG_INFO; - -typedef struct pwr_md -{ - UINT16 max; - UINT16 min; - UINT16 attempt; - UINT16 timeout; - UINT8 mode; -} tHID_DEV_PM_PWR_MD; - - -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - -/******************************************************************************* -** -** Function HID_DevSetSDPRecord -** -** Description This function should be called at startup to create the -** device SDP record -** -** Returns 0 if error else sdp handle for the record. -** -*******************************************************************************/ -HID_API extern UINT32 HID_DevSetSDPRecord (tHID_DEV_SDP_INFO *p_sdp_info); - -/******************************************************************************* -** -** Function HID_DevRegister -** -** Description This function must be called at startup so the device receive -** HID related events and call other HID API Calls. -** -** Returns tHID_STATUS -** -*******************************************************************************/ -HID_API extern tHID_STATUS HID_DevRegister(tHID_DEV_REG_INFO *pHID_DEVRegInfo ); - -/******************************************************************************* -** -** Function HID_DevDeregister -** -** Description This function may be used to remove HID service records and -** deregister from L2CAP. -** -** Returns tHID_STATUS -** -*******************************************************************************/ -HID_API extern tHID_STATUS HID_DevDeregister(void); - -/******************************************************************************* -** -** Function HID_DevConnect -** -** Description This function may be used to initiate a connection to the host.. -** -** Returns tHID_STATUS -** -*******************************************************************************/ -HID_API extern tHID_STATUS HID_DevConnect(void); - -/******************************************************************************* -** -** Function HID_DevDisconnect -** -** Description This function may be used to disconnect from the host. -** -** Returns tHID_STATUS -** -*******************************************************************************/ -HID_API extern tHID_STATUS HID_DevDisconnect(void); - -/******************************************************************************* -** -** Function HID_DevHandShake -** -** Description This function may be used to send HAND-SHAKE to host. -** -** Returns tHID_STATUS -** -*******************************************************************************/ -HID_API extern tHID_STATUS HID_DevHandShake(UINT8 res_code ); - -/******************************************************************************* -** -** Function HID_DevVirtualUnplug -** -** Description This function may be used to send VIRTUAL-UNPLUG to host. -** -** Returns tHID_STATUS -** -*******************************************************************************/ -HID_API extern tHID_STATUS HID_DevVirtualUnplug (void); - -/******************************************************************************* -** -** Function HID_DevSendData -** -** Description This function may be used to send input reports to host. -** -** Returns tHID_STATUS -** -*******************************************************************************/ -HID_API extern tHID_STATUS HID_DevSendData (BOOLEAN control_ch, UINT8 rep_type, - BT_HDR *data_buf ); - -/******************************************************************************* -** -** Function HID_DevSetPowerMgmtParams -** -** Description This function may be used to change power mgmt parameters. -** -** Returns tHID_STATUS -** -*******************************************************************************/ -HID_API extern tHID_STATUS HID_DevSetPowerMgmtParams(UINT8 conn_substate, - tHID_DEV_PM_PWR_MD pm_params ); - -/******************************************************************************* -** -** Function HID_DevInit -** -** Description This function initializes the control block and trace variable -** -** Returns void -** -*******************************************************************************/ -HID_API extern void HID_DevInit(void); - -/******************************************************************************* -** -** Function HID_DevSetSecurityLevel -** -** Description This function set security level for the Hid Device service. -** -** Returns tHID_STATUS -** -*******************************************************************************/ -HID_API extern tHID_STATUS HID_DevSetSecurityLevel( char serv_name[], UINT8 sec_lvl ); - - -#ifdef __cplusplus -} -#endif - -#endif /* HIDD_API_H */ diff --git a/stack/include/xml_bld_api.h b/stack/include/xml_bld_api.h deleted file mode 100644 index 2d788e0..0000000 --- a/stack/include/xml_bld_api.h +++ /dev/null @@ -1,113 +0,0 @@ -/***************************************************************************** -** -** Name: xml_bld_api.h -** -** File: XML Builder API -** -** -** Copyright (c) 2000-2004, WIDCOMM Inc., All Rights Reserved. -** WIDCOMM Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef XML_BLD_API_H -#define XML_BLD_API_H - -#include "data_types.h" - - -/***************************************************************************** -** Type Definitions -*****************************************************************************/ - -enum -{ - XML_BLD_SUCCESS, - XML_BLD_ERROR -}; -typedef UINT16 tXML_BLD_RESULT; - - -enum -{ - XML_ATTR_CONT = FALSE, /* not the end of attribute list. add quote(') */ - XML_ATTR_LAST = TRUE, /* the last one of the attribute list. add quote('), greater_than(>), and line_feed(\n) */ - XML_ATTR_ETAG = 2 /* the end of the element. add quote('), end_mark(/), greater_than(>), and line_feed(\n) */ -}; -typedef UINT8 tXML_ATTR_END; - - -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - - - -/***************************************************************************** -** -** Function: XML_BufAddTag -** -** Purpose: Write a start or end tag and optional prefix. -** -** Parameters: -** UINT8 **pp_buf reference to the storage to hold the XML object -** GOEP_WriteStore. -** const UINT8* prefix tag prefix (namespace) -** const UINT8* tag tag name -** BOOLEAN start_tag TRUE = start tag, FALSE = end tag -** BOOLEAN has_attr TRUE if the tag contains attributes -** -** Returns: XML_BLD_SUCCESS if success -** -*****************************************************************************/ -tXML_BLD_RESULT XML_BufAddTag (UINT8 **pp_buf, - const UINT8 *prefix, - const UINT8 *tag, - BOOLEAN start_tag, - BOOLEAN has_attr); - - -/***************************************************************************** -** -** Function: XML_BufAddAttribute -** -** Purpose: Write an attribute and optional prefix. -** -** Parameters: -** UINT8 **pp_buf reference to the storage to hold the XML object -** const UINT8* prefix attribute prefix (namespace) -** const UINT8* attr_name attribute name -** const UINT8* attr_value attribute value -** -** Returns: XML_BLD_SUCCESS if success -** -*****************************************************************************/ -tXML_BLD_RESULT XML_BufAddAttribute (UINT8 **pp_buf, - const UINT8 *prefix, - const UINT8 *attr_name, - const UINT8 *attr_value, - tXML_ATTR_END last_attr); - -/***************************************************************************** -** -** Function: XML_BufAddCharData -** -** Purpose: Write the element content. -** -** Parameters: -** UINT8 **pp_buf reference to the storage to hold the XML object -** const UINT8* content element content -** -** Returns: XML_BLD_SUCCESS if success -** -*****************************************************************************/ -tXML_BLD_RESULT XML_BufAddCharData (UINT8 **pp_buf, const UINT8 *charData); - -#ifdef __cplusplus -} -#endif - -#endif /* ifndef XML_BLD_API_H */ diff --git a/stack/include/xml_erp_api.h b/stack/include/xml_erp_api.h deleted file mode 100644 index fa2b33a..0000000 --- a/stack/include/xml_erp_api.h +++ /dev/null @@ -1,145 +0,0 @@ -/****************************************************************************** - ** - ** Name: xml_erp_api.h - ** $Id: - ** - ** Description: This module contains xml parser of MAP event report - ** - ** Copyright (c) 2004-2005, Broadcom Corporation, All Rights Reserved. - ** WIDCOMM Bluetooth Core. Proprietary and confidential. - ******************************************************************************/ - -#ifndef XML_ERP_API_H -#define XML_ERP_API_H - -#include "bt_target.h" -#include "gki.h" -#include "xml_pars_api.h" - - -#ifndef XML_EVT_RPT_CARRY_OVER_LEN -#define XML_EVT_RPT_CARRY_OVER_LEN 512 /* number of bytes we can store in case we did not yet find the > */ -#endif - -/**********************************************************************************/ - -typedef struct -{ - UINT16 type_len; - UINT16 handle_len; - UINT16 folder_len; - UINT16 old_folder_len; - UINT16 msg_type_len; - UINT8 *type; - UINT8 *handle; - UINT8 *folder; - UINT8 *old_folder; - UINT8 *msg_type; -} tXML_EVT_RPT_ENTRY; - -/**********************************************************************************/ - -enum -{ - XML_EVT_RPT_OK, /* parsing is ok, operation is ok */ - XML_EVT_RPT_PENDING, /* parsing is ok but not enough data */ - XML_EVT_RPT_END_LIST, /* found </MAP-event-report> */ - XML_EVT_RPT_OUT_FULL, /* output buffer full /MAP-event-report not reached! data is dumped */ - XML_EVT_RPT_ERROR, /* some parsing error occured */ - XML_EVT_RPT_NO_RES, /* ran out of resources (memory) */ - XML_EVT_RPT_DST_NO_RES /* ran out of destination data buffer */ -} ; -typedef UINT8 tXML_EVT_RPT_RES; - - -typedef struct -{ - tXML_EVT_RPT_ENTRY *p_entry; /* point to parser_cb->ilist.evt_rpt */ - tXML_PROP *p_prop; /* GKI_BUF3_SIZE */ - - tXML_PROP *offset_prop; /* current filling property */ - UINT16 prop_num; /* number of properties left to be filled in */ - - INT16 current_entry; - INT16 max_name_len; /* maximum length of name length of entry - XML parser limits to 196 bytes i think. */ - UINT16 max_entry; - BOOLEAN ended; - UINT16 prop_index; - UINT16 max_num_prop; - UINT8 obj; /* the XML object - (tFTC_XML_OBJ + 1)*/ -} tXML_EVT_RPT_STATE; - -typedef struct -{ - tXML_MUL_STATE xml; - tXML_EVT_RPT_STATE xml_user_data; -} tXML_EVT_RPT_PARSER; - -/* only this value is of significance, if not ok frame is dropped by parser */ -#define XML_EVT_RPT_ENTRY_OK 0 - -typedef UINT8 tXML_EVT_RPT_STATUS; - - -typedef struct -{ - UINT8 *data; - UINT16 len; - BOOLEAN final; /* If TRUE, entry is last of the series */ - tXML_EVT_RPT_STATUS status; /* Fields are valid when status is BTA_FTC_OK */ -} tXML_EVT_RPT_LIST; /* clone of tBTA_FTC_LIST */ - - -/************************************************************************************** -** Function XML_EvtRptInit -** -** Description Initialize xml parser state machine. -** -** Parameters p_xml_state: address of parser structure, allocate an additional space -** of size XML_EVT_RPT_CARRY_OVER_LEN right after p_xml_state -** to hold carry over data. -** p_entry : points start of output directory entry. caller needs do free this memory -** max_entry : max is 16 bit integer value which is the maximum number of folder entries. - -** -** Returns void -**************************************************************************************/ -MCE_API void XML_EvtRptInit( tXML_EVT_RPT_PARSER *p_xml_state, - tXML_EVT_RPT_ENTRY *p_entry, - const UINT16 max_entry ); - - -/************************************************************************************** -** Function XML_EvtRptParse -** -** Description This function is called to parse the xml data received from OBEX -** into folder entries associated with properties value. It can also be -** used as clean up function to delete left over data from previous parse. -** This clean up function is typically used when application runs out of -** resource and decides to discard extra xml data received. -** -** Parameters p_xml_state: pointer to a xml parser initialized by XML_FolderInit(). -** xml_data: valid pointer to OBEX list data in xml format. -** xml_len: length of the package, must be non-zero value. -** dst_data: valid pointer to the buffer for holding converted folder entry name. -** When dst_data is NULL, clean up all remaining data in the parser. -** dst_len: length of the dst_data buffer, its carry out value is the number -** of bytes of available buffer remains. -** num_entries: current number of entries, in the end it is the total number of entries -** -** Returns tXML_EVT_RPT_RES (see xml_flp.h) -** XML_PENDING: parsing not completed -** XML_END_LIST: found /folder-listing but no final flag detected -** XML_EVT_RPT_OUT_FULL: reached max_entry -> do not call parser anymore!!! dump data -** XML_EVT_RPT_DST_NO_RES : run out of dst buffer resource while -** some xml data still remains. - -**************************************************************************************/ -MCE_API extern tXML_EVT_RPT_RES XML_EvtRptParse( tXML_EVT_RPT_PARSER *p_xml_state, - UINT8 *xml_data, UINT16 xml_len, - UINT8 *dst_data, UINT16 *dst_len, - UINT16 *num_entries ); - - -#endif diff --git a/stack/include/xml_flp_api.h b/stack/include/xml_flp_api.h deleted file mode 100644 index fddb839..0000000 --- a/stack/include/xml_flp_api.h +++ /dev/null @@ -1,162 +0,0 @@ -/****************************************************************************** - ** - ** Name: xml_flp.h - ** $Id: xml_flp.h,v 1.2 2004/11/15 14:07:47 rlenden Exp - ** - ** Description: This module contains xml parser of obex folder listing - ** - ** Copyright (c) 2004-2005, Broadcom Corporation, All Rights Reserved. - ** WIDCOMM Bluetooth Core. Proprietary and confidential. - ******************************************************************************/ - -#ifndef XML_FLP_H -#define XML_FLP_H - -#include "bt_target.h" -#include "gki.h" -#include "xml_pars_api.h" - -/**********************************************************************************/ -#ifndef XML_OBX_FOLDER -#define XML_OBX_FOLDER 0 -#endif -#ifndef XML_OBX_FILE -#define XML_OBX_FILE 1 -#endif - -#define XML_PERM_READ_B 0x01 -#define XML_PERM_WRITE_B 0x02 -#define XML_PERM_DELETE_B 0x04 - -typedef UINT8 XML_PERM_MASK ; - -#ifndef XML_OBX_FILE_MAX -#define XML_OBX_FILE_MAX 100 -#endif - -#ifndef XML_FOLDER_CARRY_OVER_LEN -#define XML_FOLDER_CARRY_OVER_LEN 512 /* number of bytes we can store in case we did not yet find the > */ -#endif - - -#ifndef XML_PARENT_FOLDER -#define XML_PARENT_FOLDER ".." /* <parent-folder/> is represented as .. */ -#endif - - -typedef struct -{ - - UINT8 *data; - UINT32 size; /* size of file or folder in bytes */ - UINT16 len; - UINT8 type; - XML_PERM_MASK user_perm; -} tXML_FOLDER_ENTRY; - -/**********************************************************************************/ - -typedef enum -{ - XML_FOLDER_OK, /* parsing is ok, operation is ok */ - XML_FOLDER_PENDING, /* parsing is ok but not enough data */ - XML_FOLDER_END_LIST, /* found </folder-listing> */ - XML_FOLDER_OUT_FULL, /* output buffer full /folder-listing not reached! data is dumped */ - XML_FOLDER_ERROR, /* some parsing error occured */ - XML_FOLDER_NO_RES, /* ran out of resources (memory) */ - XML_FOLDER_DST_NO_RES /* ran out of destination data buffer */ -} txml_folder_res; -typedef UINT8 tXML_FOLDER_RES; - - -typedef struct -{ - tXML_FOLDER_ENTRY *p_entry; - tXML_PROP *p_prop; - - tXML_PROP *offset_prop; /* current filling property */ - UINT16 prop_num; /* number of properties left to be filled in */ - - INT16 current_entry; - INT16 max_name_len; /* maximum length of name length of entry - XML parser limits to 196 bytes i think. */ - UINT16 max_entry; - BOOLEAN ended; - UINT16 prop_index; - UINT16 max_num_prop; - UINT8 obj; /* the XML object - (tFTC_XML_OBJ + 1)*/ -} tXML_FOLDER_STATE; - -typedef struct -{ - tXML_MUL_STATE xml; - tXML_FOLDER_STATE xml_user_data; -} tXML_FOLDER_PARSER; - -/* only this value is of significance, if not ok frame is dropped by parser */ -#define XML_FOLDER_ENTRY_OK 0 - -typedef UINT8 tXML_FOLDER_STATUS; - - -typedef struct -{ - UINT8 *data; - UINT16 len; - BOOLEAN final; /* If TRUE, entry is last of the series */ - tXML_FOLDER_STATUS status; /* Fields are valid when status is BTA_FTC_OK */ -} tXML_FOLDER_LIST; /* clone of tBTA_FTC_LIST */ - - -/************************************************************************************** -** Function XML_FolderInit -** -** Description Initialize xml parser state machine. -** -** Parameters p_xml_state: address of parser structure, allocate an additional space -** of size XML_FOLDER_CARRY_OVER_LEN right after p_xml_state -** to hold carry over data. -** p_entry : points start of output directory entry. caller needs do free this memory -** max_entry : max is 16 bit integer value which is the maximum number of folder entries. - -** -** Returns void -**************************************************************************************/ -FTP_API void XML_FolderInit( tXML_FOLDER_PARSER *p_xml_state, - tXML_FOLDER_ENTRY *p_entry, - const UINT16 max_entry ); - - -/************************************************************************************** -** Function XML_FolderParse -** -** Description This function is called to parse the xml data received from OBEX -** into folder entries associated with properties value. It can also be -** used as clean up function to delete left over data from previous parse. -** This clean up function is typically used when application runs out of -** resource and decides to discard extra xml data received. -** -** Parameters p_xml_state: pointer to a xml parser initialized by XML_FolderInit(). -** xml_data: valid pointer to OBEX list data in xml format. -** xml_len: length of the package, must be non-zero value. -** dst_data: valid pointer to the buffer for holding converted folder entry name. -** When dst_data is NULL, clean up all remaining data in the parser. -** dst_len: length of the dst_data buffer, its carry out value is the number -** of bytes of available buffer remains. -** num_entries: current number of entries, in the end it is the total number of entries -** -** Returns tXML_FOLDER_RES (see xml_flp.h) -** XML_PENDING: parsing not completed -** XML_END_LIST: found /folder-listing but no final flag detected -** XML_FOLDER_OUT_FULL: reached max_entry -> do not call parser anymore!!! dump data -** XML_FOLDER_DST_NO_RES : run out of dst buffer resource while -** some xml data still remains. - -**************************************************************************************/ -FTP_API extern tXML_FOLDER_RES XML_FolderParse( tXML_FOLDER_PARSER *p_xml_state, - UINT8 *xml_data, UINT16 xml_len, - UINT8 *dst_data, UINT16 *dst_len, - UINT16 *num_entries ); - - -#endif diff --git a/stack/include/xml_mlp_api.h b/stack/include/xml_mlp_api.h deleted file mode 100644 index eabbfbd..0000000 --- a/stack/include/xml_mlp_api.h +++ /dev/null @@ -1,169 +0,0 @@ -/****************************************************************************** - ** - ** Name: xml_mlp_api.h - ** $Id: - ** - ** Description: This module contains xml parser of MAP message list object - ** - ** Copyright (c) 2004-2005, Broadcom Corporation, All Rights Reserved. - ** WIDCOMM Bluetooth Core. Proprietary and confidential. - ******************************************************************************/ - -#ifndef XML_MLP_API_H -#define XML_MLP_API_H - -#include "bt_target.h" -#include "gki.h" -#include "xml_pars_api.h" - - -#ifndef XML_ML_CARRY_OVER_LEN -#define XML_ML_CARRY_OVER_LEN 512 /* number of bytes we can store in case we did not yet find the > */ -#endif - -/**********************************************************************************/ - -typedef struct -{ - UINT16 msg_handle_len; - UINT16 subject_len; - UINT16 datetime_len; - UINT16 sender_name_len; - UINT16 sender_addressing_len; - UINT16 replyto_addressing_len; - UINT16 recipient_name_len; - UINT16 recipient_addressing_len; - UINT16 type_len; - UINT16 org_msg_size_len; - UINT16 text_len; - UINT16 reception_status_len; - UINT16 attachment_size_len; - UINT16 priority_status_len; - UINT16 read_len; - UINT16 sent_len; - UINT16 is_protected_len; - UINT8 *msg_handle; - UINT8 *subject; - UINT8 *datetime; - UINT8 *sender_name; - UINT8 *sender_addressing; - UINT8 *replyto_addressing; - UINT8 *recipient_name; - UINT8 *recipient_addressing; - UINT8 *type; - UINT8 *org_msg_size; - UINT8 *text; - UINT8 *reception_status; - UINT8 *attachment_size; - UINT8 *priority_status; - UINT8 *read; - UINT8 *sent; - UINT8 *is_protected; -} tXML_ML_ENTRY; - -/**********************************************************************************/ - -enum -{ - XML_ML_OK, /* parsing is ok, operation is ok */ - XML_ML_PENDING, /* parsing is ok but not enough data */ - XML_ML_END_LIST, /* found </MAP-msg-listing> */ - XML_ML_OUT_FULL, /* output buffer full /MAP-msg-listing not reached! data is dumped */ - XML_ML_ERROR, /* some parsing error occured */ - XML_ML_NO_RES, /* ran out of resources (memory) */ - XML_ML_DST_NO_RES /* ran out of destination data buffer */ -}; -typedef UINT8 tXML_ML_RES; - - -typedef struct -{ - tXML_ML_ENTRY *p_entry; /* point to parser_cb->mlist.evt_rpt */ - tXML_PROP *p_prop; /* GKI_BUF3_SIZE */ - - tXML_PROP *offset_prop; /* current filling property */ - UINT16 prop_num; /* number of properties left to be filled in */ - - INT16 current_entry; - INT16 max_name_len; /* maximum length of name length of entry - XML parser limits to 196 bytes i think. */ - UINT16 max_entry; - BOOLEAN ended; - UINT16 prop_index; - UINT16 max_num_prop; - UINT8 obj; /* the XML object - (tFTC_XML_OBJ + 1)*/ -} tXML_ML_STATE; - -typedef struct -{ - tXML_MUL_STATE xml; - tXML_ML_STATE xml_user_data; -} tXML_ML_PARSER; - -/* only this value is of significance, if not ok frame is dropped by parser */ -#define XML_ML_ENTRY_OK 0 - -typedef UINT8 tXML_ML_STATUS; - - -typedef struct -{ - UINT8 *data; - UINT16 len; - BOOLEAN final; /* If TRUE, entry is last of the series */ - tXML_ML_STATUS status; /* Fields are valid when status is BTA_FTC_OK */ -} tXML_ML_LIST; /* clone of tBTA_FTC_LIST */ - - -/************************************************************************************** -** Function XML_MlInit -** -** Description Initialize xml parser state machine. -** -** Parameters p_xml_state: address of parser structure, allocate an additional space -** of size XML_ML_CARRY_OVER_LEN right after p_xml_state -** to hold carry over data. -** p_entry : points start of output directory entry. caller needs do free this memory -** max_entry : max is 16 bit integer value which is the maximum number of folder entries. - -** -** Returns void -**************************************************************************************/ -MCE_API void XML_MlInit( tXML_ML_PARSER *p_xml_state, - tXML_ML_ENTRY *p_entry, - const UINT16 max_entry ); - - -/************************************************************************************** -** Function XML_MLParse -** -** Description This function is called to parse the xml data received from OBEX -** into folder entries associated with properties value. It can also be -** used as clean up function to delete left over data from previous parse. -** This clean up function is typically used when application runs out of -** resource and decides to discard extra xml data received. -** -** Parameters p_xml_state: pointer to a xml parser initialized by XML_FolderInit(). -** xml_data: valid pointer to OBEX list data in xml format. -** xml_len: length of the package, must be non-zero value. -** dst_data: valid pointer to the buffer for holding converted folder entry name. -** When dst_data is NULL, clean up all remaining data in the parser. -** dst_len: length of the dst_data buffer, its carry out value is the number -** of bytes of available buffer remains. -** num_entries: current number of entries, in the end it is the total number of entries -** -** Returns tXML_ML_RES (see xml_flp.h) -** XML_PENDING: parsing not completed -** XML_END_LIST: found /folder-listing but no final flag detected -** XML_ML_OUT_FULL: reached max_entry -> do not call parser anymore!!! dump data -** XML_ML_DST_NO_RES : run out of dst buffer resource while -** some xml data still remains. - -**************************************************************************************/ -MCE_API extern tXML_ML_RES XML_MlParse( tXML_ML_PARSER *p_xml_state, - UINT8 *xml_data, UINT16 xml_len, - UINT8 *dst_data, UINT16 *dst_len, - UINT16 *num_entries ); - - -#endif diff --git a/stack/include/xml_pars_api.h b/stack/include/xml_pars_api.h deleted file mode 100644 index d29645a..0000000 --- a/stack/include/xml_pars_api.h +++ /dev/null @@ -1,358 +0,0 @@ -/***************************************************************************** -** -** Name: xml_pars_api.h -** -** File: XML Parser -** -** Copyright (c) 2000-2004, WIDCOMM Inc., All Rights Reserved. -** WIDCOMM Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef XML_PARS_API_H -#define XML_PARS_API_H - -#include "data_types.h" - -#define XML_STACK_SIZE 7 - -#ifndef XML_UI_ENTRY_MAX_NAME_LEN -#define XML_UI_ENTRY_MAX_NAME_LEN 256 -#endif - -/***************************************************************************** -** Type Definitions -*****************************************************************************/ - -/* Definition of XML events */ -enum -{ - XML_XMLDECL, - XML_TAG, /* 1 For STag (Start Tag) and EmptyElemTag */ - XML_TAG_END, /* 2 When STag or EmptyElemTag ends */ - XML_ATTRIBUTE, /* 3 */ - XML_CHARDATA, /* 4 */ - XML_ETAG, /* 5 For End Tag */ - XML_PARTIAL, /* 6 notify XML user that the parse does not end properly */ - XML_COPY, /* 7 notify XML user to copy till end of a token */ - XML_QUERY, /* 8 query if the XML object has ended */ - XML_TOP /* 9 */ -}; -typedef UINT16 tXML_EVENT; -#define XML_LAST_XE XML_ETAG - -enum -{ - XML_SUCCESS, - XML_WARNING, - XML_OBJ_ST_EMPTY, - XML_NO_MEM, /* no p_last_bfr, and the tXML_MUL_STATE is not in init */ - XML_NO_PROP, /* run out of tXML_PROP */ - XML_ERR, /* generic error */ - XML_NO_END /* to be continued */ -}; -typedef UINT16 tXML_RESULT; - -/* Definitions of different event data */ -typedef struct -{ - UINT8 *p_version; - UINT8 *p_enc_name; - BOOLEAN *p_standalone; /* NULL if no standalone decl was found */ -} tXML_DECL; - - - -/* for parser that expand multi-sessions */ -/* tag stack */ -typedef struct -{ - UINT8 stack[XML_STACK_SIZE]; - UINT8 top; - tXML_EVENT event; /* last XML event */ -} tXML_STACK; - -typedef struct -{ - UINT8 *p; - UINT16 len; -} tXML_STR; - -typedef struct -{ - tXML_STACK stack; - tXML_STR prefix; - tXML_STR name; - UINT8 *p_last_stm; -} tXML_MTAG; - -typedef struct -{ - tXML_STACK stack; - BOOLEAN end; /* true if end of EmptyElemTag */ - /* false if end of STag */ -} tXML_MTAG_END; - - - -typedef struct -{ - tXML_STACK stack; - tXML_STR prefix; - tXML_STR name; - tXML_STR value; -} tXML_MATTR; - - -/* There may be several XML_CHARDATA events dispatched for one CHARDATA -** string in the XML document. In each XML_CHARDATA only a segment of the -** total string is provided. For the last segement the field last is true. -*/ -typedef struct -{ - tXML_STACK stack; - tXML_STR value; - BOOLEAN last; -} tXML_MCH_DATA; - - -typedef struct -{ - tXML_STACK stack; - tXML_STR prefix; - tXML_STR name; -} tXML_METAG; - -typedef struct -{ - tXML_STACK stack; - UINT8 *p_begin; - tXML_STR last; -} tXML_MCOPY; - -typedef struct -{ - tXML_STACK stack; - tXML_RESULT parse; - UINT8 *p_keep; -} tXML_MPART; - -typedef union -{ - tXML_STACK stack; - tXML_DECL decl; - tXML_MTAG tag; - tXML_MTAG_END empty_elem; - tXML_MATTR attr; - tXML_MCH_DATA ch_data; - tXML_METAG etag; - tXML_MCOPY copy; - tXML_MPART part; -} tXML_MEVT_DATA; - -typedef struct -{ - UINT8 *p_data; /* Pointer to property data. */ - UINT16 len; /* Length of data. */ - UINT8 prefix; /* Property prefix. */ - UINT8 name; /* Property name. */ - UINT8 level; /* 0 as top level */ -} tXML_PROP; - -/* Definitions of different error actions. -** At present there is only one. -*/ -enum -{ - XML_NEXT_TAG /* tries to find beginning of next tag */ -}; -typedef UINT16 tXML_ERR_ACTION; - - - -enum -{ - XML_STS_INIT, - XML_STS_1STM, /* got the first < */ - XML_STS_1TAG, /* got the first tag element */ - XML_STS_DONE -}; -typedef UINT8 tXML_STATUS; - -typedef struct -{ - UINT8 *p_hdr; /* the beginning of GKI buffer */ - UINT8 *p_begin;/* the beginning of XML data */ - UINT8 *p_end; /* the end of XML data */ -} tXML_OS; - - -/***************************************************************************** -** -** Callback tXML_CBACK -** -** Description -** Called repeatedly from the XML parser for each XML construct parsed. -** The parsed XML construct is reported as an XML event in the event -** in-parameter. The parser provides event data specific for each event -** in the callback through the p_event_data param which should be casted -** to the proper type by the user implemented tXML_CBACK function. -** The p_event_data should be casted to a pointer of a type with the same -** name as the event but prefixed with t. For example when the event is -** XML_TAG, p_event_data should be casted to tXML_TAG*. Alternatively, -** p_event_data can be casted to a tEVENT_DATA* (pointer to union) type -** for all events. The memory behind the p_event_data is provided by the -** parser and is only valid during the callback, i.e. the memory is not -** valid after the callback. No pointer inside the event structures may -** be NULL unless explicitly stated so above for some specific event. -** The p_usr_data parameter is the same p_usr_data pointer the -** API user passed in the XML_Parse. It is only declared as a mean for -** the API user to pass any user data to its callback function. -** -** -** Parameters -** event (in) : the XML event or XML contruct just parsed, -** p_event_data (in) : data, i.e. names values etc, found in the XML -** construct. The data is specific for the XML -** construct and should be casted to the -** proper type as descibed above. May not be NULL. -** p_usr_data (in) : Same p_usr_data as passed in XML_Parse. -** -** Returns -** TRUE : if parsing should continue -** FALSE : if parsing should stop -** -*****************************************************************************/ - -typedef BOOLEAN (*tXML_CBACK)(tXML_EVENT event, void *p_event_data, - void *p_usr_data); - -typedef struct -{ - - UINT8 p[512]; - UINT16 len; -} tXML_STR_PARTIAL; - -typedef struct -{ - tXML_STR_PARTIAL last_bfr; - UINT16 used_last_bfr; - tXML_MEVT_DATA event_data; -} -tXML_PARTIAL; - -/* tXML_STATE stores state during the XML_Parse call not between -** XML_Parse calls. It is used in most static functions in this file -** and passed in as first parameter to these. -*/ -typedef struct -{ - /* input from XML_Parse caller */ - tXML_OS xml_os; - UINT8 *p_cur; - tXML_CBACK cback; - void *p_usr_data; - tXML_MEVT_DATA event_data; - - /* handling of data buffers for prefix, name and value */ - UINT8 *p_data_bfr; - UINT8 *p_last_stm; /* last '<' */ - UINT8 *p_copy; - tXML_STR last_bfr; - tXML_STR value; - tXML_STR prefix; - tXML_STR name; - - /* token and result handling */ - INT16 curr_res; - tXML_RESULT pars_res; - UINT8 next_token; - BOOLEAN skip_next_nl; - - UINT16 used_last_bfr; /* the actual data size in p_last_bfr */ - tXML_STATUS status; - - /* structure used to store partial data */ - tXML_PARTIAL partial_st; -} tXML_MUL_STATE; - -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - -/***************************************************************************** -** -** Function XML_Parse -** -** Description -** Parses an XML message/document in utf8. The message is read from -** an object store which must have been initialised and an object -** (file) must have been opened so the parser can start directly with -** reading the first byte using the GOEP_Read function and passing -** the h_obj_store in-param. -** The parser will call the xml_cback callback for each basic -** XML-construct parsed. If the parser encounters an error it will -** try to act according to the err_action in-param and report any -** errors through the err_handle. The parser is non-validating. -** -** Parameters -** h_obj_store (in) : a handle to an opened object (file) in -** the Object Store. The object must be -** ready for reading. -** xml_cback (in) : the user provided function to call back -** for each XML-construct (XML event) parsed. -** err_action (in) : the action the parser will try if it finds -** an error. -** err_handle (in) : a handle to some error recording object to -** which the parser may report errors. This is -** a place holder to connect any type of error -** recording object. -** p_usr_data (in) : any user data that will be passed on -** unchanged to the callback function. -** -** Returns -** 0 if the parsing was successfull without errors -** non-zero error or warning code otherwise -** -*****************************************************************************/ - -tXML_RESULT XML_Parse(tXML_OS *p_os, tXML_CBACK xml_cback, - tXML_ERR_ACTION err_action, UINT32 err_handle, - void *p_usr_data); - -/***************************************************************************** -** -** Function XML_MulParse -** -** Description Initialize XML parser state machine. -** -** Parameters -** p_st (in) : xml state machine. -** p_os (in) : xml data storage -** -*****************************************************************************/ -tXML_RESULT XML_MulParse(tXML_MUL_STATE *p_st, tXML_OS *p_os); - -/***************************************************************************** -** -** Function XML_InitPars -** -** Description Initialize XML parser state machine. -** -** Parameters -** p_st (in) : xml state machine. -** xml_cback (in) : the user provided function to call back -** p_usr_data : user defined data. -** -*****************************************************************************/ -void XML_InitPars(tXML_MUL_STATE *p_st, tXML_CBACK xml_cback, void *p_usr_data); - -#ifdef __cplusplus -} -#endif - -#endif /* ifndef XML_PARS_API_H */ diff --git a/stack/include/xml_vlist_api.h b/stack/include/xml_vlist_api.h deleted file mode 100644 index 362432a..0000000 --- a/stack/include/xml_vlist_api.h +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** - ** - ** Name: xml_vlist_api.h - ** - ** Description: This module contains xml parser of obex vcard listing - ** - ** Copyright (c) 2004-2005, Broadcom Corporation, All Rights Reserved. - ** WIDCOMM Bluetooth Core. Proprietary and confidential. - ******************************************************************************/ - -#ifndef XML_VLIST_API_H -#define XML_VLIST_API_H - -#include "bt_target.h" -#include "gki.h" -#include "xml_pars_api.h" - -/**********************************************************************************/ -#ifndef XML_VLIST_CARRY_OVER_LEN -#define XML_VLIST_CARRY_OVER_LEN 512 /* number of bytes we can store in case we did not yet find the > */ -#endif - -typedef struct -{ - UINT16 handle_len; - UINT8 *handle; - UINT16 name_len; - UINT8 *name; -} tXML_VLIST_ENTRY; - -/**********************************************************************************/ - -typedef enum -{ - XML_VLIST_OK, /* parsing is ok, operation is ok */ - XML_VLIST_PENDING, /* parsing is ok but not enough data */ - XML_VLIST_END_LIST, /* found </vCard-listing> */ - XML_VLIST_OUT_FULL, /* output buffer full /vCard-listing not reached! data is dumped */ - XML_VLIST_ERROR, /* some parsing error occured */ - XML_VLIST_NO_RES, /* ran out of resources (memory) */ - XML_VLIST_DST_NO_RES /* ran out of destination data buffer */ -} txml_vlist_res; -typedef UINT8 tXML_VLIST_RES; - - -typedef struct -{ - tXML_VLIST_ENTRY *p_entry; - tXML_PROP *p_prop; - - tXML_PROP *offset_prop; /* current filling property */ - UINT16 prop_num; /* number of properties left to be filled in */ - - INT16 current_entry; - INT16 max_name_len; /* maximum length of name length of entry - XML parser limits to 64 bytes i think. */ - UINT16 max_entry; - BOOLEAN ended; - UINT16 prop_index; - UINT16 max_num_prop; - UINT8 obj; /* the XML object */ -} tXML_VLIST_STATE; - -typedef struct -{ - tXML_MUL_STATE xml; - tXML_VLIST_STATE xml_user_data; -} tXML_VLIST_PARSER; - -/* only this value is of significance, if not ok frame is dropped by parser */ -#define XML_VLIST_ENTRY_OK 0 - -typedef UINT8 tXML_VLIST_STATUS; - - -typedef struct -{ - UINT8 *data; - UINT16 len; - BOOLEAN final; /* If TRUE, entry is last of the series */ - tXML_VLIST_STATUS status; /* Fields are valid when status is BTA_FTC_OK */ -} tXML_VLIST_LIST; /* clone of tBTA_FTC_LIST */ - - -/************************************************************************************** -** Function XML_VlistInit -** -** Description Initialize xml parser state machine. -** -** Parameters p_xml_state: address of parser structure, allocate an additional space -** of size XML_VLIST_CARRY_OVER_LEN right after p_xml_state -** to hold carry over data. -** p_entry : points start of output vlist entry. caller needs do free this memory -** max_entry : max is 16 bit integer value which is the maximum number of vlist entries. - -** -** Returns void -**************************************************************************************/ -BT_API void XML_VlistInit(tXML_VLIST_PARSER *p_xml_state, - tXML_VLIST_ENTRY *p_entry, - const UINT16 max_entry ); - - -/************************************************************************************** -** Function XML_VlistParse -** -** Description This function is called to parse the xml data received from OBEX -** into vlist entries associated with properties value. It can also be -** used as clean up function to delete left over data from previous parse. -** This clean up function is typically used when application runs out of -** resource and decides to discard extra xml data received. -** -** Parameters p_xml_state: pointer to a xml parser initialized by XML_VlistInit(). -** xml_data: valid pointer to OBEX list data in xml format. -** xml_len: length of the package, must be non-zero value. -** dst_data: valid pointer to the buffer for holding converted vlist entry name and handle. -** When dst_data is NULL, clean up all remaining data in the parser. -** dst_len: length of the dst_data buffer, its carry out value is the number -** of bytes of available buffer remains. -** num_entries: current number of entries, in the end it is the total number of entries -** -** Returns tXML_VLIST_RES (see xml_vlist_api.h) -** XML_PENDING: parsing not completed -** XML_END_LIST: found /vCard-listing but no final flag detected -** XML_VLIST_OUT_FULL: reached max_entry -> do not call parser anymore!!! dump data -** XML_VLIST_DST_NO_RES : run out of dst buffer resource while -** some xml data still remains. - -**************************************************************************************/ -BT_API extern tXML_VLIST_RES XML_VlistParse( tXML_VLIST_PARSER *p_xml_state, - UINT8 *xml_data, UINT16 xml_len, - UINT8 *dst_data, UINT16 *dst_len, - UINT16 *num_entries ); - - -#endif |