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 /bta/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 'bta/include')
-rw-r--r-- | bta/include/bta_dg_api.h | 198 | ||||
-rw-r--r-- | bta/include/bta_dg_ci.h | 107 | ||||
-rw-r--r-- | bta/include/bta_dg_co.h | 198 | ||||
-rw-r--r-- | bta/include/bta_ft_api.h | 724 | ||||
-rw-r--r-- | bta/include/bta_hd_api.h | 289 | ||||
-rw-r--r-- | bta/include/bta_ma_api.h | 691 | ||||
-rw-r--r-- | bta/include/bta_ma_co.h | 91 | ||||
-rw-r--r-- | bta/include/bta_ma_def.h | 479 | ||||
-rw-r--r-- | bta/include/bta_mse_api.h | 470 | ||||
-rw-r--r-- | bta/include/bta_mse_ci.h | 146 | ||||
-rw-r--r-- | bta/include/bta_mse_co.h | 330 | ||||
-rw-r--r-- | bta/include/bta_op_api.h | 567 | ||||
-rw-r--r-- | bta/include/bta_pbs_api.h | 262 | ||||
-rw-r--r-- | bta/include/bta_pbs_ci.h | 93 | ||||
-rw-r--r-- | bta/include/bta_pbs_co.h | 160 | ||||
-rw-r--r-- | bta/include/bta_prm_api.h | 57 | ||||
-rw-r--r-- | bta/include/bta_sc_api.h | 193 | ||||
-rw-r--r-- | bta/include/bta_sc_ci.h | 111 | ||||
-rw-r--r-- | bta/include/bta_sc_co.h | 153 |
19 files changed, 0 insertions, 5319 deletions
diff --git a/bta/include/bta_dg_api.h b/bta/include/bta_dg_api.h deleted file mode 100644 index 3e8b2db..0000000 --- a/bta/include/bta_dg_api.h +++ /dev/null @@ -1,198 +0,0 @@ -/***************************************************************************** -** -** Name: bta_dg_api.h -** -** Description: This is the public interface file for the data gateway -** (DG) subsystem of BTA, Widcomm's Bluetooth application -** layer for mobile phones. -** -** Copyright (c) 2003, Widcomm Inc., All Rights Reserved. -** Widcomm Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_DG_API_H -#define BTA_DG_API_H - -#include "bta_api.h" - -/***************************************************************************** -** Constants and data types -*****************************************************************************/ - -/* DG Callback events */ -#define BTA_DG_ENABLE_EVT 0 /* DG service is enabled. */ -#define BTA_DG_LISTEN_EVT 1 /* Server listen is started. */ -#define BTA_DG_OPENING_EVT 2 /* Client connection opening. */ -#define BTA_DG_OPEN_EVT 3 /* Connection has been opened. */ -#define BTA_DG_CLOSE_EVT 4 /* Connection has been closed. */ - -typedef UINT8 tBTA_DG_EVT; - -/* Event associated with BTA_DG_LISTEN_EVT */ -typedef struct -{ - UINT16 handle; /* Handle associated with this server. */ - UINT8 app_id; /* ID associated with call to BTA_DgListen(). */ -} tBTA_DG_LISTEN; - -/* Event associated with BTA_DG_OPENING_EVT */ -typedef struct -{ - UINT16 handle; /* Handle associated with this server. */ - UINT8 app_id; /* ID associated with call to BTA_DgListen(). */ -} tBTA_DG_OPENING; - - -/* Event associated with BTA_DG_OPEN_EVT */ -typedef struct -{ - BD_ADDR bd_addr; /* BD address of peer device. */ - UINT16 handle; /* Handle associated with this server. */ - tBTA_SERVICE_ID service; /* Service ID of opened service. */ - UINT8 app_id; /* ID associated with call to BTA_DgListen(). */ -} tBTA_DG_OPEN; - -/* Event associated with BTA_DG_CLOSE_EVT */ -typedef struct -{ - UINT16 handle; /* Handle associated with this server. */ - UINT8 app_id; /* ID associated with call to BTA_DgListen(). */ -} tBTA_DG_CLOSE; - -/* Union of all DG callback structures */ -typedef union -{ - tBTA_DG_LISTEN listen; /* Server listen is started. */ - tBTA_DG_OPENING opening; /* Client connection opening. */ - tBTA_DG_OPEN open; /* Connection has been opened. */ - tBTA_DG_CLOSE close; /* Connection has been closed. */ -} tBTA_DG; - -/* DG callback */ -typedef void (tBTA_DG_CBACK)(tBTA_DG_EVT event, tBTA_DG *p_data); - -/* configuration structure */ -typedef struct -{ - UINT16 mtu[4]; /* MTU for SPP, DUN, FAX, LAP */ - -} tBTA_DG_CFG; - -/* Number of DG servers */ -#ifndef BTA_DG_NUM_CONN -#define BTA_DG_NUM_CONN 5 -#endif - -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - -/******************************************************************************* -** -** Function BTA_DgEnable -** -** Description Enable the data gateway service. This function must be -** called before any other functions in the DG API are called. -** When the enable operation is complete the callback function -** will be called with a BTA_DG_ENABLE_EVT. After the DG -** service is enabled a server can be started by calling -** BTA_DgListen(). -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_DgEnable(tBTA_DG_CBACK *p_cback); - -/******************************************************************************* -** -** Function BTA_DgDisable -** -** Description Disable the data gateway service. Before calling this -** function all DG servers must be shut down by calling -** BTA_DgShutdown(). -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_DgDisable(void); - -/******************************************************************************* -** -** Function BTA_DgListen -** -** Description Create a DG server for DUN, FAX or SPP. After creating a -** server peer devices can open an RFCOMM connection to the -** server. When the listen operation has started the callback -** function will be called with a BTA_DG_LISTEN_EVT providing -** the handle associated with this server. The handle -** identifies server when calling other DG functions such as -** BTA_DgClose() or BTA_DgShutdown(). -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_DgListen(tBTA_SERVICE_ID service, tBTA_SEC sec_mask, - char *p_service_name, UINT8 app_id); - -/******************************************************************************* -** -** Function BTA_DgOpen -** -** Description Open a DG client connection to a peer device. BTA first -** searches for the requested service on the peer device. If -** the service name is specified it will also match the -** service name. Then BTA initiates an RFCOMM connection to -** the peer device. The handle associated with the connection -** is returned with the BTA_DG_OPEN_EVT. If the connection -** fails or closes at any time the callback function will be -** called with a BTA_DG_CLOSE_EVT. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_DgOpen(BD_ADDR bd_addr, tBTA_SERVICE_ID service, - tBTA_SEC sec_mask, char *p_service_name, UINT8 app_id); - -/******************************************************************************* -** -** Function BTA_DgClose -** -** Description Close a DG connection to a peer device. BTA will -** close the RFCOMM connection to the peer device. Servers -** will still be listening for subsequent connections. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_DgClose(UINT16 handle); - -/******************************************************************************* -** -** Function BTA_DgShutdown -** -** Description Shutdown a DG server previously started by calling -** BTA_DgListen(). The server will no longer be available -** to peer devices. If there is currently a connection open -** to the server it will be closed. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_DgShutdown(UINT16 handle); - -#ifdef __cplusplus -} -#endif - -#endif /* BTA_DG_API_H */ - diff --git a/bta/include/bta_dg_ci.h b/bta/include/bta_dg_ci.h deleted file mode 100644 index 1f52ab2..0000000 --- a/bta/include/bta_dg_ci.h +++ /dev/null @@ -1,107 +0,0 @@ -/***************************************************************************** -** -** Name: bta_dg_ci.h -** -** Description: This is the interface file for data gateway call-in -** functions. -** -** Copyright (c) 2003, Widcomm Inc., All Rights Reserved. -** Widcomm Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_DG_CI_H -#define BTA_DG_CI_H - -#include "bta_dg_api.h" - -/***************************************************************************** -** Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - -/******************************************************************************* -** -** Function bta_dg_ci_tx_ready -** -** Description This function sends an event to DG indicating the phone is -** ready for more data and DG should call bta_dg_co_tx_path(). -** This function is used when the TX data path is configured -** to use a pull interface. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_ci_tx_ready(UINT16 handle); - -/******************************************************************************* -** -** Function bta_dg_ci_rx_ready -** -** Description This function sends an event to DG indicating the phone -** has data available to send to DG and DG should call -** bta_dg_co_rx_path(). This function is used when the RX -** data path is configured to use a pull interface. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_ci_rx_ready(UINT16 handle); - -/******************************************************************************* -** -** Function bta_dg_ci_tx_flow -** -** Description This function is called to enable or disable data flow on -** the TX path. The phone should call this function to -** disable data flow when it is congested and cannot handle -** any more data sent by bta_dg_co_tx_write() or -** bta_dg_co_tx_writebuf(). This function is used when the -** TX data path is configured to use a push interface. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_ci_tx_flow(UINT16 handle, BOOLEAN enable); - -/******************************************************************************* -** -** Function bta_dg_ci_rx_writebuf -** -** Description This function is called to send data to the phone when -** the RX path is configured to use a push interface with -** zero copy. The function sends an event to DG containing -** the data buffer. The buffer must be allocated using -** functions GKI_getbuf() or GKI_getpoolbuf(). The buffer -** will be freed by BTA; the phone must not free the buffer. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_ci_rx_writebuf(UINT16 handle, BT_HDR *p_buf); - -/******************************************************************************* -** -** Function bta_dg_ci_control -** -** Description This function is called to send RS-232 signal information -** to DG to be propagated over RFCOMM. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_ci_control(UINT16 handle, UINT8 signals, UINT8 values); - -#ifdef __cplusplus -} -#endif - -#endif /* BTA_DG_CI_H */ - diff --git a/bta/include/bta_dg_co.h b/bta/include/bta_dg_co.h deleted file mode 100644 index 667a01c..0000000 --- a/bta/include/bta_dg_co.h +++ /dev/null @@ -1,198 +0,0 @@ -/***************************************************************************** -** -** Name: bta_dg_co.h -** -** Description: This is the interface file for data gateway call-out -** functions. -** -** Copyright (c) 2003, Widcomm Inc., All Rights Reserved. -** Widcomm Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_DG_CO_H -#define BTA_DG_CO_H - -#include "bta_dg_api.h" -#include "l2c_api.h" -#include "rfcdefs.h" - -/***************************************************************************** -** Constants -*****************************************************************************/ - -/* RS-232 Signal Mask */ -#define BTA_DG_DTRDSR 0x01 /* DTR/DSR signal. */ -#define BTA_DG_RTSCTS 0x02 /* RTS/CTS signal. */ -#define BTA_DG_RI 0x04 /* Ring indicator signal. */ -#define BTA_DG_CD 0x08 /* Carrier detect signal. */ - -/* RS-232 Signal Values */ -#define BTA_DG_DTRDSR_ON 0x01 /* DTR/DSR signal on. */ -#define BTA_DG_DTRDSR_OFF 0x00 /* DTR/DSR signal off. */ -#define BTA_DG_RTSCTS_ON 0x02 /* RTS/CTS signal on. */ -#define BTA_DG_RTSCTS_OFF 0x00 /* RTS/CTS signal off. */ -#define BTA_DG_RI_ON 0x04 /* Ring indicator signal on. */ -#define BTA_DG_RI_OFF 0x00 /* Ring indicator signal off. */ -#define BTA_DG_CD_ON 0x08 /* Carrier detect signal on. */ -#define BTA_DG_CD_OFF 0x00 /* Carrier detect signal off. */ - -/* Data Flow Mask */ -#define BTA_DG_RX_PUSH_BUF 0x01 /* RX push with zero copy. */ -#define BTA_DG_RX_PULL 0x02 /* RX pull. */ -#define BTA_DG_TX_PUSH 0x00 /* TX push. */ -#define BTA_DG_TX_PUSH_BUF 0x10 /* TX push with zero copy. */ -#define BTA_DG_TX_PULL 0x20 /* TX pull. */ - -/* BT_HDR buffer offset */ -#define BTA_DG_MIN_OFFSET (L2CAP_MIN_OFFSET + RFCOMM_MIN_OFFSET) - -/***************************************************************************** -** Function Declarations -*****************************************************************************/ - -/******************************************************************************* -** -** Function bta_dg_co_init -** -** Description This callout function is executed by DG when a server is -** started by calling BTA_DgListen(). This function can be -** used by the phone to initialize data paths or for other -** initialization purposes. The function must return the -** data flow mask as described below. -** -** -** Returns Data flow mask. -** -*******************************************************************************/ -BTA_API extern UINT8 bta_dg_co_init(UINT16 handle, UINT8 app_id); - -/******************************************************************************* -** -** Function bta_dg_co_open -** -** Description This function is executed by DG when a connection to a -** server is opened. The phone can use this function to set -** up data paths or perform any required initialization or -** set up particular to the connected service. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_co_open(UINT16 handle, UINT8 app_id, tBTA_SERVICE_ID service, UINT16 mtu); - -/******************************************************************************* -** -** Function bta_dg_co_close -** -** Description This function is called by DG when a connection to a -** server is closed. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_co_close(UINT16 handle, UINT8 app_id); - -/******************************************************************************* -** -** Function bta_dg_co_tx_path -** -** Description This function is called by DG to transfer data on the -** TX path; that is, data being sent from BTA to the phone. -** This function is used when the TX data path is configured -** to use the pull interface. The implementation of this -** function will typically call Bluetooth stack functions -** PORT_Read() or PORT_ReadData() to read data from RFCOMM -** and then a platform-specific function to send data that -** data to the phone. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_co_tx_path(UINT16 handle, UINT8 app_id); - -/******************************************************************************* -** -** Function bta_dg_co_rx_path -** -** Description This function is called by DG to transfer data on the -** RX path; that is, data being sent from the phone to BTA. -** This function is used when the RX data path is configured -** to use the pull interface. The implementation of this -** function will typically call a platform-specific function -** to read data from the phone and then call Bluetooth stack -** functions PORT_Write() or PORT_WriteData() to send data -** to RFCOMM. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_co_rx_path(UINT16 handle, UINT8 app_id, UINT16 mtu); - -/******************************************************************************* -** -** Function bta_dg_co_tx_write -** -** Description This function is called by DG to send data to the phone -** when the TX path is configured to use a push interface. -** The implementation of this function must copy the data to -** the phone's memory. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_co_tx_write(UINT16 handle, UINT8 app_id, UINT8 *p_data, UINT16 len); - -/******************************************************************************* -** -** Function bta_dg_co_tx_writebuf -** -** Description This function is called by DG to send data to the phone -** when the TX path is configured to use a push interface with -** zero copy. The phone must free the buffer using function -** GKI_freebuf() when it is through processing the buffer. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_co_tx_writebuf(UINT16 handle, UINT8 app_id, BT_HDR *p_buf); - -/******************************************************************************* -** -** Function bta_dg_co_rx_flow -** -** Description This function is called by DG to enable or disable -** data flow on the RX path when it is configured to use -** a push interface. If data flow is disabled the phone must -** not call bta_dg_ci_rx_write() or bta_dg_ci_rx_writebuf() -** until data flow is enabled again. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_co_rx_flow(UINT16 handle, UINT8 app_id, BOOLEAN enable); - -/******************************************************************************* -** -** Function bta_dg_co_control -** -** Description This function is called by DG to send RS-232 signal -** information to the phone. This function allows these -** signals to be propagated from the RFCOMM channel to the -** phone. If the phone does not use these signals the -** implementation of this function can do nothing. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_dg_co_control(UINT16 handle, UINT8 app_id, UINT8 signals, UINT8 values); - -#endif /* BTA_DG_CO_H */ - diff --git a/bta/include/bta_ft_api.h b/bta/include/bta_ft_api.h deleted file mode 100644 index 96ed66f..0000000 --- a/bta/include/bta_ft_api.h +++ /dev/null @@ -1,724 +0,0 @@ -/***************************************************************************** -** -** Name: bta_ft_api.h -** -** Description: This is the public interface file for the file transfer -** (FT) server subsystem of BTA, Widcomm's -** Bluetooth application layer for mobile phones. -** -** Copyright (c) 2003-2009, Broadcom Corp., All Rights Reserved. -** Widcomm Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_FT_API_H -#define BTA_FT_API_H - -#include "bta_api.h" -#include "btm_api.h" -#if( defined BIP_INCLUDED) && (BIP_INCLUDED == TRUE) -#include "bip_api.h" -#endif -#include "bta_sys.h" -#include "bta_fs_co.h" - -/***************************************************************************** -** Constants and data types -*****************************************************************************/ -#define BTA_FT_ENHANCED_VERSION 0x0102 - -/************************** -** Common Definitions -***************************/ -/* Access response types */ -#define BTA_FT_ACCESS_ALLOW 0 /* Allow the requested operation */ -#define BTA_FT_ACCESS_FORBID 1 /* Disallow the requested operation */ - -typedef UINT8 tBTA_FT_ACCESS; - -/* Access event operation types */ -#define BTA_FT_OPER_DEFAULT 0 /* Default mode */ -#define BTA_FT_OPER_PUT 1 /* Request is a PUT file */ -#define BTA_FT_OPER_GET 2 /* Request is a GET file */ -#define BTA_FT_OPER_DEL_FILE 3 /* Request is a DELETE file */ -#define BTA_FT_OPER_DEL_DIR 4 /* Request is a DELETE folder */ -#define BTA_FT_OPER_CHG_DIR 5 /* Request is a Change Folder */ -#define BTA_FT_OPER_MK_DIR 6 /* Request is a Make Folder */ -#define BTA_FT_OPER_COPY_ACT 7 /* Request is a Copy Action command */ -#define BTA_FT_OPER_MOVE_ACT 8 /* Request is a Move Action command */ -#define BTA_FT_OPER_SET_PERM 9 /* Request is a SetPermission Action command */ - -typedef UINT8 tBTA_FT_OPER; - -#define BTA_FT_ACT_COPY OBX_ACT_COPY /* 0x00 Copy object */ -#define BTA_FT_ACT_MOVE OBX_ACT_MOVE /* 0x01 Move/rename object */ -#define BTA_FT_ACT_PERMISSION OBX_ACT_PERMISSION /* 0x02 Set object permission */ -typedef tOBX_ACTION tBTA_FTC_ACT; - -#define BTA_FTC_RESUME_NONCE 0xFFFFFFFF - -/* permission flags */ -#define BTA_FT_PERMISSION_READ OBX_PERMISSION_READ /* 0x01 */ -#define BTA_FT_PERMISSION_WRITE OBX_PERMISSION_WRITE /* 0x02 */ -#define BTA_FT_PERMISSION_DELETE OBX_PERMISSION_DELETE /* 0x04 */ -#define BTA_FT_PERMISSION_MODIFY OBX_PERMISSION_MODIFY /* 0x80 */ - -/************************** -** Server Definitions -***************************/ -/* Extra Debug Code */ -#ifndef BTA_FTS_DEBUG -#define BTA_FTS_DEBUG FALSE -#endif - -#define BTA_FTS_OK 0 -#define BTA_FTS_FAIL 1 -typedef UINT8 tBTA_FTS_STATUS; - -/* Server callback function events */ -#define BTA_FTS_ENABLE_EVT 0 /* File transfer server is enabled. */ -#define BTA_FTS_OPEN_EVT 1 /* Connection to peer is open. */ -#define BTA_FTS_CLOSE_EVT 2 /* Connection to peer closed. */ -#define BTA_FTS_AUTH_EVT 3 /* Request for Authentication key and realm */ -#define BTA_FTS_ACCESS_EVT 4 /* Request for access to put a file */ -#define BTA_FTS_PROGRESS_EVT 5 /* Number of bytes read or written so far */ -#define BTA_FTS_PUT_CMPL_EVT 6 /* File Put complete */ -#define BTA_FTS_GET_CMPL_EVT 7 /* File Get complete */ -#define BTA_FTS_DEL_CMPL_EVT 8 /* Remove File or Folder complete */ -#define BTA_FTS_DISABLE_EVT 9 /* Reply to a disable api request */ - -typedef UINT8 tBTA_FTS_EVT; - -/* Structure associated with BTA_FTS_xxx_CMPL_EVT */ -typedef struct -{ - char *p_name; /* file or folder name. */ - tBTA_FTS_STATUS status; -} tBTA_FTS_OBJECT; - -typedef struct -{ - UINT32 file_size; /* Total size of file (BTA_FS_LEN_UNKNOWN if unknown) */ - UINT16 bytes; /* Number of bytes read or written since last progress event */ -} tBTA_FTS_PROGRESS; - -typedef struct -{ - - UINT8 *p_userid; - UINT8 userid_len; - BOOLEAN userid_required; /* TRUE if user ID is required in response (rechallanged) */ -} tBTA_FTS_AUTH; - -typedef struct -{ - char *p_name; /* file name with fully qualified path */ - UINT32 size; /* file size */ - tBTM_BD_NAME dev_name; /* Name of device, "" if unknown */ - tBTA_FT_OPER oper; /* operation (put) */ - BD_ADDR bd_addr; /* Address of device */ - char *p_dest_name; /* destination file name with fully qualified path (BTA_FT_OPER_COPY_ACT & BTA_FT_OPER_MOVE_ACT) */ - UINT8 perms[BTA_FS_PERM_SIZE]; /* user/group/other permission (BTA_FT_OPER_SET_PERM) */ -} tBTA_FTS_ACCESS; - -typedef union -{ - tBTA_FTS_STATUS status; - tBTA_FTS_PROGRESS prog; - tBTA_FTS_AUTH auth; - tBTA_FTS_ACCESS access; - tBTA_FTS_OBJECT obj; - BD_ADDR bd_addr; -} tBTA_FTS; - -/* Server callback function */ -typedef void tBTA_FTS_CBACK(tBTA_FTS_EVT event, tBTA_FTS *p_data); - - -/************************** -** Client Definitions -***************************/ -/* Extra Debug Code */ -#ifndef BTA_FTC_DEBUG -#define BTA_FTC_DEBUG FALSE -#endif - -/* Additional paramters for BTA_FtcPutFile using BIP service */ -typedef union -{ -#if( defined BTA_BI_INCLUDED ) && (BTA_BI_INCLUDED == TRUE) - tBIP_IMAGE_DESC desc; /* when connectied with BIP service */ -#else - void* desc; -#endif -} tBTA_FTC_PARAM; - -/* Client callback function events */ -#define BTA_FTC_ENABLE_EVT 0 /* File transfer client is enabled. */ -#define BTA_FTC_OPEN_EVT 1 /* Connection to peer is open. */ -#define BTA_FTC_CLOSE_EVT 2 /* Connection to peer closed. */ -#define BTA_FTC_AUTH_EVT 3 /* Request for Authentication key and user id */ -#define BTA_FTC_LIST_EVT 4 /* Event contains a directory entry (tBTA_FTC_LIST) */ -#define BTA_FTC_PROGRESS_EVT 5 /* Number of bytes read or written so far */ -#define BTA_FTC_PUTFILE_EVT 6 /* File Put complete */ -#define BTA_FTC_GETFILE_EVT 7 /* File Get complete */ -#define BTA_FTC_BI_CAPS_EVT 8 /* BIP imaging capabilities */ -#define BTA_FTC_THUMBNAIL_EVT 9 /* BIP responder requests for the thumbnail version */ -#define BTA_FTC_CHDIR_EVT 10 /* Change Directory complete */ -#define BTA_FTC_MKDIR_EVT 11 /* Make Directory complete */ -#define BTA_FTC_REMOVE_EVT 12 /* Remove File/Directory complete */ -#define BTA_FTC_PHONEBOOK_EVT 13 /* Report the Application Parameters for BTA_FtcGetPhoneBook response */ -#define BTA_FTC_COPY_EVT 14 /* Copy File complete */ -#define BTA_FTC_MOVE_EVT 15 /* Move File complete */ -#define BTA_FTC_PERMISSION_EVT 16 /* Set File permission complete */ - - -typedef UINT8 tBTA_FTC_EVT; - - -#define BTA_FTC_OK 0 -#define BTA_FTC_FAIL 1 -#define BTA_FTC_NO_PERMISSION 2 -#define BTA_FTC_NOT_FOUND 3 -#define BTA_FTC_FULL 4 -#define BTA_FTC_BUSY 5 -#define BTA_FTC_ABORTED 6 -#define BTA_FTC_SERVICE_UNAVL 7 -#define BTA_FTC_SDP_ERR 8 -#define BTA_FTC_OBX_ERR 9 -#define BTA_FTC_OBX_TOUT 10 - -typedef UINT8 tBTA_FTC_STATUS; - -#define BTA_FTC_FLAG_NONE 0 -#define BTA_FTC_FLAG_BACKUP 1 - -typedef UINT8 tBTA_FTC_FLAG; - -typedef struct -{ - tBTA_SERVICE_ID service; /* Connection is open with OPP, BIP, PBAP or FTP service */ - UINT16 version; -} tBTA_FTC_OPEN; - -#define BTA_FTC_FILTER_VERSION (1<<0) /* Version */ -#define BTA_FTC_FILTER_FN (1<<1) /* Formatted Name */ -#define BTA_FTC_FILTER_N (1<<2) /* Structured Presentation of Name */ -#define BTA_FTC_FILTER_PHOTO (1<<3) /* Associated Image or Photo */ -#define BTA_FTC_FILTER_BDAY (1<<4) /* Birthday */ -#define BTA_FTC_FILTER_ADR (1<<5) /* Delivery Address */ -#define BTA_FTC_FILTER_LABEL (1<<6) /* Delivery */ -#define BTA_FTC_FILTER_TEL (1<<7) /* Telephone Number */ -#define BTA_FTC_FILTER_EMAIL (1<<8) /* Electronic Mail Address */ -#define BTA_FTC_FILTER_MAILER (1<<9) /* Electronic Mail */ -#define BTA_FTC_FILTER_TZ (1<<10) /* Time Zone */ -#define BTA_FTC_FILTER_GEO (1<<11) /* Geographic Position */ -#define BTA_FTC_FILTER_TITLE (1<<12) /* Job */ -#define BTA_FTC_FILTER_ROLE (1<<13) /* Role within the Organization */ -#define BTA_FTC_FILTER_LOGO (1<<14) /* Organization Logo */ -#define BTA_FTC_FILTER_AGENT (1<<15) /* vCard of Person Representing */ -#define BTA_FTC_FILTER_ORG (1<<16) /* Name of Organization */ -#define BTA_FTC_FILTER_NOTE (1<<17) /* Comments */ -#define BTA_FTC_FILTER_REV (1<<18) /* Revision */ -#define BTA_FTC_FILTER_SOUND (1<<19) /* Pronunciation of Name */ -#define BTA_FTC_FILTER_URL (1<<20) /* Uniform Resource Locator */ -#define BTA_FTC_FILTER_UID (1<<21) /* Unique ID */ -#define BTA_FTC_FILTER_KEY (1<<22) /* Public Encryption Key */ -#define BTA_FTC_FILTER_ALL (0) -typedef UINT32 tBTA_FTC_FILTER_MASK; - -enum -{ - BTA_FTC_FORMAT_CARD_21, /* vCard format 2.1 */ - BTA_FTC_FORMAT_CARD_30, /* vCard format 3.0 */ - BTA_FTC_FORMAT_MAX -}; -typedef UINT8 tBTA_FTC_FORMAT; - -typedef struct -{ - UINT16 phone_book_size; - BOOLEAN pbs_exist; /* phone_book_size is present in the response */ - UINT8 new_missed_calls; - BOOLEAN nmc_exist; /* new_missed_calls is present in the response */ -} tBTA_FTC_PB_PARAM; - -typedef struct -{ - tBTA_FTC_PB_PARAM *p_param; - UINT8 *data; - UINT16 len; - BOOLEAN final; /* If TRUE, entry is last of the series */ - tBTA_FTC_STATUS status; /* Fields are valid when status is BTA_FTC_OK */ -} tBTA_FTC_LIST; - -enum -{ - BTA_FTC_ORDER_INDEXED = 0, /* indexed */ - BTA_FTC_ORDER_ALPHANUM, /* alphanumeric */ - BTA_FTC_ORDER_PHONETIC, /* phonetic */ - BTA_FTC_ORDER_MAX -}; -typedef UINT8 tBTA_FTC_ORDER; -enum -{ - BTA_FTC_ATTR_NAME = 0, /* name */ - BTA_FTC_ATTR_NUMBER, /* number */ - BTA_FTC_ATTR_SOUND, /* sound */ - BTA_FTC_ATTR_MAX -}; -typedef UINT8 tBTA_FTC_ATTR; - -typedef struct -{ - UINT32 file_size; /* Total size of file (BTA_FS_LEN_UNKNOWN if unknown) */ - UINT16 bytes; /* Number of bytes read or written since last progress event */ -} tBTA_FTC_PROGRESS; - -typedef struct -{ - UINT8 *p_realm; - UINT8 realm_len; - UINT8 realm_charset; - BOOLEAN userid_required; /* If TRUE, a user ID must be sent */ -} tBTA_FTC_AUTH; - -#if( defined BTA_BI_INCLUDED ) && (BTA_BI_INCLUDED == TRUE) -typedef struct -{ - tBIP_IMAGING_CAPS *p_bi_caps; /* BIP imaging capabilities */ -} tBTA_FTC_CAPS; - -typedef struct -{ - UINT8 *p_name; /* the image file name */ - tBIP_IMG_HDL_STR handle; /* The image’s handle assigned by BIP responder. */ -} tBTA_FTC_THUMB; -#endif - -typedef union -{ - tBTA_FTC_STATUS status; - tBTA_FTC_OPEN open; - tBTA_FTC_LIST list; - tBTA_FTC_PROGRESS prog; - tBTA_FTC_AUTH auth; -#if( defined BTA_BI_INCLUDED ) && (BTA_BI_INCLUDED == TRUE) - tBTA_FTC_CAPS bi_caps; - tBTA_FTC_THUMB thumb; -#endif - tBTA_FTC_PB_PARAM pb; -} tBTA_FTC; - -/* Client callback function */ -typedef void tBTA_FTC_CBACK(tBTA_FTC_EVT event, tBTA_FTC *p_data); - -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - -/************************** -** Server Functions -***************************/ - -/******************************************************************************* -** -** Function BTA_FtsEnable -** -** Description Enable the file transfer server. This function must be -** called before any other functions in the FTS API are called. -** When the enable operation is complete the callback function -** will be called with an BTA_FTS_ENABLE_EVT event. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtsEnable(tBTA_SEC sec_mask, const char *p_service_name, - const char *p_root_path, BOOLEAN enable_authen, - UINT8 realm_len, UINT8 *p_realm, - tBTA_FTS_CBACK *p_cback, UINT8 app_id); - -/******************************************************************************* -** -** Function BTA_FtsDisable -** -** Description Disable the file transfer server. If the server is currently -** connected to a peer device the connection will be closed. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtsDisable(void); - -/******************************************************************************* -** -** Function BTA_FtsClose -** -** Description Close the current connection. This function is called if -** the phone wishes to close the connection before the FT -** client disconnects. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtsClose(void); - -/******************************************************************************* -** -** Function BTA_FtsUnauthRsp -** -** Description Sends an OBEX authentication challenge to the connected -** OBEX client. Called in response to an BTA_FTS_AUTH_EVT event. -** Used when "enable_authen" is set to TRUE in BTA_FtsEnable(). -** -** Note: If the "userid_required" is TRUE in the BTA_FTS_AUTH_EVT -** event, then p_userid is required, otherwise it is optional. -** -** p_password must be less than BTA_FTS_MAX_AUTH_KEY_SIZE (16 bytes) -** p_userid must be less than OBX_MAX_REALM_LEN (defined in target.h) -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtsAuthRsp (char *p_password, char *p_userid); - -/******************************************************************************* -** -** Function BTA_FtsAccessRsp -** -** Description Sends a reply to an access request event (BTA_FTS_ACCESS_EVT). -** This call MUST be made whenever the event occurs. -** -** Parameters oper - operation being accessed. -** access - BTA_FT_ACCESS_ALLOW or BTA_FT_ACCESS_FORBID -** p_name - Full path of file to pulled or pushed. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtsAccessRsp(tBTA_FT_OPER oper, tBTA_FT_ACCESS access, - char *p_name); - - -/************************** -** Client Functions -***************************/ - -/******************************************************************************* -** -** Function BTA_FtcEnable -** -** Description Enable the file transfer client. This function must be -** called before any other functions in the FTC API are called. -** When the enable operation is complete the callback function -** will be called with an BTA_FTC_ENABLE_EVT event. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcEnable(tBTA_FTC_CBACK *p_cback, UINT8 app_id); - -/******************************************************************************* -** -** Function BTA_FtcDisable -** -** Description Disable the file transfer client. If the client is currently -** connected to a peer device the connection will be closed. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcDisable(void); - -/******************************************************************************* -** -** Function BTA_FtcOpen -** -** Description Open a connection to an FTP, PBAP, OPP or BIP server. -** If parameter services is set to use both all services, -** the client will attempt to connect to the device using -** FTP first and then PBAP, OPP, BIP. -** When the connection is open the callback function -** will be called with a BTA_FTC_OPEN_EVT. If the connection -** fails or otherwise is closed the callback function will be -** called with a BTA_FTC_CLOSE_EVT. -** -** If the connection is opened with FTP profile and -** bta_ft_cfg.auto_file_list is TRUE , the callback -** function will be called with one or more BTA_FTC_LIST_EVT -** containing directory list information formatted in XML as -** described in the IrOBEX Spec, Version 1.2, section 9.1.2.3. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcOpen(BD_ADDR bd_addr, tBTA_SEC sec_mask, - tBTA_SERVICE_MASK services, BOOLEAN srm, UINT32 nonce); - -/******************************************************************************* -** -** Function BTA_FtcSuspend -** -** Description Suspend the current connection to the server. -** This is allowed only for the sessions created by -** BTA_FtcConnect with nonce!=0 -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcSuspend(void); - -/******************************************************************************* -** -** Function BTA_FtcClose -** -** Description Close the current connection to the server. Aborts any -** active file transfer. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcClose(void); - -/******************************************************************************* -** -** Function BTA_FtcCopyFile -** -** Description Invoke a Copy action on the server. -** Create a copy of p_src and name it as p_dest -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcCopyFile(const char *p_src, const char *p_dest); - -/******************************************************************************* -** -** Function BTA_FtcMoveFile -** -** Description Invoke a Move action on the server. -** Move/rename p_src to p_dest -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcMoveFile(const char *p_src, const char *p_dest); - -/******************************************************************************* -** -** Function BTA_FtcSetPermission -** -** Description Invoke a SetPermission action on the server. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcSetPermission(const char *p_src, UINT8 user, UINT8 group, UINT8 other); - -/******************************************************************************* -** -** Function BTA_FtcPutFile -** -** Description Send a file to the connected server. -** -** This function can only be used when the client is connected -** in FTP, OPP and BIP mode. -** -** Note: File name is specified with a fully qualified path. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcPutFile(const char *p_name, tBTA_FTC_PARAM *p_param); - -/******************************************************************************* -** -** Function BTA_FtcGetPhoneBook -** -** Description Retrieve a PhoneBook from the peer device and copy it to the -** local file system. -** -** This function can only be used when the client is connected -** in PBAP mode. -** -** Note: local file name is specified with a fully qualified path. -** Remote file name is absolute path in UTF-8 format -** (telecom/pb.vcf or SIM1/telecom/pb.vcf). -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcGetPhoneBook(char *p_local_name, char *p_remote_name, - tBTA_FTC_FILTER_MASK filter, tBTA_FTC_FORMAT format, - UINT16 max_list_count, UINT16 list_start_offset); - -/******************************************************************************* -** -** Function BTA_FtcGetCard -** -** Description Retrieve a vCard from the peer device and copy it to the -** local file system. -** -** This function can only be used when the client is connected -** in PBAP mode. -** -** Note: local file name is specified with a fully qualified path. -** Remote file name is relative path in UTF-8 format. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcGetCard(char *p_local_name, char *p_remote_name, - tBTA_FTC_FILTER_MASK filter, tBTA_FTC_FORMAT format); - -/******************************************************************************* -** -** Function BTA_FtcGetFile -** -** Description Retrieve a file from the peer device and copy it to the -** local file system. -** -** This function can only be used when the client is connected -** in FTP mode. -** -** Note: local file name is specified with a fully qualified path. -** Remote file name is specified in UTF-8 format. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcGetFile(char *p_local_name, char *p_remote_name); - -/******************************************************************************* -** -** Function BTA_FtcChDir -** -** Description Change directory on the peer device. -** -** This function can only be used when the client is connected -** in FTP and PBAP mode. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcChDir(char *p_dir, tBTA_FTC_FLAG flag); - -/******************************************************************************* -** -** Function BTA_FtcAuthRsp -** -** Description Sends a response to an OBEX authentication challenge to the -** connected OBEX server. Called in response to an BTA_FTC_AUTH_EVT -** event. -** -** Note: If the "userid_required" is TRUE in the BTA_FTC_AUTH_EVT event, -** then p_userid is required, otherwise it is optional. -** -** p_password must be less than BTA_FTC_MAX_AUTH_KEY_SIZE (16 bytes) -** p_userid must be less than OBX_MAX_REALM_LEN (defined in target.h) -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcAuthRsp (char *p_password, char *p_userid); - -/******************************************************************************* -** -** Function BTA_FtcListCards -** -** Description Retrieve a directory listing from the peer device. -** When the operation is complete the callback function will -** be called with one or more BTA_FTC_LIST_EVT events -** containing directory list information formatted as described -** in the PBAP Spec, Version 0.9, section 3.1.6. -** This function can only be used when the client is connected -** to a peer device. -** -** This function can only be used when the client is connected -** in PBAP mode. -** -** Parameters p_dir - Name of directory to retrieve listing of. -** -** Returns void -** -*******************************************************************************/ - -BTA_API extern void BTA_FtcListCards(char *p_dir, tBTA_FTC_ORDER order, char *p_value, - tBTA_FTC_ATTR attribute, UINT16 max_list_count, - UINT16 list_start_offset); - -/******************************************************************************* -** -** Function BTA_FtcListDir -** -** Description Retrieve a directory listing from the peer device. -** When the operation is complete the callback function will -** be called with one or more BTA_FTC_LIST_EVT events -** containing directory list information formatted as described -** in the IrOBEX Spec, Version 1.2, section 9.1.2.3. -** -** This function can only be used when the client is connected -** in FTP mode. -** -** Parameters p_dir - Name of directory to retrieve listing of. If NULL, -** the current working directory is retrieved. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcListDir(char *p_dir); - -/******************************************************************************* -** -** Function BTA_FtcAbort -** -** Description Aborts any active Put or Get file operation. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcAbort(void); - -/******************************************************************************* -** -** Function BTA_FtcRemove -** -** Description Remove a file or directory on the peer device. When the -** operation is complete the status is returned with the -** BTA_FTC_REMOVE_EVT event. -** -** This function can only be used when the client is connected -** in FTP mode. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcRemove(char *p_name); - -/******************************************************************************* -** -** Function BTA_FtcMkDir -** -** Description Create a directory on the peer device. When the operation is -** complete the status is returned with the BTA_FTC_MKDIR_EVT -** event. -** -** This function can only be used when the client is connected -** in FTP mode. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_FtcMkDir(char *p_dir); - -#ifdef __cplusplus -} -#endif - -#endif /* BTA_FT_API_H */ diff --git a/bta/include/bta_hd_api.h b/bta/include/bta_hd_api.h deleted file mode 100644 index 5fd7443..0000000 --- a/bta/include/bta_hd_api.h +++ /dev/null @@ -1,289 +0,0 @@ -/****************************************************************************** -** -** File Name: bta_hd_api.h -** -** Description: This is the interface header file for the HID Device service. -** -** Copyright (c) 2002-2004, WIDCOMM Inc., All Rights Reserved. -** WIDCOMM Bluetooth Core. Proprietary and confidential. -** -******************************************************************************/ - -#ifndef BTA_HD_API_H -#define BTA_HD_API_H - -#include "bt_types.h" -#include "bta_api.h" -#include "hidd_api.h" - -/*****************************************************************************/ -/* C O N S T A N T S */ -/*****************************************************************************/ -/* status values */ -#define BTA_HD_SUCCESS 0 /* operation successful */ -#define BTA_HD_FAIL 1 /* generic failure */ -#define BTA_HD_FAIL_SDP 2 /* service not found */ - -typedef UINT8 tBTA_HD_STATUS; - -/* HD callback events */ -#define BTA_HD_ENABLE_EVT 0 /* HD enabled */ -#define BTA_HD_OPEN_EVT 1 /* connection opened */ -#define BTA_HD_CLOSE_EVT 2 /* connection closed */ -#define BTA_HD_UNPLUG_EVT 3 /* unplug */ -#define BTA_HD_DATA_EVT 4 /* Data received */ -#define BTA_HD_DATC_EVT 5 /* Data continueation received */ - -typedef UINT8 tBTA_HD_EVT; - -enum -{ - BTA_HD_REPT_ID_SPEC, /* 0 */ - BTA_HD_REPT_ID_KBD, /* 1: regular keyboard */ - BTA_HD_REPT_ID_MOUSE, /* 2: mouse */ - BTA_HD_REPT_ID_CONSUMER -}; -typedef UINT8 tBTA_HD_REPT_ID; -#define BTA_HD_REPT_ID_MAX BTA_HD_REPT_ID_CONSUMER - - -#define BTA_HD_KBD_REPT_SIZE 9 -#define BTA_HD_MOUSE_REPT_SIZE 5 - - -/* Modifier Keys definition */ -#define BTA_HD_MDF_LCTRL 0x01 /* Left CTRL */ -#define BTA_HD_MDF_LSHIFT 0x02 /* Left SHIFT */ -#define BTA_HD_MDF_LALT 0x04 /* Left ALT */ -#define BTA_HD_MDF_LGUI 0x08 /* Left GUI */ -#define BTA_HD_MDF_RCTRL 0x10 /* Right CTRL */ -#define BTA_HD_MDF_RSHIFT 0x20 /* Right SHIFT */ -#define BTA_HD_MDF_RALT 0x40 /* Right ALT */ -#define BTA_HD_MDF_RGUI 0x80 /* Right GUI */ - -/* keycode definition - - * See USB HID Usage Tables section 10: Keyboard/Keypad Page (0x07) */ -#define BTA_HD_KEYCODE_A 0x04 /* a A */ -#define BTA_HD_KEYCODE_B 0x05 /* b B */ -#define BTA_HD_KEYCODE_C 0x06 /* c C */ -#define BTA_HD_KEYCODE_D 0x07 /* d D */ -#define BTA_HD_KEYCODE_E 0x08 /* e E */ -#define BTA_HD_KEYCODE_F 0x09 /* f F */ -#define BTA_HD_KEYCODE_G 0x0A /* g G */ -#define BTA_HD_KEYCODE_H 0x0B /* h H */ -#define BTA_HD_KEYCODE_I 0x0C /* i I */ -#define BTA_HD_KEYCODE_J 0x0D /* j J */ -#define BTA_HD_KEYCODE_K 0x0E /* k K */ -#define BTA_HD_KEYCODE_L 0x0F /* l L */ -#define BTA_HD_KEYCODE_M 0x10 /* m M */ -#define BTA_HD_KEYCODE_N 0x11 /* n N */ -#define BTA_HD_KEYCODE_O 0x12 /* o O */ -#define BTA_HD_KEYCODE_P 0x13 /* p P */ -#define BTA_HD_KEYCODE_Q 0x14 /* q Q */ -#define BTA_HD_KEYCODE_R 0x15 /* r R */ -#define BTA_HD_KEYCODE_S 0x16 /* s S */ -#define BTA_HD_KEYCODE_T 0x17 /* t T */ -#define BTA_HD_KEYCODE_U 0x18 /* u U */ -#define BTA_HD_KEYCODE_V 0x19 /* v V */ -#define BTA_HD_KEYCODE_W 0x1A /* w W */ -#define BTA_HD_KEYCODE_X 0x1B /* x X */ -#define BTA_HD_KEYCODE_Y 0x1C /* y Y */ -#define BTA_HD_KEYCODE_Z 0x1D /* z Z */ -#define BTA_HD_KEYCODE_1 0x1E /* 1 ! */ -#define BTA_HD_KEYCODE_2 0x1F /* 2 @ */ -#define BTA_HD_KEYCODE_3 0x20 /* 3 # */ -#define BTA_HD_KEYCODE_4 0x21 /* 4 $ */ -#define BTA_HD_KEYCODE_5 0x22 /* 5 % */ -#define BTA_HD_KEYCODE_6 0x23 /* 6 ^ */ -#define BTA_HD_KEYCODE_7 0x24 /* 7 & */ -#define BTA_HD_KEYCODE_8 0x25 /* 8 * */ -#define BTA_HD_KEYCODE_9 0x26 /* 9 ( */ -#define BTA_HD_KEYCODE_0 0x27 /* 0 ) */ -#define BTA_HD_KEYCODE_ENTER 0x28 /* ENTER */ -#define BTA_HD_KEYCODE_ESC 0x29 /* ESC */ -#define BTA_HD_KEYCODE_BACKSPACE 0x2A /* BACKSPACE */ -#define BTA_HD_KEYCODE_TAB 0x2B /* TAB */ -#define BTA_HD_KEYCODE_SPACE 0x2C /* SPACE */ -#define BTA_HD_KEYCODE_MINUS 0x2D /* - _ */ -#define BTA_HD_KEYCODE_EQUAL 0x2E /* = + */ -#define BTA_HD_KEYCODE_LBRACKET 0x2F /* [ { */ -#define BTA_HD_KEYCODE_RBRACKET 0x30 /* ] } */ -#define BTA_HD_KEYCODE_BACKSLASH 0x31 /* \ | */ -#define BTA_HD_KEYCODE_SEMICOLUMN 0x33 /* ; : */ -#define BTA_HD_KEYCODE_QUOTE 0x34 /* ' " */ -#define BTA_HD_KEYCODE_TILT 0x35 /* ` ~ */ -#define BTA_HD_KEYCODE_COMMA 0x36 /* , < */ -#define BTA_HD_KEYCODE_DIR 0x37 /* . > */ -#define BTA_HD_KEYCODE_SLASH 0x38 /* / ? */ -#define BTA_HD_KEYCODE_F1 0x3A /* F1 */ -#define BTA_HD_KEYCODE_F2 0x3B /* F2 */ -#define BTA_HD_KEYCODE_F3 0x3C /* F3 */ -#define BTA_HD_KEYCODE_F4 0x3D /* F4 */ -#define BTA_HD_KEYCODE_F5 0x3E /* F5 */ -#define BTA_HD_KEYCODE_F6 0x3F /* F6 */ -#define BTA_HD_KEYCODE_F7 0x40 /* F7 */ -#define BTA_HD_KEYCODE_F8 0x41 /* F8 */ -#define BTA_HD_KEYCODE_F9 0x42 /* F9 */ -#define BTA_HD_KEYCODE_F10 0x43 /* F10 */ -#define BTA_HD_KEYCODE_F11 0x44 /* F11 */ -#define BTA_HD_KEYCODE_F12 0x45 /* F12 */ -#define BTA_HD_KEYCODE_HOME 0x4A /* HOME */ -#define BTA_HD_KEYCODE_PAGEUP 0x4B /* PAGE UP */ -#define BTA_HD_KEYCODE_END 0x4D /* END */ -#define BTA_HD_KEYCODE_PAGEDOWN 0x4E /* PAGE DOWN */ -#define BTA_HD_KEYCODE_RIGHTARROW 0x4F /* RIGHT ARROW */ -#define BTA_HD_KEYCODE_LEFTARROW 0x50 /* LEFT ARROW */ -#define BTA_HD_KEYCODE_DOWNARROW 0x51 /* DOWN ARROW */ -#define BTA_HD_KEYCODE_UPARROW 0x52 /* UP ARROW */ -#define BTA_HD_KEYCODE_POPUP 0x65 /* POPUP Menu */ - -/* data associated with BTA_HD_OPEN_EVT */ -typedef struct -{ - BD_ADDR bd_addr; -} tBTA_HD_OPEN; - -/* data associated with BTA_HD_ENABLE_EVT */ -typedef struct -{ - tBTA_HD_STATUS status; -} tBTA_HD_ENABLE; - -/* data associated with BTA_HD_CLOSE_EVT */ -typedef struct -{ - BD_ADDR bd_addr; -} tBTA_HD_CLOSE; - -/* data associated with BTA_HD_REPORT_EVT */ -typedef struct -{ - UINT8 *p_data; - UINT16 len; -} tBTA_HD_REPORT; -/*****************************************************************************/ -/* F U N C T I O N P R O T O T Y P E S */ -/*****************************************************************************/ -/* union of data associated with HD callback */ -typedef union -{ - tBTA_HD_ENABLE enable; - tBTA_HD_OPEN open; - tBTA_HD_CLOSE close; - tBTA_HD_REPORT data; -} tBTA_HD; - -/* HD callback */ -typedef void (tBTA_HD_CBACK)(tBTA_HD_EVT event, tBTA_HD *p_data); - -/* HD configuration structure */ -typedef struct -{ - tHID_DEV_QOS_INFO qos; - tHID_DEV_SDP_INFO sdp_info; - BOOLEAN use_qos; /* use QoS */ -} tBTA_HD_CFG; - -/******************************************************************************* -** -** Function BTA_HdEnable -** -** Description Enable the HID Device service. When the enable -** operation is complete the callback function will be -** called with a BTA_HD_ENABLE_EVT. This function must -** be called before other function in the HD API are -** called. -** -** If all bytes of the specified bd_addr are 0xff, the -** peer address is considered as unknown. The HID device listens -** for incoming connection request. -** Otherwise, The HID device initiates a connection toward the -** specified bd_addr when BTA_HdOpen() is called. -** -** Returns void -** -*******************************************************************************/ -BTA_API void BTA_HdEnable(BD_ADDR bd_addr, tBTA_SEC sec_mask, const char *p_service_name, - tBTA_HD_CBACK *p_cback, UINT8 app_id); - -/******************************************************************************* -** -** Function BTA_HdDisable -** -** Description Disable the HID Device service. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API void BTA_HdDisable(void); - -/******************************************************************************* -** -** Function BTA_HdOpen -** -** Description Opens an HID Device connection to a peer device. -** When connection is open, callback function is called -** with a BTA_HD_OPEN_EVT. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API void BTA_HdOpen(tBTA_SEC sec_mask); - -/******************************************************************************* -** -** Function BTA_HdClose -** -** Description Close the current connection a peer device. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API void BTA_HdClose(void); - -/******************************************************************************* -** -** Function BTA_HdSendRegularKey -** -** Description Send a key report to the connected host. -** If auto_release is TRUE, assume the keyboard report must be -** a key press. An associated key release report is also sent. -** -** Returns void -** -*******************************************************************************/ -BTA_API void BTA_HdSendRegularKey (UINT8 modifier, UINT8 key_code, BOOLEAN auto_release); - -/******************************************************************************* -** -** Function BTA_HdSendSpecialKey -** -** Description Send a special key report to the connected host. -** The report is sent as a keyboard report. -** If auto_release is TRUE, assume the keyboard report must be -** a key press. An associated key release report is also sent. -** If key_len is less than BTA_HD_KBD_REPT_SIZE, the key_seq -** is padded with 0 until BTA_HD_KBD_REPT_SIZE. -** -** Returns void -** -*******************************************************************************/ -BTA_API void BTA_HdSendSpecialKey (UINT8 key_len, UINT8 * key_seq, BOOLEAN auto_release); - -/******************************************************************************* -** -** Function BTA_HdSendMouseReport -** -** Description Send a mouse report to the connected host -** -** Returns void -** -*******************************************************************************/ -BTA_API void BTA_HdSendMouseReport (UINT8 is_left, UINT8 is_right, UINT8 is_middle, - INT8 delta_x, INT8 delta_y, INT8 delta_wheel); - - -#endif /* BTA_HD_API_H */ diff --git a/bta/include/bta_ma_api.h b/bta/include/bta_ma_api.h deleted file mode 100644 index e0b413e..0000000 --- a/bta/include/bta_ma_api.h +++ /dev/null @@ -1,691 +0,0 @@ -/***************************************************************************** -** -** Name: bta_ma_api.h -** -** Description: This file contains the common API functions used -** for the Message Access Profiles (MAP). -** -** Copyright (c) 2009, Broadcom Corp., All Rights Reserved. -** Broadcom Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_MA_API_H -#define BTA_MA_API_H - -#include "bta_mse_api.h" /* For tBTA_MA_MSG_TYPE */ -#include <stdio.h> - -typedef struct -{ - UINT16 size; /* Size of the buffer */ - UINT8 * p_buffer; /* Pointer to buffer */ - UINT8 * p_next; /* Pointer to next byte to use in buffer */ - -}tBTA_MA_MEM_STREAM; - -typedef struct -{ - int fd; - -}tBTA_MA_FILE_STREAM; - -/* Structure used for streaming data */ -typedef struct -{ -#define STRM_TYPE_MEMORY 0 -#define STRM_TYPE_FILE 1 - - UINT8 type; - -#define STRM_SUCCESS 0 -#define STRM_ERROR_OVERFLOW 1 -#define STRM_ERROR_FILE 2 - - UINT8 status; - - union - { - tBTA_MA_MEM_STREAM mem; - tBTA_MA_FILE_STREAM file; - } u; - -} tBTA_MA_STREAM; - -/******************************************************************************* -** -** bMessage functions -** -** Description The following API functions are generic in a sense that -** they do not imply how the data is stored (to memory or -** to file, etc.). -** -** They operate on a generic set of structure types. Though -** the internal structure of those types are implementation -** specific. -** -*******************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/******************************************************************************* -** -** Function BTA_MaBmsgCreate -** -** Description Create and initialize an instance of a tBTA_MA_BMSG structure. -** -** Parameters None -** -** Returns Pointer to a bMessage object, or NULL if this fails. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG * BTA_MaBmsgCreate(void); -/******************************************************************************* -** -** Function BTA_MaBmsgFree -** -** Description Destroy (free) the contents of a tBTA_MA_BMSG structure. -** -** Parameters p_bmsg - Pointer to a bMessage object -** -** Returns None -** -*******************************************************************************/ -BTA_API extern void BTA_MaBmsgFree(tBTA_MA_BMSG * p_msg); -/******************************************************************************* -** -** Function BTA_MaBmsgSetReadSts -** -** Description Set the bmessage-readstatus-property value for the bMessage -** object. If the 'read_sts' is TRUE then value will be "READ", -** otherwise it is "UNREAD". -** -** Parameters p_bmsg - Pointer to a bMessage object -** read_sts - Read status TRUE- read FALSE - unread -** -** Returns None -** -*******************************************************************************/ -BTA_API extern void BTA_MaBmsgSetReadSts(tBTA_MA_BMSG * p_msg, BOOLEAN read_sts); -/******************************************************************************* -** -** Function BTA_MaBmsgGetReadSts -** -** Description Get the bmessage-readstatus-property value for the bMessage -** object -** -** Parameters p_bmsg - Pointer to a bMessage object -** -** Returns Read status (TRUE/FALSE) for the specified bMessage. -** -*******************************************************************************/ -BTA_API extern BOOLEAN BTA_MaBmsgGetReadSts(tBTA_MA_BMSG * p_msg); -/******************************************************************************* -** -** Function BTA_MaBmsgSetMsgType -** -** Description Set the bmessage-type-property value for the bMessage object -** -** Parameters p_bmsg - Pointer to a bMessage object -** msg_type - Message type -** -** Returns None -** -*******************************************************************************/ -BTA_API extern void BTA_MaBmsgSetMsgType(tBTA_MA_BMSG * p_msg, tBTA_MA_MSG_TYPE msg_type); -/******************************************************************************* -** -** Function BTA_MaBmsgGetMsgType -** -** Description Get the bmessage-type-property value for the specified -** bMessage object -** -** Parameters p_bmsg - Pointer to a bMessage object -** -** Returns Message type -** -*******************************************************************************/ -BTA_API extern tBTA_MA_MSG_TYPE BTA_MaBmsgGetMsgType(tBTA_MA_BMSG * p_msg); -/******************************************************************************* -** -** Function BTA_MaBmsgSetFolder -** -** Description Set the bmessage-folder-property value for the bMessage object -** -** Parameters p_bmsg - Pointer to a bMessage object -** p_folder - Pointer to a folder path -** -** Returns None -** -*******************************************************************************/ -BTA_API extern void BTA_MaBmsgSetFolder(tBTA_MA_BMSG * p_msg, char * p_folder); -/******************************************************************************* -** -** Function BTA_MaBmsgGetFolder -** -** Description Get the bmessage-folder-property value for the specified -** bMessage object -** -** Parameters p_bmsg - Pointer to a bMessage object -** -** Returns Pointer to folder path string, or NULL if it has not been set. -** -*******************************************************************************/ -BTA_API extern char * BTA_MaBmsgGetFolder(tBTA_MA_BMSG * p_msg); -/******************************************************************************* -** -** Function BTA_MaBmsgAddOrigToBmsg -** -** Description Add an originator to the bMessage object -** -** Parameters p_bmsg - Pointer to a bMessage object -** -** Returns Pointer to a new vCard structure, or NULL if this function -** fails. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_VCARD * BTA_MaBmsgAddOrigToBmsg(tBTA_MA_BMSG * p_msg); -/******************************************************************************* -** -** Function BTA_MaBmsgGetOrigFromBmsg -** -** Description Get the first originator vCard information from the specified -** bMessage object -** -** Parameters p_bmsg - Pointer to a bMessage object -** -** Returns Pointer to first 'originator vCard, or NULL not used. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_VCARD * BTA_MaBmsgGetOrigFromBmsg(tBTA_MA_BMSG * p_msg); -/******************************************************************************* -** -** Function BTA_MaBmsgAddEnvToBmsg -** -** Description Add a new envelope to the bMessage object. This is the first -** (top) level envelope. bMessage allows up to 3 levels of envelopes. -** application should call BTA_MaBmsgAddEnvToEnv to add the 2nd -** 3rd level enevelope. -** -** Parameters p_bmsg - Pointer to a bMessage object -** -** Returns Pointer to a new envelope structure, or NULL if this -** function fails. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_ENVELOPE * BTA_MaBmsgAddEnvToBmsg(tBTA_MA_BMSG * p_msg); -/******************************************************************************* -** -** Function BTA_MaBmsgAddEnvToEnv -** -** Description Add a child envelope to an existing envelope. -** -** Parameters p_envelope - Pointer to a parent envelope -** -** Returns Pointer to an envelope structure, or NULL if this -** function fails. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_ENVELOPE * BTA_MaBmsgAddEnvToEnv(tBTA_MA_BMSG_ENVELOPE * p_envelope); -/******************************************************************************* -** -** Function BTA_MaBmsgGetEnv -** -** Description Get the pointer of the first level envelope. -** -** Parameters p_bmsg - Pointer to a bMessage object -** -** Returns Pointer to the first level envelope structure, or NULL if it -** does not exist -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_ENVELOPE * BTA_MaBmsgGetEnv(tBTA_MA_BMSG * p_msg); -/******************************************************************************* -** -** Function BTA_MaBmsgGetNextEnv -** -** Description Get the child envelope of the specified parent envelope. -** -** Parameters p_env - Pointer to a parent envelope -** -** Returns Pointer to a child enevelope. NULL if the -** envelope does not have a 'child' envelope. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_ENVELOPE * BTA_MaBmsgGetNextEnv(tBTA_MA_BMSG_ENVELOPE * p_env); -/******************************************************************************* -** -** Function BTA_MaBmsgAddRecipToEnv -** -** Description Add recipient to the specified envelope. -** -** Parameters p_env - Pointer to a envelope -** -** Returns Pointer to a vCard structure. NULL if it -** fails to allocate a vCard structure. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_VCARD * BTA_MaBmsgAddRecipToEnv(tBTA_MA_BMSG_ENVELOPE * p_env); -/******************************************************************************* -** -** Function BTA_MaBmsgGetRecipFromEnv -** -** Description Get the first recipient's vCard from the specified envelope. -** -** Parameters p_env - Pointer to a envelope -** -** Returns Pointer to the first recipient's vCard structure. NULL if it -** has not be set. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_VCARD * BTA_MaBmsgGetRecipFromEnv(tBTA_MA_BMSG_ENVELOPE * p_env); -/******************************************************************************* -** -** Function BTA_MaBmsgAddBodyToEnv -** -** Description Add a message body to the specified envelope. -** -** Parameters p_env - Pointer to a envelope -** -** Returns Pointer to a message body structure. -** NULL if it fails to allocate a message body structure. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_BODY * BTA_MaBmsgAddBodyToEnv(tBTA_MA_BMSG_ENVELOPE * p_env); -/******************************************************************************* -** -** Function BTA_MaBmsgGetBodyFromEnv -** -** Description Get the message body pointer from the specified envelope. -** -** Parameters p_env - Pointer to a envelope -** -** Returns Pointer to a message body structure. -** NULL if it has not been set. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_BODY * BTA_MaBmsgGetBodyFromEnv(tBTA_MA_BMSG_ENVELOPE * p_env); -/******************************************************************************* -** -** Function BTA_MaBmsgSetBodyEncoding -** -** Description Set the bmessage-body-encoding-property value for the bMessage -** body. -** -** Parameters p_body - Pointer to a bMessage body -** encoding - encoding scheme -** -** Returns None -** -*******************************************************************************/ -BTA_API extern void BTA_MaBmsgSetBodyEncoding(tBTA_MA_BMSG_BODY * p_body, tBTA_MA_BMSG_ENCODING encoding); -/******************************************************************************* -** -** Function BTA_MaBmsgGetBodyEncoding -** -** Description Get the bmessage-body-encoding-property value for the specified -** bMessage body. -** -** Parameters p_body - Pointer to a bMessage body -** -** Returns Message encoding scheme -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_ENCODING BTA_MaBmsgGetBodyEncoding(tBTA_MA_BMSG_BODY * p_body); -/******************************************************************************* -** -** Function BTA_MaBmsgSetBodyPartid -** -** Description Set the bmessage-body-part-ID value for the speicified -** bMessage body. -** -** Parameters p_body - Pointer to a bMessage body -** part_id - Part ID (range: from 0 to 65535) -** -** Returns None -** -*******************************************************************************/ -BTA_API extern void BTA_MaBmsgSetBodyPartid(tBTA_MA_BMSG_BODY * p_body, UINT16 part_id); -/******************************************************************************* -** -** Function BTA_MaBmsgGetBodyPartid -** -** Description Get the bmessage-body-part-ID value for the specified -** bMessage body. -** -** Parameters p_body - Pointer to a bMessage body -** -** Returns The value of the Part ID -** -*******************************************************************************/ -BTA_API extern UINT16 BTA_MaBmsgGetBodyPartid(tBTA_MA_BMSG_BODY * p_body); -/******************************************************************************* -** -** Function BTA_MaBmsgIsBodyMultiPart -** -** Description Is this a multi-part body -** -** Parameters p_body - Pointer to a bMessage body -** -** Returns TURE - if this is a multi-part body -** -*******************************************************************************/ -BTA_API extern BOOLEAN BTA_MaBmsgIsBodyMultiPart(tBTA_MA_BMSG_BODY * p_body); -/******************************************************************************* -** -** Function BTA_MaBmsgGetBodyCharset -** -** Description Get the bmessage-body-charset-property value for the speicified -** bMessage body. -** -** Parameters p_body - Pointer to a bMessage body -** -** Returns Charset -** -*******************************************************************************/ -BTA_API extern void BTA_MaBmsgSetBodyCharset(tBTA_MA_BMSG_BODY * p_body, tBTA_MA_CHARSET charset); -/******************************************************************************* -** -** Function BTA_MaBmsgGetBodyCharset -** -** Description Get the bmessage-body-charset-property value for the speicified -** bMessage body. -** -** Parameters p_body - Pointer to a bMessage body -** -** Returns Charset -** -*******************************************************************************/ -BTA_API extern tBTA_MA_CHARSET BTA_MaBmsgGetBodyCharset(tBTA_MA_BMSG_BODY * p_body); -/******************************************************************************* -** -** Function BTA_MaBmsgSetBodyLanguage -** -** Description Set the bmessage-body-language-property value for the speicified -** bMessage body. -** -** Parameters p_body - Pointer to a bMessage body -** Language - the language of the message -** -** Returns None -** -*******************************************************************************/ -BTA_API extern void BTA_MaBmsgSetBodyLanguage(tBTA_MA_BMSG_BODY * p_body, tBTA_MA_BMSG_LANGUAGE language); -/******************************************************************************* -** -** Function BTA_MaBmsgGetBodyLanguage -** -** Description Get the bmessage-body-language-property value for the speicified -** bMessage body. -** -** Parameters p_body - Pointer to a bMessage body -** -** Returns the language of the message -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_LANGUAGE BTA_MaBmsgGetBodyLanguage(tBTA_MA_BMSG_BODY * p_body); -/******************************************************************************* -** -** Function BTA_MaBmsgAddContentToBody -** -** Description Add a message content to the speicified bMessage body. -** -** Parameters p_body - Pointer to a bMessage body -** -** Returns Pointer to a message content. -** NULL if it fails to allocate a message content buffer -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_CONTENT * BTA_MaBmsgAddContentToBody(tBTA_MA_BMSG_BODY * p_body); -/******************************************************************************* -** -** Function BTA_MaBmsgGetContentFromBody -** -** Description Get a message content from the speicified bMessage body. -** -** Parameters p_body - Pointer to a bMessage body -** -** Returns Pointer to a message content. -** NULL if it has not been set. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_CONTENT * BTA_MaBmsgGetContentFromBody(tBTA_MA_BMSG_BODY * p_body); -/******************************************************************************* -** -** Function BTA_MaBmsgGetNextContent -** -** Description Get the next message content from the speicified message content. -** -** Parameters p_content - Pointer to a message content -** -** Returns Pointer to a message content. -** NULL if it has not been set. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_CONTENT * BTA_MaBmsgGetNextContent(tBTA_MA_BMSG_CONTENT * p_content); -/******************************************************************************* -** -** Function BTA_MaBmsgAddMsgContent -** -** Description Add a text string to the speicified message content. -** -** Parameters p_content - Pointer to a message content -** p_text - Pointer to a text string -** -** Returns None -** -*******************************************************************************/ -BTA_API extern void BTA_MaBmsgAddMsgContent(tBTA_MA_BMSG_CONTENT * p_content, char * p_text); -/******************************************************************************* -** -** Function BTA_MaBmsgGetMsgContent -** -** Description Get the next text string from the speicified message content. -** -** Parameters p_content - Pointer to a message content -** -** Returns Pointer to the next text string. -** NULL if it has not been set. -** -*******************************************************************************/ -BTA_API extern char * BTA_MaBmsgGetMsgContent(tBTA_MA_BMSG_CONTENT * p_content); -/******************************************************************************* -** -** Function BTA_MaBmsgGetNextVcard -** -** Description Get the next vCard from the speicified vCard. -** -** Parameters p_vcard - Pointer to a vCard -** -** Returns Pointer to the next vCard. -** NULL if it has not been set. -** -*******************************************************************************/ -BTA_API extern char * BTA_MaBmsgGetNextMsgContent(tBTA_MA_BMSG_CONTENT * p_content); -/******************************************************************************* -** -** Function BTA_MaBmsgGetNextVcard -** -** Description Get the next vCard from the speicified vCard. -** -** Parameters p_vcard - Pointer to a vCard -** -** Returns Pointer to the next vCard. -** NULL if it has not been set. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_BMSG_VCARD * BTA_MaBmsgGetNextVcard(tBTA_MA_BMSG_VCARD * p_vcard); -/******************************************************************************* -** -** Function BTA_MaBmsgSetVcardVersion -** -** Description Set the vCard version for the speicified vCard. -** -** Parameters p_vcard - Pointer to a vCard -** version - vcard version -** -** Returns None -** -*******************************************************************************/ -BTA_API extern void BTA_MaBmsgSetVcardVersion(tBTA_MA_BMSG_VCARD * p_vcard, tBTA_MA_VCARD_VERSION version); -/******************************************************************************* -** -** Function BTA_MaBmsgGetVcardVersion -** -** Description Get the vCard version from the speicified vCard. -** -** Parameters p_vcard - Pointer to a vCard -** -** Returns vCard version number -** -*******************************************************************************/ -BTA_API extern tBTA_MA_VCARD_VERSION BTA_MaBmsgGetVcardVersion(tBTA_MA_BMSG_VCARD * p_vcard); -/******************************************************************************* -** -** Function BTA_MaBmsgGetVcardProp -** -** Description Get the vCard property from the speicified vCard peoperty enum. -** -** Parameters p_vcard - Pointer to a vCard -** prop - Indicate which vCard peoperty -** -** Returns Pointer to the vCard peoperty. -** NULL if the vCard peoperty does not exist -** -*******************************************************************************/ -BTA_API extern tBTA_MA_VCARD_PROPERTY * BTA_MaBmsgAddVcardProp(tBTA_MA_BMSG_VCARD * p_vcard, tBTA_MA_VCARD_PROP prop, char * p_value, char * p_param); -/******************************************************************************* -** -** Function BTA_MaBmsgGetVcardProp -** -** Description Get the next vCard property from the speicified vCard peoperty. -** -** Parameters p_prop - Pointer to a vCard property -** -** Returns Pointer to the next vCard peoperty. -** NULL if the next vCard peoperty does not exist -** -*******************************************************************************/ -BTA_API extern tBTA_MA_VCARD_PROPERTY * BTA_MaBmsgGetVcardProp(tBTA_MA_BMSG_VCARD * p_vcard, tBTA_MA_VCARD_PROP prop); -/******************************************************************************* -** -** Function BTA_MaBmsgGetNextVcardProp -** -** Description Get the next vCard property from the speicified vCard peoperty. -** -** Parameters p_prop - Pointer to a vCard property -** -** Returns Pointer to the next vCard peoperty. -** NULL if the next vCard peoperty does not exist -** -*******************************************************************************/ -BTA_API extern tBTA_MA_VCARD_PROPERTY * BTA_MaBmsgGetNextVcardProp(tBTA_MA_VCARD_PROPERTY * p_prop); -/******************************************************************************* -** -** Function BTA_MaBmsgGetVcardPropValue -** -** Description Get the vCard property value from the speicified vCard peoperty. -** -** Parameters p_prop - Pointer to a vCard property -** -** Returns Pointer to the vCard peoperty value. -** NULL if the vCard peoperty value has not been set. -** -*******************************************************************************/ -BTA_API extern char * BTA_MaBmsgGetVcardPropValue(tBTA_MA_VCARD_PROPERTY * p_prop); -/******************************************************************************* -** -** Function BTA_MaBmsgGetVcardPropParam -** -** Description Get the vCard property parameter from the speicified vCard peoperty. -** -** Parameters p_prop - Pointer to a vCard property -** -** Returns Poiter to the vCard peoperty parameter. -** NULL if the vCard peoperty parameter has not been set. -** -*******************************************************************************/ -BTA_API extern char * BTA_MaBmsgGetVcardPropParam(tBTA_MA_VCARD_PROPERTY * p_prop); -/******************************************************************************* -** -** Function BTA_MaBuildMapBmsgObj -** -** Description Builds a specification compliant bMessage object given a -** generic bMessage internal structure. -** -** Parameters p_msg - pointer to bMessage object structure (input). -** p_stream - Output stream. -** -** Returns BTA_MA_STATUS_OK if successful. BTA_MA_STATUS_FAIL if not. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_STATUS BTA_MaBuildMapBmsgObj(tBTA_MA_BMSG * p_msg, tBTA_MA_STREAM * p_stream); -/******************************************************************************* -** -** Function bta_ma_parse_map_bmsg_obj -** -** Description Parses a bMessage object from a stream into a generic -** bMessage internal structure. -** -** Parameters p_msg - pointer to bMessage object structure (output). -** p_stream - Input stream. -** -** Returns BTA_MA_STATUS_OK if successful. BTA_MA_STATUS_FAIL if not. -** -*******************************************************************************/ -BTA_API extern tBTA_MA_STATUS BTA_MaParseMapBmsgObj(tBTA_MA_BMSG * p_msg, tBTA_MA_STREAM * p_stream); - -/******************************************************************************* -** -** Function BTA_MaInitMemStream -** -** Description Initializes a memory based stream -** -** Parameters p_stream - pointer to stream information. -** p_buffer - pointer to buffer to be manipulated. -** size - size of buffer pointed to by 'p_buffer'. -** -** Returns TRUE if stream is successfully initialized -** -*******************************************************************************/ -BTA_API extern BOOLEAN BTA_MaInitMemStream(tBTA_MA_STREAM * p_stream, - UINT8 * p_buffer, - UINT16 size); -/******************************************************************************* -** -** Function BTA_MaInitFileStream -** -** Description Initializes a file stream -** -** Parameters p_stream - pointer to stream information. -** p_filename - Full pathname to file to use. -** oflags - permissions and mode (see constants above) -** -** Returns void -** -*******************************************************************************/ -BTA_API extern BOOLEAN BTA_MaInitFileStream(tBTA_MA_STREAM * p_stream, - const char *p_path, - int oflags); -/******************************************************************************* -** -** Function BTA_MaCloseStream -** -** Description Close a stream (do any necessary clean-up. -** -** Parameters p_stream - pointer to stream information. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_MaCloseStream(tBTA_MA_STREAM * p_stream); - - - -#ifdef __cplusplus -} -#endif - -#endif /* BTA_BMSG_API_H */ diff --git a/bta/include/bta_ma_co.h b/bta/include/bta_ma_co.h deleted file mode 100644 index 442d106..0000000 --- a/bta/include/bta_ma_co.h +++ /dev/null @@ -1,91 +0,0 @@ -/***************************************************************************** -** -** Name: bta_ma_co.h -** -** Description: This is the interface file for the Message Access Profile -** common call-out functions. -** -** Copyright (c) 2009, Broadcom Corp., All Rights Reserved. -** Broadcom Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_MA_CO_H -#define BTA_MA_CO_H - -#include <stdio.h> - -/***************************************************************************** -** -** Utility functions for converting types to strings. -** -*****************************************************************************/ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/******************************************************************************* -** -** Function bta_ma_co_open -** -** Description Open a file. -** -** Parameters p_path - Full path of file to open. -** oflags - file open flags. -** -** Returns file descriptor. BTA_FS_INVALID_FD if open fails. -** -*******************************************************************************/ - BTA_API extern int bta_ma_co_open(const char *p_path, int oflags); - -/******************************************************************************* -** -** Function bta_ma_co_write -** -** Description Write data to file. -** -** Parameters fd - file descriptor. -** buffer - data to write. -** size - size of data to write (in bytes). -** -** Returns Number of bytes written. -** -*******************************************************************************/ - BTA_API extern int bta_ma_co_write(int fd, const void *buffer, int size); - -/******************************************************************************* -** -** Function bta_ma_co_read -** -** Description Read data from file. -** -** Parameters fd - file descriptor. -** buffer - to receive data. -** size - amount of data to read (in bytes). -** -** Returns Number of bytes read. -** -*******************************************************************************/ - BTA_API extern int bta_ma_co_read(int fd, void *buffer, int size); - -/******************************************************************************* -** -** Function bta_ma_co_close -** -** Description Close the file. -** -** Parameters fd - file descriptor. -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void bta_ma_co_close(int fd); - -#ifdef __cplusplus -} -#endif - -#endif /* BTA_MA_FILE_H */ - - diff --git a/bta/include/bta_ma_def.h b/bta/include/bta_ma_def.h deleted file mode 100644 index 7202385..0000000 --- a/bta/include/bta_ma_def.h +++ /dev/null @@ -1,479 +0,0 @@ -/***************************************************************************** -** -** Name: bta_ma_def.h -** -** Description: This file contains the common definitions for the Message Access -** profile (MA) related SW modules -** -** Copyright (c) 2009, Broadcom Corp., All Rights Reserved. -** Broadcom Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_MA_DEF_H -#define BTA_MA_DEF_H - -#include "obx_api.h" -#include "bta_api.h" -#include "btm_api.h" -#include "bta_sys.h" -#include "bta_fs_co.h" - -/***************************************************************************** -** Constants and data types -*****************************************************************************/ - - -#define BTA_MA_HANDLE_SIZE 8 - -typedef UINT8 tBTA_MA_MSG_HANDLE[BTA_MA_HANDLE_SIZE]; - -typedef tOBX_HANDLE tBTA_MA_SESS_HANDLE; - -typedef UINT8 tBTA_MA_INST_ID; - -#define BTA_MA_STATUS_OK 0 -#define BTA_MA_STATUS_FAIL 1 /* Used to pass all other errors */ -#define BTA_MA_STATUS_ABORTED 2 -#define BTA_MA_STATUS_NO_RESOURCE 3 -#define BTA_MA_STATUS_EACCES 4 -#define BTA_MA_STATUS_ENOTEMPTY 5 -#define BTA_MA_STATUS_EOF 6 -#define BTA_MA_STATUS_EODIR 7 -#define BTA_MA_STATUS_ENOSPACE 8 /* Returned in bta_fs_ci_open if no room */ -#define BTA_MA_STATUS_DUPLICATE_ID 9 -#define BTA_MA_STATUS_ID_NOT_FOUND 10 -#define BTA_MA_STATUS_FULL 11 /* reach the max packet size */ - -typedef UINT8 tBTA_MA_STATUS; - -#define BTA_MA_OPER_NONE 0 -#define BTA_MA_OPER_GET_MSG 1 -#define BTA_MA_OPER_PUSH_MSG 2 - -typedef UINT8 tBTA_MA_OPER; - -/* mode field in tBTA_MSE_CO_FOLDER_ENTRY (OR'd together) */ -#define BTA_MA_A_RDONLY 1 -#define BTA_MA_A_DIR 2 /* Entry is a sub directory */ - - -/* message status inficator */ -#define BTA_MA_STS_INDTR_READ 0 -#define BTA_MA_STS_INDTR_DELETE 1 -typedef UINT8 tBTA_MA_STS_INDCTR; - -/* message status value */ -#define BTA_MA_STS_VALUE_NO 0 -#define BTA_MA_STS_VALUE_YES 1 -typedef UINT8 tBTA_MA_STS_VALUE; - -/* notification status */ -enum -{ - BTA_MA_NOTIF_OFF = 0, - BTA_MA_NOTIF_ON, - BTA_MA_NOTIF_MAX - -}; -typedef UINT8 tBTA_MA_NOTIF_STATUS; - - -/* Access response types */ -enum -{ - BTA_MA_ACCESS_TYPE_ALLOW = 0, /* Allow the requested operation */ - BTA_MA_ACCESS_TYPE_FORBID /* Disallow the requested operation */ -}; - -typedef UINT8 tBTA_MA_ACCESS_TYPE; - -/* Structure for in progress related event*/ -typedef struct -{ - UINT32 obj_size; /* Total size of object 0 if unknow*/ - tBTA_MA_SESS_HANDLE mas_session_id; - UINT16 bytes; /* Number of bytes read or written since last progress event */ -} tBTA_MA_IN_PROG; - - -/* Message type see SDP supported message type */ -#define BTA_MA_MSG_TYPE_EMAIL (1<<0) -#define BTA_MA_MSG_TYPE_SMS_GSM (1<<1) -#define BTA_MA_MSG_TYPE_SMS_CDMA (1<<2) -#define BTA_MA_MSG_TYPE_MMS (1<<3) -typedef UINT8 tBTA_MA_MSG_TYPE; - -#define BTA_MA_MAX_FILTER_TEXT_SIZE 255 - -/* Message type mask for FilterMessageType in Application parameter */ -#define BTA_MA_MSG_TYPE_MASK_SMS_GSM (1<<0) -#define BTA_MA_MSG_TYPE_MASK_SMS_CDMA (1<<1) -#define BTA_MA_MSG_TYPE_MASK_EMAIL (1<<2) -#define BTA_MA_MSG_TYPE_MASK_MMS (1<<3) - - -typedef UINT8 tBTA_MA_MSG_TYPE_MASK; - - - -/* Parameter Mask for Messages-Listing */ -#define BTA_MA_ML_MASK_SUBJECT (1<<0) -#define BTA_MA_ML_MASK_DATETIME (1<<1) -#define BTA_MA_ML_MASK_SENDER_NAME (1<<2) -#define BTA_MA_ML_MASK_SENDER_ADDRESSING (1<<3) -#define BTA_MA_ML_MASK_RECIPIENT_NAME (1<<4) -#define BTA_MA_ML_MASK_RECIPIENT_ADDRESSING (1<<5) -#define BTA_MA_ML_MASK_TYPE (1<<6) -#define BTA_MA_ML_MASK_SIZE (1<<7) -#define BTA_MA_ML_MASK_RECEPTION_STATUS (1<<8) -#define BTA_MA_ML_MASK_TEXT (1<<9) -#define BTA_MA_ML_MASK_ATTACHMENT_SIZE (1<<10) -#define BTA_MA_ML_MASK_PRIORITY (1<<11) -#define BTA_MA_ML_MASK_READ (1<<12) -#define BTA_MA_ML_MASK_SENT (1<<13) -#define BTA_MA_ML_MASK_PROTECTED (1<<14) -#define BTA_MA_ML_MASK_REPLYTO_ADDRESSING (1<<15) - -typedef UINT32 tBTA_MA_ML_MASK; - -/* Read status used for message list */ -enum -{ - BTA_MA_READ_STATUS_NO_FILTERING = 0, - BTA_MA_READ_STATUS_UNREAD = 1, - BTA_MA_READ_STATUS_READ = 2 -}; -typedef UINT8 tBTA_MA_READ_STATUS; - -/* Priority status used for filtering message list */ -enum -{ - BTA_MA_PRI_STATUS_NO_FILTERING = 0, - BTA_MA_PRI_STATUS_HIGH = 1, - BTA_MA_PRI_STATUS_NON_HIGH = 2 -}; -typedef UINT8 tBTA_MA_PRI_STATUS; - -#define BTA_MA_LTIME_LEN 15 -typedef struct -{ - tBTA_MA_ML_MASK parameter_mask; - UINT16 max_list_cnt; - UINT16 list_start_offset; - UINT8 subject_length; /* valid range 1...255 */ - tBTA_MA_MSG_TYPE_MASK msg_mask; - char period_begin[BTA_MA_LTIME_LEN+1]; /* "yyyymmddTHHMMSS", or "" if none */ - char period_end[BTA_MA_LTIME_LEN+1]; /* "yyyymmddTHHMMSS", or "" if none */ - tBTA_MA_READ_STATUS read_status; - char recipient[BTA_MA_MAX_FILTER_TEXT_SIZE+1]; /* "" if none */ - char originator[BTA_MA_MAX_FILTER_TEXT_SIZE+1];/* "" if none */ - tBTA_MA_PRI_STATUS pri_status; -} tBTA_MA_MSG_LIST_FILTER_PARAM; - -/* enum for charset used in GetMEssage */ -enum -{ - BTA_MA_CHARSET_NATIVE = 0, - BTA_MA_CHARSET_UTF_8 = 1, - BTA_MA_CHARSET_UNKNOWN, - BTA_MA_CHARSET_MAX -}; -typedef UINT8 tBTA_MA_CHARSET; - -/* enum for fraction request used in GetMEssage */ -enum -{ - BTA_MA_FRAC_REQ_FIRST = 0, - BTA_MA_FRAC_REQ_NEXT = 1, - BTA_MA_FRAC_REQ_NO, /* this is not a fraction request */ - BTA_MA_FRAC_REQ_MAX -}; -typedef UINT8 tBTA_MA_FRAC_REQ; - -/* enum for fraction delivery used in GetMEssage */ -enum -{ - BTA_MA_FRAC_DELIVER_MORE = 0, - BTA_MA_FRAC_DELIVER_LAST = 1, - BTA_MA_FRAC_DELIVER_NO, /* this is not a fraction deliver*/ - BTA_MA_FRAC_DELIVER_MAX -}; -typedef UINT8 tBTA_MA_FRAC_DELIVER; - - -typedef struct -{ - BOOLEAN attachment; - tBTA_MA_MSG_HANDLE handle; - tBTA_MA_CHARSET charset; - tBTA_MA_FRAC_REQ fraction_request; -} tBTA_MA_GET_MSG_PARAM; - -#define BTA_MA_RETRY_OFF 0 -#define BTA_MA_RETRY_ON 1 -#define BTA_MA_RETRY_UNKNOWN 0xff -typedef UINT8 tBTA_MA_RETRY_TYPE; - - -#define BTA_MA_TRANSP_OFF 0 -#define BTA_MA_TRANSP_ON 1 -#define BTA_MA_TRANSP_UNKNOWN 0xff -typedef UINT8 tBTA_MA_TRANSP_TYPE; - -typedef struct -{ - char *p_folder; /* current or child folder - for current folder set - *p_folder = "" - */ - char *p_msg_name; /* for MCE use only*/ - tBTA_MA_TRANSP_TYPE transparent; - tBTA_MA_RETRY_TYPE retry; - tBTA_MA_CHARSET charset; - -} tBTA_MA_PUSH_MSG_PARAM; - -/* get or push message multi-packet status */ -enum -{ - BTA_MA_MPKT_STATUS_MORE = 0, - BTA_MA_MPKT_STATUS_LAST, - BTA_MA_MPKT_MAX -}; - -typedef UINT8 tBTA_MA_MPKT_STATUS; - -/* definitions for directory navigation */ -#define BTA_MA_DIR_NAV_ROOT_OR_DOWN_ONE_LVL 2 -#define BTA_MA_DIR_NAV_UP_ONE_LVL 3 - -typedef UINT8 tBTA_MA_DIR_NAV; - -enum -{ - BTA_MA_ATTACH_OFF = 0, - BTA_MA_ATTACH_ON -}; -typedef UINT8 tBTA_MA_ATTACH_TYPE; - -/* MAS tag ID in application parameters header definition */ -#define BTA_MA_APH_MAX_LIST_COUNT 0x01 /* MaxListCount 2 bytes 0x0000 to 0xFFFF */ -#define BTA_MA_APH_START_STOFF 0x02 /* StartOffset 2 bytes 0x0000 to 0xFFFF */ -#define BTA_MA_APH_FILTER_MSG_TYPE 0x03 /* SearchAttribute 1 byte 1,2,4 */ -#define BTA_MA_APH_FILTER_PRD_BEGIN 0x04 /* Filter Period Begin variable */ -#define BTA_MA_APH_FILTER_PRD_END 0x05 /* Filter Period End variable */ -#define BTA_MA_APH_FILTER_READ_STS 0x06 /* Filter read status 1 byte 0, 1, 2 */ -#define BTA_MA_APH_FILTER_RECEIP 0x07 /* FilterRecipient variable */ -#define BTA_MA_APH_FILTER_ORIGIN 0x08 /* FilterOriginator variable */ -#define BTA_MA_APH_FILTER_PRIORITY 0x09 /* FilterPriority 1 byte */ -#define BTA_MA_APH_ATTACH 0x0a /* Attachment 1 byte */ -#define BTA_MA_APH_TRANSPARENT 0x0b /* transparent 1 byte */ -#define BTA_MA_APH_RETRY 0x0c /* retry 1 byte */ -#define BTA_MA_APH_NEW_MSG 0x0d /* NewMessage 1 byte */ -#define BTA_MA_APH_NOTIF_STATUS 0x0e /* Notification Status 1 byte */ -#define BTA_MA_APH_MAS_INST_ID 0x0f /* MAS instance ID 1 byte 0 ... 255 */ -#define BTA_MA_APH_PARAM_MASK 0x10 /* Parameter mask 2 bytes */ -#define BTA_MA_APH_FOLDER_LST_SIZE 0x11 /* Folder Listing Size 2 bytes */ -#define BTA_MA_APH_MSG_LST_SIZE 0x12 /* Message Listing Size 2 bytes */ -#define BTA_MA_APH_SUBJ_LEN 0x13 /* Subject Length 1 byte */ -#define BTA_MA_APH_CHARSET 0x14 /* Character Set 1 byte :0, 1 */ -#define BTA_MA_APH_FRAC_REQ 0x15 /* Fraction request 1 byte :0, 1 */ -#define BTA_MA_APH_FRAC_DELVR 0x16 /* Fraction delivery 1 byte :0, 1 */ -#define BTA_MA_APH_STS_INDCTR 0x17 /* Status Indicator 1 byte */ -#define BTA_MA_APH_STS_VALUE 0x18 /* Status Value 1 byte: 0, 1 */ -#define BTA_MA_APH_MSE_TIME 0x19 /* MSETime variable */ - -#define BTA_MA_BODY_FILLER_BYTE 0x30 - -/* MAS type header */ -#define BTA_MA_HDR_TYPE_NOTIF_REG "x-bt/MAP-NotificationRegistration" -#define BTA_MA_HDR_TYPE_MSG_UPDATE "x-bt/MAP-messageUpdate" -#define BTA_MA_HDR_TYPE_EVENT_RPT "x-bt/MAP-event-report" -#define BTA_MA_HDR_TYPE_MSG_LIST "x-bt/MAP-msg-listing" -#define BTA_MA_HDR_TYPE_MSG "x-bt/message" -#define BTA_MA_HDR_TYPE_MSG_STATUS "x-bt/messageStatus" -#define BTA_MA_HDR_TYPE_FOLDER_LIST "x-obex/folder-listing" - -#define BTA_MAS_MESSAGE_ACCESS_TARGET_UUID "\xBB\x58\x2B\x40\x42\x0C\x11\xDB\xB0\xDE\x08\x00\x20\x0C\x9A\x66" -#define BTA_MAS_MESSAGE_NOTIFICATION_TARGET_UUID "\xBB\x58\x2B\x41\x42\x0C\x11\xDB\xB0\xDE\x08\x00\x20\x0C\x9A\x66" -#define BTA_MAS_UUID_LENGTH 16 -#define BTA_MAS_DEFAULT_VERSION 0x0100 - -#define BTA_MA_NOTIF_STS_TAG_ID 0x0E -#define BTA_MA_NOTIF_STS_LEN 0x01 -#define BTA_MA_NOTIF_STS_ON 0x01 -#define BTA_MA_NOTIF_STS_OFF 0x00 - -#define BTA_MA_NAS_INST_ID_TAG_ID 0x0F -#define BTA_MA_NAS_INST_ID_LEN 0x01 - -#define BTA_MA_DEFAULT_MAX_LIST_CNT 1024 - - -#define BTA_MA_64BIT_HEX_STR_SIZE (16+1) -#define BTA_MA_32BIT_HEX_STR_SIZE (8+1) - - - -/******************************************************************************* -** -** bMessage types -** -** Description The following types are designed to hold data in memory. -** The internal structure of these types are implementation -** specific. -** -*******************************************************************************/ - -enum -{ - BTA_MA_BMSG_ENC_8BIT = 0, /* Used for Email/MMS */ - - BTA_MA_BMSG_ENC_G7BIT, /* Used for GSM-SMS */ - BTA_MA_BMSG_ENC_G7BITEXT, - BTA_MA_BMSG_ENC_GUCS2, - BTA_MA_BMSG_ENC_G8BIT, - - BTA_MA_BMSG_ENC_C8BIT, /* Used for CDMA-SMS */ - BTA_MA_BMSG_ENC_CEPM, - BTA_MA_BMSG_ENC_C7ASCII, - BTA_MA_BMSG_ENC_CIA5, - BTA_MA_BMSG_ENC_CUNICODE, - BTA_MA_BMSG_ENC_CSJIS, - BTA_MA_BMSG_ENC_CKOREAN, - BTA_MA_BMSG_ENC_CLATINHEB, - BTA_MA_BMSG_ENC_CLATIN, - - BTA_MA_BMSG_ENC_UNKNOWN -}; -typedef UINT8 tBTA_MA_BMSG_ENCODING; - -enum -{ - BTA_MA_BMSG_LANG_UNSPECIFIED = 0, - - BTA_MA_BMSG_LANG_UNKNOWN, - BTA_MA_BMSG_LANG_SPANISH, /* GSM-SMS or CDMA-SMS */ - - BTA_MA_BMSG_LANG_TURKISH, /* GSM-SMS only */ - BTA_MA_BMSG_LANG_PORTUGUESE, - - BTA_MA_BMSG_LANG_ENGLISH, /* CDMA-SMS only */ - BTA_MA_BMSG_LANG_FRENCH, - BTA_MA_BMSG_LANG_JAPANESE, - BTA_MA_BMSG_LANG_KOREAN, - BTA_MA_BMSG_LANG_CHINESE, - BTA_MA_BMSG_LANG_HEBREW -}; -typedef UINT8 tBTA_MA_BMSG_LANGUAGE; - - -enum -{ - BTA_MA_VCARD_VERSION_21=0, - BTA_MA_VCARD_VERSION_30 -}; -typedef UINT8 tBTA_MA_VCARD_VERSION; - -enum -{ - BTA_MA_VCARD_PROP_N, - BTA_MA_VCARD_PROP_FN, - BTA_MA_VCARD_PROP_TEL, - BTA_MA_VCARD_PROP_EMAIL, - - BTA_MA_VCARD_PROP_MAX -}; -typedef UINT8 tBTA_MA_VCARD_PROP; - -typedef struct -{ - char * p_param; - char * p_value; - - /* link to the next property (if any) */ - void * p_next; - -} tBTA_MA_VCARD_PROPERTY; - -typedef struct -{ - tBTA_MA_VCARD_VERSION version; - - tBTA_MA_VCARD_PROPERTY * p_prop[BTA_MA_VCARD_PROP_MAX]; - - /* link to the next vCard (if any) */ - void * p_next; - -} tBTA_MA_BMSG_VCARD; - -typedef struct BMSG_MESSAGE_struct -{ - char * p_text; - - /* link to the next chunk of message text (if any) */ - void * p_next; - -} tBTA_MA_BMSG_MESSAGE; - -typedef struct BMSG_CONTENT_struct -{ - /* this is the first bit of message text */ - tBTA_MA_BMSG_MESSAGE * p_message; - - /* this points to the last entered text -or- - ** it is the last that we returned back to - ** - */ - tBTA_MA_BMSG_MESSAGE * p_last; - - /* link to the next chunk of content (if any) */ - void * p_next; - -} tBTA_MA_BMSG_CONTENT; - - -typedef struct -{ - /* Part ID */ - UINT16 part_id; - BOOLEAN is_multipart; - - /* Properties */ - tBTA_MA_BMSG_ENCODING encoding; - tBTA_MA_BMSG_LANGUAGE language; /* optional */ - tBTA_MA_CHARSET charset; - /* One or more body content */ - tBTA_MA_BMSG_CONTENT * p_content; - -} tBTA_MA_BMSG_BODY; - -typedef struct BMSG_ENVELOPE_struct -{ - /* One or more Recipient (vCards) */ - tBTA_MA_BMSG_VCARD * p_recip; - - /* There will be either another envelope or the body */ - void * p_next; - tBTA_MA_BMSG_BODY * p_body; - -} tBTA_MA_BMSG_ENVELOPE; - -typedef struct -{ - /* Property values */ - BOOLEAN read_sts; - tBTA_MA_MSG_TYPE msg_type; - char * p_folder; - - /* One or more Originator (vCards) */ - tBTA_MA_BMSG_VCARD * p_orig; - - /* Envelope */ - tBTA_MA_BMSG_ENVELOPE * p_envelope; - -} tBTA_MA_BMSG; - - -#endif - diff --git a/bta/include/bta_mse_api.h b/bta/include/bta_mse_api.h deleted file mode 100644 index 742ea7a..0000000 --- a/bta/include/bta_mse_api.h +++ /dev/null @@ -1,470 +0,0 @@ -/***************************************************************************** -** -** Name: bta_mse_api.h -** -** Description: This is the public interface file for the Message Server Equipment -** (MSE) subsystem of BTA, Broadcom's -** Bluetooth application layer for mobile phones. -** -** Copyright (c) 2009, Broadcom Corp., All Rights Reserved. -** Broadcom Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_MSE_API_H -#define BTA_MSE_API_H - -#include "bta_api.h" -#include "bta_ma_def.h" - -/***************************************************************************** -** Constants and data types -*****************************************************************************/ -/* Extra Debug Code */ -#ifndef BTA_MSE_DEBUG - #define BTA_MSE_DEBUG TRUE -#endif - -/************************** -** Common Definitions -***************************/ - -/* MSE callback function events */ -enum -{ - BTA_MSE_ENABLE_EVT = 0, /* MAS server is enabled. */ - BTA_MSE_DISABLE_EVT, - BTA_MSE_ACCESS_EVT, - BTA_MSE_OPER_CMPL_EVT, /* MSE operation complete */ - BTA_MSE_MA_OPEN_EVT, - BTA_MSE_MA_CLOSE_EVT, - BTA_MSE_SET_NOTIF_REG_EVT, - BTA_MSE_NOTIF_REG_EVT, - BTA_MSE_UPDATE_INBOX_EVT, - BTA_MSE_GET_MSG_IN_PROG_EVT, - BTA_MSE_PUSH_MSG_IN_PROG_EVT, - BTA_MSE_SEND_NOTIF_EVT, - BTA_MSE_MN_OPEN_EVT, - BTA_MSE_MN_CLOSE_EVT, - BTA_MSE_START_EVT, - BTA_MSE_STOP_EVT -}; -typedef UINT8 tBTA_MSE_EVT; - - -/* Structure associated with BTA_MSE_ENABLE_EVT - BTA_MSE_DISABLE_EVT -*/ -typedef struct -{ - tBTA_MA_STATUS status; - UINT8 app_id; -} tBTA_MSE_ENABLE_DISABLE; - - -/******************************************* -** Message Access Server Definitions -********************************************/ -/* Access event operation types */ -#define BTA_MSE_OPER_NONE 0 -#define BTA_MSE_OPER_SETPATH 1 -#define BTA_MSE_OPER_GET_FOLDER_LIST 2 -#define BTA_MSE_OPER_GET_MSG_LIST 3 -#define BTA_MSE_OPER_GET_MSG 4 -#define BTA_MSE_OPER_SET_MSG_STATUS 5 -#define BTA_MSE_OPER_DEL_MSG 6 -#define BTA_MSE_OPER_PUSH_MSG 7 -#define BTA_MSE_OPER_NOTIF_REG 8 -#define BTA_MSE_OPER_UPDATE_INBOX 9 - -typedef UINT8 tBTA_MSE_OPER; - -/* Structure associated with BTA_MSE_ACCESS_EVT */ -typedef struct -{ - tBTA_MA_SESS_HANDLE mas_session_id; /* MAS Session ID */ - tBTA_MSE_OPER oper; /* operation */ - char *p_path; /* full path name */ - tBTM_BD_NAME dev_name; /* Name of device, "" if unknown */ - BD_ADDR bd_addr; /* Address of device */ - tBTA_MA_MSG_HANDLE handle; - BOOLEAN delete_sts; -} tBTA_MSE_ACCESS; - -/* Structure associated with BTA_MSE_OPER_CMPL_EVT */ -typedef struct -{ - UINT32 obj_size; /* Total size of object 0 if unknow*/ - tBTA_MA_SESS_HANDLE mas_session_id; /* MAS Session ID */ - tBTA_MSE_OPER operation; - tBTA_MA_STATUS status; -} tBTA_MSE_OPER_CMPL; - - -/* Structure associated with BTA_MSE_MA_OPEN_EVT */ -typedef struct -{ - tBTA_MA_INST_ID mas_instance_id; /* MAS instance ID: one MAS - instance can support multiple - sessions */ - tBTA_MA_SESS_HANDLE mas_session_id; /* MAS Session ID, all session based - operation will need to use this ID */ - tBTM_BD_NAME dev_name; /* Name of device, "" if unknown */ - BD_ADDR bd_addr; /* Address of device */ - -} tBTA_MSE_MA_OPEN; - -/* Structure associated with BTA_MSE_MA_CLOSE_EVT */ -typedef struct -{ - tBTA_MA_STATUS status; - tBTA_MA_SESS_HANDLE mas_session_id; - tBTA_MA_INST_ID mas_instance_id; -} tBTA_MSE_MA_CLOSE; - -/* Structure associated with BTA_MSE_MN_OPEN_EVT or - BTA_MSE_MN_CLOSE_EVT -*/ -typedef struct -{ - tBTM_BD_NAME dev_name; /* Name of device, "" if unknown */ - BD_ADDR bd_addr; /* Address of device */ - tBTA_MA_INST_ID first_mas_instance_id; /* MN connection can be used for more - than one MasInstanceIDs. - first_mas_instance_id is the MasInstanceId of a - MAS service MCE first registers to receive the - message notification */ -} tBTA_MSE_MN_OPEN; - -typedef struct -{ - tBTM_BD_NAME dev_name; /* Name of device, "" if unknown */ - BD_ADDR bd_addr; /* Address of device */ -} tBTA_MSE_MN_CLOSE; - -/* Update Inbox response types */ -enum -{ - BTA_MSE_UPDATE_INBOX_ALLOW = 0, /* Allow the update inbox */ - BTA_MSE_UPDATE_INBOX_FORBID /* Disallow the update inbox */ -}; -typedef UINT8 tBTA_MSE_UPDATE_INBOX_TYPE; - - -/* Set Notification Registration response types */ -enum -{ - BTA_MSE_SET_NOTIF_REG_ALLOW = 0, /* Allow the notification registration request*/ - BTA_MSE_SET_NOTIF_REG_FORBID /* Disallow the notification registration request */ -}; -typedef UINT8 tBTA_MSE_SET_NOTIF_REG_TYPE; - -/* Structure associated with BTA_MSE_SEND_NOTIF_EVT */ -typedef struct -{ - tBTA_MA_STATUS status; - tBTA_MA_INST_ID mas_instance_id; - BD_ADDR bd_addr; /* remote MCE's BD address*/ -} tBTA_MSE_SEND_NOTIF; - - -/* Structure associated with BTA_MSE_START_EVT or - BTA_MSE_STOP_EVT */ -typedef struct -{ - tBTA_MA_STATUS status; - UINT8 mas_instance_id; -} tBTA_MSE_START_STOP; - -typedef struct -{ - tBTA_MA_SESS_HANDLE mas_session_id; - tBTA_MA_INST_ID mas_instance_id; - tBTA_MA_NOTIF_STATUS notif_status; - BD_ADDR bd_addr; /* remote MCE's BD address*/ -}tBTA_MSE_SET_NOTIF_REG; - -typedef struct -{ - tBTA_MA_STATUS status; - tBTA_MA_SESS_HANDLE mas_session_id; - tBTA_MA_INST_ID mas_instance_id; - tBTA_MA_NOTIF_STATUS notif_status; - BD_ADDR bd_addr; /* remote MCE's BD address*/ -}tBTA_MSE_NOTIF_REG; - - -/* Data associated with call back events */ -typedef union -{ - tBTA_MA_SESS_HANDLE mas_session_id; /* BTA_MSE_UPDATE_INBOX_EVT*/ - tBTA_MSE_ENABLE_DISABLE enable; - tBTA_MSE_ENABLE_DISABLE disable; - tBTA_MSE_ACCESS access; - tBTA_MSE_SET_NOTIF_REG set_notif_reg; - tBTA_MSE_NOTIF_REG notif_reg; - tBTA_MSE_MN_OPEN mn_open; - tBTA_MSE_MN_CLOSE mn_close; - tBTA_MSE_MA_OPEN ma_open; - tBTA_MSE_MA_CLOSE ma_close; - tBTA_MSE_SEND_NOTIF send_notif; - tBTA_MA_IN_PROG get_msg_in_prog; - tBTA_MA_IN_PROG push_msg_in_prog; - tBTA_MSE_OPER_CMPL oper_cmpl; - tBTA_MSE_START_STOP start; - tBTA_MSE_START_STOP stop; -} tBTA_MSE; - -/* MSE callback function */ -typedef void tBTA_MSE_CBACK(tBTA_MSE_EVT event, tBTA_MSE *p_data); - - -/******************************************** -** Message Notification Client Definitions -*********************************************/ - -/* Send Notification function arguments definition */ -enum -{ - BTA_MSE_NOTIF_TYPE_NEW_MSG = 0, - BTA_MSE_NOTIF_TYPE_DELIVERY_SUCCESS, - BTA_MSE_NOTIF_TYPE_SENDING_SUCCESS, - BTA_MSE_NOTIF_TYPE_DELIVERY_FAILURE, - BTA_MSE_NOTIF_TYPE_SENDING_FAILURE, - BTA_MSE_NOTIF_TYPE_MEMORY_FULL, - BTA_MSE_NOTIF_TYPE_MEMORY_AVAILABLE, - BTA_MSE_NOTIF_TYPE_MESSAGE_DELETED, - BTA_MSE_NOTIF_TYPE_MESSAGE_SHIFT, - BTA_MSE_NOTIF_TYPE_MAX -}; - -typedef UINT8 tBTA_MSE_NOTIF_TYPE; - -/* configuration related constant */ - - - -/* MSE configuration data */ -#define BTA_MSE_NUM_INST 4 -#define BTA_MSE_NUM_SESS 4 -#define BTA_MSE_NUM_MN 7 /* i.e. up to 7 MCEs can be connected to the MSE */ - -typedef struct -{ - INT32 obx_rsp_tout; /* maximum amount of time to wait for obx rsp */ - UINT16 max_name_len; /* maximum folder name length */ - -} tBTA_MSE_CFG; - -extern tBTA_MSE_CFG * p_bta_mse_cfg; -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - -/************************** -** API Functions -***************************/ - -/******************************************************************************* -** -** Function BTA_MseEnable -** -** Description Enable the MSE subsystems. This function must be -** called before any other functions in the MSE API are called. -** When the enable operation is completed the callback function -** will be called with an BTA_MSE_ENABLE_EVT event. -** -** Parameters p_cback - MSE event call back function -** app_id - Application ID -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseEnable(tBTA_MSE_CBACK *p_cback, UINT8 app_id); - -/******************************************************************************* -** -** Function BTA_MseDisable -** -** Description Disable the MSE subsystem. -** -** Parameters -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseDisable(void); -/******************************************************************************* -** -** Function BTA_MseStart -** -** Description Start a MA server on the MSE -** -** -** Parameters mas_inst_id - MAS instance ID -** sec_mask - Security Setting Mask -** MSE always enables -** (BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT) -** p_service_name - Pointer to service name -** p_root_path - Pointer to root path -** (one level above telecom) -** sup_msg_type - supported message type(s) -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseStart( tBTA_MA_INST_ID mas_inst_id, - tBTA_SEC sec_mask, const char *p_service_name, - const char *p_root_path, - tBTA_MA_MSG_TYPE sup_msg_type); -/******************************************************************************* -** -** Function BTA_MseStop -** -** Description Stop a MAS service on the MSE -** -** Parameters mas_instance_id - MAS Instance ID -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseStop (tBTA_MA_INST_ID mas_instance_id); - -/******************************************************************************* -** -** Function BTA_MseClose -** -** Description Close all MAS sessions on the specified MAS Instance ID -** -** Parameters mas_instance_id - MAS Inatance ID -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseClose(tBTA_MA_INST_ID mas_instance_id); - -/******************************************************************************* -** -** Function BTA_MseMaClose -** -** Description Close a MAS sessions on the specified BD address -** -** Parameters bd_addr - remote BD's address -** mas_instance_id - MAS Inatance ID -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseMaClose(BD_ADDR bd_addr, tBTA_MA_INST_ID mas_instance_id); - -/******************************************************************************* -** -** Function BTA_MseMnClose -** -** Description Close a MN session -** -** Parameters bd_addr - remote BT's address -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseMnClose(BD_ADDR bd_addr); - -/******************************************************************************* -** -** Function BTA_MseAccessRsp -** -** Description Send a response for the access request -** -** Parameters mas_session_id - MAS session ID -** oper - MAS operation type -** access - Access is allowed or not -** p_path - pointer to a path if if the operation -** involves accessing a folder -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseAccessRsp(tBTA_MA_SESS_HANDLE mas_session_id, tBTA_MSE_OPER oper, - tBTA_MA_ACCESS_TYPE access, char *p_name); - -/******************************************************************************* -** -** Function BTA_MseUpdateInboxRsp -** -** Description Send a response for the update inbox request -** -** -** Parameters mas_session_id - MAS session ID -** update_rsp - update inbox is allowed or not -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseUpdateInboxRsp(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MSE_UPDATE_INBOX_TYPE update_rsp); - -/******************************************************************************* -** -** Function BTA_MseSetNotifRegRsp -** -** Description Send a response for the set notification registration -** -** -** Parameters mas_session_id - MAS session ID -** set_notif_reg_rsp - indicate whether the set notification -** registration is allowed or not -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseSetNotifRegRsp(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MSE_SET_NOTIF_REG_TYPE set_notif_reg_rsp); - -/******************************************************************************* -** -** Function BTA_MseSendNotif -** -** Description Send a Message notification report to all MCEs registered with -** the specified MAS instance ID -** -** Parameters mas_instance_id - MAS Instance ID -** notif_type - message notification type -** handle - message handle -** p_folder - pointer to current folder -** p_old_folder - pointer to older folder -** msg_type - message type (E_MAIL, SMS_GSM, SMS_CDMA, MMS) -** except_bd_addr - except to the MCE on this BD Address. -** (Note: notification will be not sent to -** this BD Addreess) -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseSendNotif(tBTA_MA_INST_ID mas_instance_id, - tBTA_MSE_NOTIF_TYPE notif_type, - tBTA_MA_MSG_HANDLE handle, - char * p_folder, char *p_old_folder, - tBTA_MA_MSG_TYPE msg_type, - BD_ADDR except_bd_addr); - -/******************************************************************************* -** -** Function BTA_MseMnAbort -** -** Description Abort the current OBEX multi-packt operation -** -** Parameters mas_instance_id - MAS Instance ID -** -** Returns void -** -*******************************************************************************/ - BTA_API extern void BTA_MseMnAbort(tBTA_MA_INST_ID mas_instance_id); - -#ifdef __cplusplus -} -#endif - -#endif /* BTA_MSE_API_H */ diff --git a/bta/include/bta_mse_ci.h b/bta/include/bta_mse_ci.h deleted file mode 100644 index f366f16..0000000 --- a/bta/include/bta_mse_ci.h +++ /dev/null @@ -1,146 +0,0 @@ -/***************************************************************************** -** -** Name: bta_mse_ci.h -** -** Description: This is the interface file for the Message Server Equipment -** (MSE) subsystem call-out functions. -** -** Copyright (c) 2009, Broadcom Corp., All Rights Reserved. -** Broadcom Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_MSE_CI_H -#define BTA_MSE_CI_H - -#include "bta_api.h" -#include "bta_ma_def.h" -#include "bta_mse_api.h" -#include "bta_mse_co.h" - -/******************************************************************************* -** -** Function bta_mse_ci_get_folder_entry -** -** Description This function is called in response to the -** bta_mse_co_get_folder_entry call-out function. -** -** Parameters mas_session_id - MAS session ID -** status - BTA_MA_STATUS_OK if p_entry points to a valid entry. -** BTA_MA_STATUS_EODIR if no more entries (p_entry is ignored). -** BTA_MA_STATUS_FAIL if any errors have occurred. -** evt - evt from the call-out function -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_mse_ci_get_folder_entry(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MA_STATUS status, - UINT16 evt); -/******************************************************************************* -** -** Function bta_mse_ci_get_msg_list_info -** -** Description This function is called in response to the -** bta_mse_co_get_msg_list_info call-out function. -** -** Parameters mas_session_id - MAS session ID -** status - BTA_MA_STATUS_OK operation is successful. -** BTA_MA_STATUS_FAIL if any errors have occurred. -** evt - evt from the call-out function -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_mse_ci_get_msg_list_info(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MA_STATUS status, - UINT16 evt); -/******************************************************************************* -** -** Function bta_mse_ci_get_msg_list_entry -** -** Description This function is called in response to the -** bta_mse_co_get_msg_list_entry call-out function. -** -** Parameters mas_session_id - MAS session ID -** status - BTA_MA_STATUS_OK if p_entry points to a valid entry. -** BTA_MA_STATUS_EODIR if no more entries (p_entry is ignored). -** BTA_MA_STATUS_FAIL if any errors have occurred. -** evt - evt from the call-out function -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_mse_ci_get_msg_list_entry(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MA_STATUS status, - UINT16 evt); -/******************************************************************************* -** -** Function bta_mse_ci_get_msg -** -** Description This function is called in response to the -** bta_mse_co_get_msg call-out function. -** -** Parameters mas_session_id - MAS session ID -** status - BTA_MA_STATUS_OK if p_msg points to a valid bmessage. -** BTA_MA_STATUS_FAIL if any errors have occurred. -** filled_buff_size - size of the filled buffer -** multi_pkt_status - BTA_MA_MPKT_STATUS_MORE - need to get more packets -** BTA_MA_MPKT_STATUS_LAST - last packet of the bMessage -** frac_deliver_status - BTA_MA_FRAC_DELIVER_MORE - other fractions following -** this bMessage -** BTA_MA_FRAC_DELIVER_LAST - Last fraction -** evt - evt from the call-out function -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_mse_ci_get_msg(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MA_STATUS status, - UINT16 filled_buff_size, - tBTA_MA_MPKT_STATUS multi_pkt_status, - tBTA_MA_FRAC_DELIVER frac_deliver_status, - UINT16 evt); -/******************************************************************************* -** -** Function bta_mse_ci_set_msg_delete_status -** -** Description This function is called in response to the -** bta_mse_co_set_msg_delete_status call-out function. -** -** Parameters mas_session_id - MAS session ID -** status - BTA_MA_STATUS_OK if operation is successful. -** BTA_MA_STATUS_FAIL if any errors have occurred. -** evt - evt from the call-out function -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_mse_ci_set_msg_delete_status(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MA_STATUS status, - UINT16 evt); -/******************************************************************************* -** -** Function bta_mse_ci_push_msg -** -** Description This function is called in response to the -** bta_mse_co_push_msg call-out function. -** -** Parameters mas_session_id - MAS session ID -** status - BTA_MA_STATUS_OK if the message upload is successful. -** BTA_MA_STATUS_FAIL if any errors have occurred. -** last_packet - last packet of a multi-packet message -** handle - message handle for the uploaded message if -** status is BTA_MA_OK and last_packet is TRUE -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_mse_ci_push_msg(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MA_STATUS status, - BOOLEAN last_packet, - tBTA_MA_MSG_HANDLE handle, - UINT16 evt); -#endif /* BTA_MSE_CI_H */ - - - - diff --git a/bta/include/bta_mse_co.h b/bta/include/bta_mse_co.h deleted file mode 100644 index adc551f..0000000 --- a/bta/include/bta_mse_co.h +++ /dev/null @@ -1,330 +0,0 @@ -/***************************************************************************** -** -** Name: bta_mse_co.h -** -** Description: This is the interface file for the Message Server Equipment -** (MSE) subsystem call-out functions. -** -** Copyright (c) 2009-2011, Broadcom Corp., All Rights Reserved. -** Broadcom Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_MSE_CO_H -#define BTA_MSE_CO_H - -#include "bta_api.h" -#include "bta_ma_def.h" -#include "bta_mse_api.h" - -/***************************************************************************** -** Constants and Data Types -*****************************************************************************/ -/************************** -** Common Definitions -***************************/ - - -/* Return structure type for a folder entry i.e. only folder level - information under the specified path and no file name */ -typedef struct -{ - UINT32 refdata; /* holder for OS specific data used to get next entry */ - UINT32 filesize; - char *p_name; /* Contains the addr of memory to copy name into */ - char crtime[BTA_FS_CTIME_LEN]; /* "yyyymmddTHHMMSSZ", or "" if none */ - UINT8 mode; /* BTA_MSE_A_RDONLY and/or BTA_MSE_A_DIR */ -} tBTA_MSE_CO_FOLDER_ENTRY; - - -#define BTA_MSE_CO_MAX_ADDR_LEN 256 /* See MAP spec 3.1.6 */ -#define BTA_MSE_CO_MAX_DATE_TIME 21 /* "YYYYMMDDTHHMMSS+hhmm" or "YYYYMMDDTHHMMSS" */ - -enum -{ - BTA_MSE_CO_RCV_STATUS_COMPLETE = 0, - BTA_MSE_CO_RCV_STATUS_FRACTIONED, - BTA_MSE_CO_RCV_STATUS_NOTIFICATION, - BTA_MSE_CO_RCV_STATUS_MAX -}; - -typedef UINT8 tBTA_MSE_CO_RCV_STATUS; - -typedef struct -{ - UINT16 msg_list_size; - UINT8 mse_time_len; - char mse_time[BTA_FS_CTIME_LEN]; - BOOLEAN new_msg; -} tBTA_MSE_CO_MSG_LIST_INFO; - -typedef struct -{ - UINT32 refdata; /* holder for OS specific data used to get next msg entry */ - tBTA_MA_ML_MASK parameter_mask; - UINT32 org_msg_size; - UINT32 attachment_size; - BOOLEAN text; - BOOLEAN high_priority; - BOOLEAN read; - BOOLEAN sent; - BOOLEAN is_protected; - tBTA_MA_MSG_HANDLE msg_handle; - tBTA_MA_MSG_TYPE type; - tBTA_MSE_CO_RCV_STATUS reception_status; - char subject[BTA_MSE_CO_MAX_ADDR_LEN]; - char date_time[BTA_MSE_CO_MAX_DATE_TIME]; /* "YYYYMMDDTHHMMSS+hhmm", "YYYYMMDDTHHMMSS", or "" if none */ - char sender_name[BTA_MSE_CO_MAX_ADDR_LEN]; - char sender_addressing[BTA_MSE_CO_MAX_ADDR_LEN]; - char recipient_name[BTA_MSE_CO_MAX_ADDR_LEN]; - char recipient_addressing[BTA_MSE_CO_MAX_ADDR_LEN]; - char replyto_addressing[BTA_MSE_CO_MAX_ADDR_LEN]; -} tBTA_MSE_CO_MSG_LIST_ENTRY; - -/******************************************************************************* -** -** Function bta_mse_co_update_inbox -** -** Description Update the inbox -** -** Parameters mas_session_id - MAS session ID -** app_id - application ID specified in the enable functions. -** It can be used to identify which application -** is the caller of the call-out function. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_mse_co_update_inbox(tBTA_MA_SESS_HANDLE mas_session_id, UINT8 app_id); - -/******************************************************************************* -** -** Function bta_mse_co_set_folder -** -** Description Set the current foldeer to the specified path -** -** Parameters mas_session_id - MAS session ID -** p_path - points to the current folder path -** app_id - application ID specified in the enable functions. -** It can be used to identify which application -** is the caller of the call-out function. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_mse_co_set_folder(tBTA_MA_SESS_HANDLE mas_session_id, - const char *p_path, - UINT8 app_id); - -/******************************************************************************* -** -** Function bta_mse_co_get_folder_entry -** -** Description This function is called to get a folder entry for the -** specified path. The folder name should be filled -** into the location specified by p_entry. -** -** Parameters mas_session_id - MAS session ID -** p_path - points to the folder path to get the subfolder entry -** (fully qualified path) -** first_item - TRUE if first search, FALSE if next search -** p_entry (input/output) - Points to the current entry data -** evt - event that must be passed into the call-in function. -** app_id - application ID specified in the enable functions. -** It can be used to identify which application -** is the caller of the call-out function. -** -** Returns void -** -** Note: Upon completion of the request, the status is passed -** in the bta_mse_ci_get_folder_entry() call-in function. -** BTA_MA_STATUS_OK is returned when p_entry is valid, -** BTA_MA_STATUS_EODIR is returned when no more entries [finished] -** BTA_MA_STATUS_FAIL is returned if an error occurred -** -*******************************************************************************/ -BTA_API extern void bta_mse_co_get_folder_entry(tBTA_MA_SESS_HANDLE mas_session_id, const char *p_path, - BOOLEAN first_item, tBTA_MSE_CO_FOLDER_ENTRY *p_entry, - UINT16 evt, UINT8 app_id); - -/******************************************************************************* -** -** Function bta_mse_co_get_msg_list_info -** -** Description This function is called to get a message list information for -** the specified folder -** -** Parameters mas_session_id - MAS session ID -** p_name - points to the current or child folder for getting the -** message list information -** (if *p_name == "" it means current folder) -** filter_para - filter parameters for getting the message -** list information -** p_info(input/output) - Points to the message listing information -** evt - event that be passed into the call-in function. -** app_id - application ID specified in the enable functions. -** It can be used to identify which application -** is the caller of the call-out function. -** -** Returns void -** -** Note: Upon completion of the request, the status is passed -** in the bta_mse_ci_get_msg_list_info() call-in function. -** BTA_MA_STATUS_OK is returned when p_entry is valid -** BTA_MA_STATUS_FAIL is returned if an error occurred -** -*******************************************************************************/ -BTA_API extern void bta_mse_co_get_msg_list_info(tBTA_MA_SESS_HANDLE mas_session_id, const char *p_name, - tBTA_MA_MSG_LIST_FILTER_PARAM * p_filter_param, - tBTA_MSE_CO_MSG_LIST_INFO * p_info, - UINT16 evt, UINT8 app_id); -/******************************************************************************* -** -** Function bta_mse_co_get_msg_list_entry -** -** Description This function is called to retrieve a message list entry for -** the specified folder. The msg information should be filled by -** application into the location specified by p_entry. -** -** Parameters mas_session_id - MAS session ID -** p_name - points to the current or child folder for getting the -** message list entry -** (if *p_name == "" it means current folder) -** filter_para - filter parameters for getting message list -** first_item - TRUE if first get, FALSE if next msg -** p_entry(input/output) - Points to current entry data -** evt - event that must be passed into the call-in function. -** app_id - application ID specified in the enable functions. -** It can be used to identify which application -** is the caller of the call-out function. -** -** Returns void -** -** Note: Upon completion of the request, the status is passed -** in the bta_mse_ci_get_msg_list_entry() call-in function. -** BTA_MA_STATUS_OK is returned when p_entry is valid, -** BTA_MA_STATUS_EODIR is returned when no more entries [finished] -** BTA_MA_STATUS_FAIL is returned if an error occurred -*******************************************************************************/ -BTA_API extern void bta_mse_co_get_msg_list_entry(tBTA_MA_SESS_HANDLE mas_session_id, const char *p_name, - tBTA_MA_MSG_LIST_FILTER_PARAM *p_filter_param, - BOOLEAN first_item, tBTA_MSE_CO_MSG_LIST_ENTRY *p_entry, - UINT16 evt, UINT8 app_id); -/******************************************************************************* -** -** Function bta_mse_co_get_msg -** -** Description This function is called to retrieve a msessage for the -** specified message handle. The message will be filled by -** application in bMessage format into the location -** specified by p_buffer. The status and size of the filled -** buffer are returned by bta_mse_ci_get_msg() call-in function -** -** -** Parameters mas_session_id - MAS session ID -** p_param - points to the parameters for the get message operation -** first_get - TRUE first get FALSE subsequent get -** buffer_size - size of the buffer pointed by p_buffer -** p_buffer - points to the bMessage object storage location -** evt - event that be passed into the call-in function. -** app_id - application ID specified in the enable functions. -** It can be used to identify which application -** is the caller of the call-out function. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_mse_co_get_msg(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MA_GET_MSG_PARAM *p_param, - BOOLEAN first_get, - UINT16 buffer_size, - UINT8 *p_buffer, - UINT16 evt, - UINT8 app_id); - -/******************************************************************************* -** -** Function bta_mse_co_set_msg_delete_status -** -** Description This function is called to set a message delete status -** -** Parameters mas_session_id - MAS session ID -** handle - message handle -** status value - 1- yes, 0 = No -** evt_id - event that be passed into the call-in function. -** app_id - application ID specified in the enable functions. -** It can be used to identify which application -** is the caller of the call-out function. -** -** Returns void -** -** Note: Upon completion of the request, the status is passed -** in the bta_mse_ci_set_msg_delete_status() call-in function. -** BTA_MA_STATUS_OK is returned when the delete operation is successful -** BTA_MA_STATUS_FAIL is returned if an error occurred -*******************************************************************************/ -BTA_API extern void bta_mse_co_set_msg_delete_status(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MA_MSG_HANDLE handle, - UINT8 status_value, - UINT16 evt_id, - UINT8 app_id); - -/******************************************************************************* -** -** Function bta_mse_co_set_msg_read_status -** -** Description This function is called to set a message read status -** -** Parameters mas_session_id - MAS session ID -** handle - message handle -** status value - 1- yes, 0 = No -** app_id - application ID specified in the enable functions. -** It can be used to identify which application -** is the caller of the call-out function. -** -** Returns BTA_MA_STATUS_OK - read status change is successful -** BTA_MA_STATUS_FAIL -*******************************************************************************/ -BTA_API extern tBTA_MA_STATUS bta_mse_co_set_msg_read_status(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MA_MSG_HANDLE handle, - UINT8 status_value, - UINT8 app_id); - -/******************************************************************************* -** -** Function bta_mse_co_push_msg -** -** Description This function is called to upload a message to the -** specified folder -** -** Parameters mas_session_id - MAS session ID -** p_param - points to parameters for message upload -** msg_len - length of the message to be uploaded -** p_msg - points to the message to be uploaded -** first_pkt - TRUE first push message packet -** multi_pkt_status - -** BTA_MA_MPKT_STATUS_MORE - need to get more packets -** BTA_MA_MPKT_STATUS_LAST - last packet of -** the bMessage to be uploaded -** evt - event that be passed into the call-in function. -** app_id - application ID specified in the enable functions. -** It can be used to identify which application -** is the caller of the call-out function. -** -** Returns void -** -** Note1: Upon completion of the request, the status is passed -** in the bta_mse_ci_push_msg() call-in function. -** BTA_MA_STATUS_OK is returned if the request is successful, -** BTA_MA_STATUS_FAIL is returned if an error occurred -** -*******************************************************************************/ -BTA_API extern void bta_mse_co_push_msg(tBTA_MA_SESS_HANDLE mas_session_id, - tBTA_MA_PUSH_MSG_PARAM *p_param, - UINT16 msg_len, - UINT8 *p_msg, - BOOLEAN first_pkt, - tBTA_MA_MPKT_STATUS mpkt_status, - UINT16 evt, - UINT8 app_id); - -#endif /* BTA_MSE_CO_H */ diff --git a/bta/include/bta_op_api.h b/bta/include/bta_op_api.h index b2a624c..b333622 100644 --- a/bta/include/bta_op_api.h +++ b/bta/include/bta_op_api.h @@ -50,572 +50,5 @@ typedef UINT8 tBTA_OP_FMT; 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 */ diff --git a/bta/include/bta_pbs_api.h b/bta/include/bta_pbs_api.h index 41198ff..7d887ed 100644 --- a/bta/include/bta_pbs_api.h +++ b/bta/include/bta_pbs_api.h @@ -33,266 +33,4 @@ #define BTA_PBS_REPOSIT_LOCAL 0x01 /* Local PhoneBook */ #define BTA_PBS_REPOSIT_SIM 0x02 /* SIM card PhoneBook */ -enum -{ - BTA_PBS_VCF_FMT_21 = 0, /* vcard format 2.1 */ - BTA_PBS_VCF_FMT_30 /* vcard format 3.0 */ -}; -typedef UINT8 tBTA_PBS_VCF_FMT; - -enum -{ - BTA_PBS_ORDER_INDEX = 0, /* Default. vCard handle */ - BTA_PBS_ORDER_ALPHA_NUM, /* UTF8 name attribute, LastName then FirstName then MiddleName */ - BTA_PBS_ORDER_PHONETIC /* UTF8 representation of the sound attribute */ -}; -typedef UINT8 tBTA_PBS_ORDER; - -enum -{ - BTA_PBS_ATTR_NAME = 0, /* name */ - BTA_PBS_ATTR_NUMBER, /* number */ - BTA_PBS_ATTR_SOUND, /* sound */ - BTA_PBS_ATTR_MAX -}; -typedef UINT8 tBTA_PBS_ATTR; - -#define BTA_PBS_FILTER_VERSION (1<<0) /* vCard Version */ -#define BTA_PBS_FILTER_FN (1<<1) /* Formatted Name */ -#define BTA_PBS_FILTER_N (1<<2) /* Structured Presentation of Name */ -#define BTA_PBS_FILTER_PHOTO (1<<3) /* Associated Image or Photo */ -#define BTA_PBS_FILTER_BDAY (1<<4) /* Birthday */ -#define BTA_PBS_FILTER_ADR (1<<5) /* Delivery Address */ -#define BTA_PBS_FILTER_LABEL (1<<6) /* Delivery */ -#define BTA_PBS_FILTER_TEL (1<<7) /* Telephone Number */ -#define BTA_PBS_FILTER_EMAIL (1<<8) /* Electronic Mail Address */ -#define BTA_PBS_FILTER_MAILER (1<<9) /* Electronic Mail */ -#define BTA_PBS_FILTER_TZ (1<<10) /* Time Zone */ -#define BTA_PBS_FILTER_GEO (1<<11) /* Geographic Position */ -#define BTA_PBS_FILTER_TITLE (1<<12) /* Job */ -#define BTA_PBS_FILTER_ROLE (1<<13) /* Role within the Organization */ -#define BTA_PBS_FILTER_LOGO (1<<14) /* Organization Logo */ -#define BTA_PBS_FILTER_AGENT (1<<15) /* vCard of Person Representing */ -#define BTA_PBS_FILTER_ORG (1<<16) /* Name of Organization */ -#define BTA_PBS_FILTER_NOTE (1<<17) /* Comments */ -#define BTA_PBS_FILTER_REV (1<<18) /* Revision */ -#define BTA_PBS_FILTER_SOUND (1<<19) /* Pronunciation of Name */ -#define BTA_PBS_FILTER_URL (1<<20) /* Uniform Resource Locator */ -#define BTA_PBS_FILTER_UID (1<<21) /* Unique ID */ -#define BTA_PBS_FILTER_KEY (1<<22) /* Public Encryption Key */ -#define BTA_PBS_FILTER_NICKNAME (1<<23) /* Nickname */ -#define BTA_PBS_FILTER_CATEGORIES (1<<24) /* Categories */ -#define BTA_PBS_FILTER_PROID (1<<25) /* Product ID */ -#define BTA_PBS_FILTER_CLASS (1<<26) /* Class Information */ -#define BTA_PBS_FILTER_SORT_STRING (1<<27) /* String used for sorting operations */ -#define BTA_PBS_FILTER_TIME_STAMP (1<<28) /* Time Stamp */ -#define BTA_PBS_FILTER_PROPRIETARY (1<<39) /* Indicates the usage of a proprietary filter */ -#define BTA_PBS_FILTER_ALL (0) - -typedef UINT32 tBTA_PBS_FILTER_MASK; - -/* Access response types */ -enum -{ - BTA_PBS_ACCESS_TYPE_ALLOW = 0, /* Allow the requested operation */ - BTA_PBS_ACCESS_TYPE_FORBID, /* Disallow the requested operation */ - BTA_PBS_ACCESS_TYPE_PRECONDITION /* Get vCard Entry operation only (object handle invalid) */ -}; - -typedef UINT8 tBTA_PBS_ACCESS_TYPE; - -#define BTA_PBS_MAX_FILE_LEN 64 -#define BTA_PBS_MAX_CONTACT_NAME_LEN 128 - -/* Obex application params passed to open callout */ -typedef struct -{ - tBTA_PBS_FILTER_MASK filter; - tBTA_PBS_VCF_FMT format; - UINT16 max_count; - UINT16 start_offset; -} tBTA_PBS_PULLPB_APP_PARAMS; - -/* Obex application params passed to getvlist callout */ -typedef struct -{ - tBTA_PBS_ORDER order; - tBTA_PBS_ATTR attribute; - UINT8 p_value[64]; - UINT16 value_len; - UINT16 max_count; - UINT16 start_offset; -} tBTA_PBS_VCARDLIST_APP_PARAMS; - -/* VCard Listing structuture Returned by application*/ -typedef struct -{ - char handle[BTA_PBS_MAX_FILE_LEN]; /* Contains the vcf name */ - char name[BTA_PBS_MAX_CONTACT_NAME_LEN]; /* Contains the contacted name of the vlist */ -} tBTA_PBS_VCARDLIST; - -/* Access event operation types */ -#define BTA_PBS_OPER_NONE 0 -#define BTA_PBS_OPER_PULL_PB 1 -#define BTA_PBS_OPER_SET_PB 2 -#define BTA_PBS_OPER_PULL_VCARD_LIST 3 -#define BTA_PBS_OPER_PULL_VCARD_ENTRY 4 - -typedef UINT8 tBTA_PBS_OPER; - -/* Object type */ -#define BTA_PBS_NONE_OBJ 0 -#define BTA_PBS_PB_OBJ 1 -#define BTA_PBS_ICH_OBJ 2 -#define BTA_PBS_OCH_OBJ 3 -#define BTA_PBS_MCH_OBJ 4 -#define BTA_PBS_CCH_OBJ 5 - -typedef UINT8 tBTA_PBS_OBJ_TYPE; - - -/************************** -** Server Definitions -***************************/ -/* Extra Debug Code */ -#ifndef BTA_PBS_DEBUG -#define BTA_PBS_DEBUG FALSE -#endif - -#define BTA_PBS_OK 0 -#define BTA_PBS_FAIL 1 -typedef UINT8 tBTA_PBS_STATUS; - -/* Server callback function events */ -#define BTA_PBS_ENABLE_EVT 0 /* PB transfer server is enabled. */ -#define BTA_PBS_OPEN_EVT 1 /* Connection to peer is open. */ -#define BTA_PBS_CLOSE_EVT 2 /* Connection to peer closed. */ -#define BTA_PBS_AUTH_EVT 3 /* Request for Authentication key and realm */ -#define BTA_PBS_ACCESS_EVT 4 /* Request for access to put a file */ -#define BTA_PBS_OPER_CMPL_EVT 5 /* PB operation complete */ - -typedef UINT8 tBTA_PBS_EVT; - -/* Structure associated with BTA_PBS_OPER_CMPL_EVT */ -typedef struct -{ - char *p_name; /* file or folder name. */ - tBTA_PBS_OPER operation; - tBTA_PBS_STATUS status; -} tBTA_PBS_OBJECT; - -typedef struct -{ - UINT8 *p_userid; - UINT8 userid_len; - BOOLEAN userid_required; /* TRUE if user ID is required in response (rechallanged) */ -} tBTA_PBS_AUTH; - -typedef struct -{ - char *p_name; /* file or directory name with fully qualified path */ - tBTM_BD_NAME dev_name; /* Name of device, "" if unknown */ - tBTA_PBS_OPER oper; /* operation */ - BD_ADDR bd_addr; /* Address of device */ -} tBTA_PBS_ACCESS; - -typedef struct -{ - tBTM_BD_NAME dev_name; /* Name of device, "" if unknown */ - BD_ADDR bd_addr; /* Address of device */ -} tBTA_PBS_OPEN; - -typedef union -{ - tBTA_PBS_AUTH auth; - tBTA_PBS_ACCESS access; - tBTA_PBS_OBJECT obj; - tBTA_PBS_OPEN open; -} tBTA_PBS; - -/* Server callback function */ -typedef void tBTA_PBS_CBACK(tBTA_PBS_EVT event, tBTA_PBS *p_data); - -/************************** -** Server Functions -***************************/ - -/******************************************************************************* -** -** Function BTA_PbsEnable -** -** Description Enable the phone book access server. This function must be -** called before any other functions in the PB Server API are called. -** When the enable operation is complete the callback function -** will be called with an BTA_PBS_ENABLE_EVT event. -** Note: Pbs always enable (BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT) -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_PbsEnable(tBTA_SEC sec_mask, const char *p_service_name, - const char *p_root_path, BOOLEAN enable_authen, - UINT8 realm_len, UINT8 *p_realm, - tBTA_PBS_CBACK *p_cback, UINT8 app_id); - -/******************************************************************************* -** -** Function BTA_PbsDisable -** -** Description Disable the Phone book access server. If the server is currently -** connected to a peer device the connection will be closed. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_PbsDisable(void); - -/******************************************************************************* -** -** Function BTA_PbsAuthRsp -** -** Description Respond to obex client authenticate repond by sending back password to -** BTA. Called in response to an BTA_PBS_AUTH_EVT event. -** Used when "enable_authen" is set to TRUE in BTA_PbapsEnable(). -** -** Note: If the "userid_required" is TRUE in the BTA_PBS_AUTH_EVT -** event, then p_userid is required, otherwise it is optional. -** -** p_password must be less than BTA_PBS_MAX_AUTH_KEY_SIZE (16 bytes) -** p_userid must be less than OBX_MAX_REALM_LEN (defined in target.h) -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_PbsAuthRsp (char *p_password, char *p_userid); - -/******************************************************************************* -** -** Function BTA_PbsAccessRsp -** -** Description Sends a reply to an access request event (BTA_PBS_ACCESS_EVT). -** This call MUST be made whenever the event occurs. -** -** Parameters oper - operation being accessed. -** access - BTA_PBS_ACCESS_ALLOW or BTA_PBS_ACCESS_FORBID -** p_name - path of file or directory to be accessed. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_PbsAccessRsp(tBTA_PBS_OPER oper, tBTA_PBS_ACCESS_TYPE access, - char *p_name); - -/******************************************************************************* -** -** Function BTA_PbsClose -** -** Description Close the current connection. -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_PbsClose(void); #endif diff --git a/bta/include/bta_pbs_ci.h b/bta/include/bta_pbs_ci.h deleted file mode 100644 index e44f960..0000000 --- a/bta/include/bta_pbs_ci.h +++ /dev/null @@ -1,93 +0,0 @@ -/***************************************************************************** -** -** Name: bta_pbs_ci.h -** -** Description: This is the interface file for phone book access server -** call-in functions. -** -** Copyright (c) 2003, Widcomm Inc., All Rights Reserved. -** Widcomm Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_PBS_CI_H -#define BTA_PBS_CI_H - -#include "bta_pbs_co.h" - -/***************************************************************************** -** Constants and data types -*****************************************************************************/ - - -/***************************************************************************** -** Function Declarations -*****************************************************************************/ - - -/******************************************************************************* -** -** Function bta_pbs_ci_read -** -** Description This function sends an event to BTA indicating the phone has -** read in the requested amount of data specified in the -** bta_pbs_co_read() call-out function. -** -** Parameters fd - file descriptor passed to the stack in the -** bta_pbs_ci_open call-in function. -** num_bytes_read - number of bytes read into the buffer -** specified in the read callout-function. -** status - BTA_PBS_CO_OK if get buffer of data, -** BTA_PBS_CO_FAIL if an error has occurred. -** final - indicate whether it is the final data -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_pbs_ci_read(int fd, UINT16 num_bytes_read, - tBTA_PBS_CO_STATUS status, BOOLEAN final); - -/******************************************************************************* -** -** Function bta_pbs_ci_open -** -** Description This function sends an event to BTA indicating the phone has -** finished opening a pb for reading. -** -** Parameters fd - file descriptor passed to the stack in the -** bta_pbs_ci_open call-in function. -** status - BTA_PBS_CO_OK if file was opened in mode specified -** in the call-out function. -** BTA_PBS_CO_EACCES if the file exists, but contains -** the wrong access permissions. -** BTA_PBS_CO_FAIL if any other error has occurred. -** file_size - The total size of the file -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_pbs_ci_open(int fd, tBTA_PBS_CO_STATUS status, - UINT32 file_size); - -/******************************************************************************* -** -** Function bta_pbs_ci_getvlist -** -** Description This function sends an event to BTA indicating the phone has -** finished reading a VCard list entry. -** -** Parameters -** status - BTA_PBS_CO_OK if reading Vcard list entry -** BTA_PBS_CO_FAIL if any other error has occurred. -** final - whether it is the last entry -** -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_pbs_ci_getvlist(tBTA_PBS_CO_STATUS status, BOOLEAN final); - - -#endif - diff --git a/bta/include/bta_pbs_co.h b/bta/include/bta_pbs_co.h deleted file mode 100644 index 76ec75a..0000000 --- a/bta/include/bta_pbs_co.h +++ /dev/null @@ -1,160 +0,0 @@ -/***************************************************************************** -** -** Name: bta_pbs_co.h -** -** Description: This is the interface file for the phone book access server -** call-out functions. -** -** Copyright (c) 2003-2004, Widcomm Inc., All Rights Reserved. -** Widcomm Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_PBS_CO_H -#define BTA_PBS_CO_H - -#include "bta_api.h" -#include "goep_fs.h" -#include "bta_pbs_api.h" - - -/***************************************************************************** -** Constants and Data Types -*****************************************************************************/ -/************************** -** Common Definitions -***************************/ - -/* Status codes returned by call-out functions, or in call-in functions as status */ -#define BTA_PBS_CO_OK GOEP_OK -#define BTA_PBS_CO_FAIL GOEP_FAIL /* Used to pass all other errors */ -#define BTA_PBS_CO_EACCES GOEP_EACCES -#define BTA_PBS_CO_EOF GOEP_EOF -#define BTA_PBS_CO_EODIR GOEP_EODIR - -typedef UINT16 tBTA_PBS_CO_STATUS; - -#define BTA_PBS_LEN_UNKNOWN GOEP_LEN_UNKNOWN -#define BTA_PBS_INVALID_FD GOEP_INVALID_FD -#define BTA_PBS_INVALID_APP_ID (0xFF) /* this app_id is reserved */ - - -/***************************************************************************** -** Function Declarations -*****************************************************************************/ -/************************** -** Common Functions -***************************/ -/******************************************************************************* -** -** Function bta_pbs_co_open -** -** Description This function is executed by BTA when a pb file is requested to be opened. -** The phone book access profile server uses this function to open -** a file for reading on two phone book access operations -** (pull pb or pull pb entry) -** -** Parameters p_path - path and file name. -** operation - BTA_PB_OPER_PULL_PB or BTA_PB_OPER_PULL_VCARD_ENTRY -** p_app_params - obex application params -** -** -** Returns void -** -** Note: Upon completion of the request -** if successful, and an error code (tBTA_PBS_CO_STATUS) -** are returned in the call-in function, bta_pbs_ci_open(). -** -*******************************************************************************/ -BTA_API extern void bta_pbs_co_open(const char *p_path, tBTA_PBS_OPER operation, tBTA_PBS_PULLPB_APP_PARAMS *p_app_params); - -/******************************************************************************* -** -** Function bta_pbs_co_close -** -** Description This function is called by BTA when a connection to a -** client is closed. -** -** Parameters fd - file descriptor of file to close. -** -** -** Returns (tBTA_PBS_CO_STATUS) status of the call. -** [BTA_PBS_CO_OK if successful], -** [BTA_PBS_CO_FAIL if failed ] -** -*******************************************************************************/ -BTA_API extern tBTA_PBS_CO_STATUS bta_pbs_co_close(int fd); - -/******************************************************************************* -** -** Function bta_pbs_co_get_pbinfo -** -** Description This function is called by BTA to inquire about pb size and new missed calls. -** -** Parameters p_name: which type of phone book object Eg. telecom/pb.vcf, telecom/ich.vcf -** operation: phone book operation type Eg. BTA_PBS_OPER_PULL_PB -** obj_type: phone book repository type Eg. BTA_PBS_MCH_OBJ -** -** Returns pb_size - phone book size -** new_missed_call - new missed calls -* (tBTA_PBS_CO_STATUS) status of the call. -** [BTA_PBS_CO_OK if successful], -** [BTA_PBS_CO_FAIL if failed ] -** -*******************************************************************************/ -BTA_API extern tBTA_PBS_CO_STATUS bta_pbs_co_getpbinfo(tBTA_PBS_OPER operation, tBTA_PBS_OBJ_TYPE obj_type, UINT16 *pb_size, UINT16 *new_missed_call); - -/******************************************************************************* -** -** Function bta_pbs_co_read -** -** Description This function is called by BTA to read in data from the -** previously opened pb file on the phone. -** the application callin should fill in the PB object needed to be -** send to the client -** -** Parameters fd - file descriptor of file to read from. -** operation - BTA_PBS_OPER_PULL_PB or BTA_PBS_OPER_PULL_VCARD_ENTRY -** p_buf - buffer to read the data into. -** nbytes - number of bytes to read into the buffer. -** -** -** Returns void -** -** Note: Upon completion of the request, bta_pbs_ci_read() is -** called with the buffer of data, along with the number -** of bytes read into the buffer, and a status. -** -*******************************************************************************/ -BTA_API extern void bta_pbs_co_read(int fd, tBTA_PBS_OPER operation, UINT8 *p_buf, UINT16 nbytes); - - -/******************************************************************************* -** -** Function bta_pbs_co_getvlist -** -** Description This function is called to retrieve a vcard list entry for the -** specified path. -** The first/next directory should be filled by application -** into the location specified by p_entry. -** -** Parameters p_path - directory to search -** p_app_params - Obex application params, NULL if first_item is FALSE -** first_item - TRUE if first get, FALSE if next getvlist -** (p_entry contains previous) -** p_entry(input/output) - Points to prev entry data, the callout application need -** to fill in with the next entry -** -** -** Returns void -** -** Note: Upon completion of the request, bta_pbs_ci_getvlist() is -** called with the a status and final flag. -** -** -** -*******************************************************************************/ -BTA_API extern void bta_pbs_co_getvlist(const char *p_path, tBTA_PBS_VCARDLIST_APP_PARAMS *p_app_params, - BOOLEAN first_item, tBTA_PBS_VCARDLIST *p_entry); - - -#endif /* BTA_PBS_CO_H */ diff --git a/bta/include/bta_prm_api.h b/bta/include/bta_prm_api.h deleted file mode 100644 index 434888f..0000000 --- a/bta/include/bta_prm_api.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************** -** -** Name: bta_prm_api.h -** -** Description: This is the public interface file for the patch ram -** subsystem of BTA, Widcomm's -** Bluetooth application layer for mobile phones. -** -** Copyright (c) 2003-2005, Widcomm Inc., All Rights Reserved. -** Widcomm Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_PRM_API_H -#define BTA_PRM_API_H - -#include "bta_api.h" -#include "bta_sys.h" - -/* callback function */ -typedef void (tBTA_PRM_CBACK) (tBTA_STATUS status); - -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - -/******************************************************************************* -** -** Function BTA_PatchRam -** -** Description Patch Ram function -** -** Parameters p_cback - callback to indicate status of download operation. -** p_name - path and file name of the patch file. -** - if p_name is NULL, try to use patch data built into code. -** fs_app_id - app_id used by bta file system callout functions -** - to distinguish between applications which uses FS. -** address - address of patch ram -** -** -** Returns void -** -** -*******************************************************************************/ -BTA_API extern void BTA_PatchRam(tBTA_PRM_CBACK *p_cback, const char *p_name, - UINT8 fs_app_id, UINT32 address); - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/bta/include/bta_sc_api.h b/bta/include/bta_sc_api.h deleted file mode 100644 index 90e673f..0000000 --- a/bta/include/bta_sc_api.h +++ /dev/null @@ -1,193 +0,0 @@ -/***************************************************************************** -** -** Name: bta_sc_api.c -** -** Description: This is the implementation of the API for the SIM -** Card (SC) server subsystem of BTA, Widcomm's Bluetooth -** application layer for mobile phones. -** -** Copyright (c) 2004, Widcomm Inc., All Rights Reserved. -** Widcomm Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_SC_API_H -#define BTA_SC_API_H - -#include "bta_api.h" -#include "sap_api.h" - -/***************************************************************************** -** Constants and data types -*****************************************************************************/ - -/* Status of SIM card (for BTA_ScCardStatus) */ -#define BTA_SC_CARD_UNKNOWN_ERROR SAP_CARD_UNKNOWN_ERROR /* Unknown problem with SIM card. */ -#define BTA_SC_CARD_RESET SAP_CARD_RESET /* SIM inserted and powered on prior to SIM Access Profile connection. */ -#define BTA_SC_CARD_NOT_ACCESSIBLE SAP_CARD_NOT_ACCESSIBLE /* SIM inserted, but not accessible. */ -#define BTA_SC_CARD_REMOVED SAP_CARD_REMOVED /* SIM not inserted, or has been removed. */ -#define BTA_SC_CARD_INSERTED SAP_CARD_INSERTED /* SIM inserted, but not powered on. Client needs to power on the SIM before using it. */ -#define BTA_SC_CARD_RECOVERED SAP_CARD_RECOVERED /* Previously not accessible card has been made accessible again, and is powered on by server. */ -typedef UINT8 tBTA_SC_CARD_STATUS; - -/* Flags describing Card Reader options (for reader_flags parameter of BTA_ScEnable) */ -#define BTA_SC_READER_FL_REMOVABLE 0x0001 -typedef UINT16 tBTA_SC_READER_FLAGS; - -/* Status of card reader (for BTA_ScReaderStatus) */ -#define BTA_SC_READER_STATUS_ATTACHED 0 -#define BTA_SC_READER_STATUS_REMOVED 1 -typedef UINT8 tBTA_SC_READER_STATUS; - - -/* Disconnection type (for BTA_Disconnect) */ -#define BTA_SC_DISC_GRACEFUL SAP_DISCONNECT_GRACEFUL -#define BTA_SC_DISC_IMMEDIATE SAP_DISCONNECT_IMMEDIATE -typedef UINT8 tBTA_SC_DISCONNECT_TYPE; - -/* Server callback function events */ -#define BTA_SC_ENABLE_EVT 0 /* SIM Access server is enabled. */ -#define BTA_SC_OPEN_EVT 1 /* Connection to peer is open. */ -#define BTA_SC_CLOSE_EVT 2 /* Connection to peer closed. */ -// btla-specific ++ -#define BTA_SC_DISABLE_EVT 3 /* SIM Access server is disabled. */ -// btla-specific -- -typedef UINT8 tBTA_SC_EVT; - - -/* Results codes for use with call-in functions */ -#define BTA_SC_RESULT_OK SAP_RESULT_OK /* Request processed correctly. */ -#define BTA_SC_RESULT_ERROR SAP_RESULT_ERROR /* Error - no reason specified. */ -#define BTA_SC_RESULT_CARD_NOT_ACCESSIBLE SAP_RESULT_CARD_NOT_ACCESSIBLE /* Error - card inserted but not accessible. */ -#define BTA_SC_RESULT_CARD_POWERED_OFF SAP_RESULT_CARD_POWERED_OFF /* Error - card is powered off. */ -#define BTA_SC_RESULT_CARD_REMOVED SAP_RESULT_CARD_REMOVED /* Error - card is not inserted. */ -#define BTA_SC_RESULT_CARD_ALREADY_ON SAP_RESULT_CARD_ALREADY_ON /* Error - card already turned on. */ -#define BTA_SC_RESULT_DATA_NOT_AVAILABLE SAP_RESULT_DATA_NOT_AVAILABLE /* Error - data not available. */ -/* Request codes for use with call-in functions */ -#define BTA_SC_REQUEST_APDU (BTA_SC_RESULT_OK + 10) -typedef UINT8 tBTA_SC_RESULT; - - -/* Results codes for sim reset */ -#define BTA_SC_RESET_RESULT_OK 0 /* Reset successful */ -#define BTA_SC_RESET_RESULT_ERROR 1 /* Reset failed */ -#define BTA_SC_RESET_RESULT_OK_ONGOING_CALL 2 /* Ongoing call (will reset after call is released) */ -typedef UINT8 tBTA_SC_RESET_RESULT; - -/************************** -** Structure definitions -***************************/ -/* Event data for BTA_SC_OPEN_EVT */ -typedef struct -{ - BD_ADDR bd_addr; /* Client bd address */ -} tBTA_SC_OPEN; - - -/* Union of data types for BTA_SC callback function */ -typedef union -{ - tBTA_SC_OPEN open; -} tBTA_SC; - -/* Server callback function */ -typedef void tBTA_SC_CBACK (tBTA_SC_EVT event, tBTA_SC *p_data); - - -/***************************************************************************** -** External Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - - -/******************************************************************************* -** -** Function BTA_ScEnable -** -** Description Enable the SIM Card server. This function must be -** called before any other functions in the SC API are called. -** When the enable operation is complete the callback function -** will be called with a BTA_SC_ENABLE_EVT. -** -** Parameters -** sec_mask Security options -** p_service_name Service name for SDP record -** reader_id SIM Card Reader ID (for TRANSFER_CARD_READER_STATUS requests) -** reader_flags Flags describing card reader -** msg_size_min Min message size for SIM APDU commands -** msg_size_max Max message size for SIM APDU commands -** p_cback Callback for BTA_SC event notification -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_ScEnable(tBTA_SEC sec_mask, const char *p_service_name, - UINT8 reader_id, tBTA_SC_READER_FLAGS reader_flags, - UINT16 msg_size_min, UINT16 msg_size_max, - tBTA_SC_CBACK *p_cback); - -/******************************************************************************* -** -** Function BTA_ScDisable -** -** Description Disable the SIM Card server. -** -** Parameters none -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_ScDisable(void); - -/******************************************************************************* -** -** Function BTA_ScClose -** -** Description Close client connection. -** -** Parameters -** type Type of disconnection desired (BTA_SC_DISC_GRACEFUL or -** BTA_SC_DISC_IMMEDIATE) -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_ScClose(tBTA_SC_DISCONNECT_TYPE type); - - -/******************************************************************************* -** -** Function BTA_ScCardStatus -** -** Description Notify client of change in SIM card status -** -** Parameters -** status New status -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_ScCardStatus(tBTA_SC_CARD_STATUS status); - - -/******************************************************************************* -** -** Function BTA_ScReaderStatus -** -** Description Notify client of change in SIM card reader status -** -** Parameters -** status New status -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void BTA_ScReaderStatus(tBTA_SC_READER_STATUS status); - -#ifdef __cplusplus -} -#endif - -#endif /* BTA_SC_API_H */ diff --git a/bta/include/bta_sc_ci.h b/bta/include/bta_sc_ci.h deleted file mode 100644 index 10b11e6..0000000 --- a/bta/include/bta_sc_ci.h +++ /dev/null @@ -1,111 +0,0 @@ -/***************************************************************************** -** -** Name: bta_sc_ci.h -** -** Description: This is the interface file for SIM Access server -** call-in functions. -** -** Copyright (c) 2003, Widcomm Inc., All Rights Reserved. -** Widcomm Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_SC_CI_H -#define BTA_SC_CI_H - -#include "bta_sc_api.h" - -/***************************************************************************** -** Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - -/******************************************************************************* -** -** Function bta_sc_ci_apdu -** -** Description This function sends an event to SC to indicate the APDU request -** has been completed or requested -** -** Parameters -** result result of operation or request of operation -** p_apdu response buffer for APDU command (if result=BTA_SC_RESULT_OK) -** or request buffer for APDU command (if result=BTA_SC_REQUEST_APDU) -** apdulen length of response or request buffer -** is_apdu_7816 TRUE if format of apdu data is APDU7816 -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_ci_apdu(tBTA_SC_RESULT result, UINT8 *p_apdu, UINT16 apdulen, BOOLEAN is_apdu_7816); - -/******************************************************************************* -** -** Function bta_sc_ci_atr -** -** Description This function sends an event to SC to indicate the ATR request -** has been completed -** -** Parameters -** result result of operation -** p_atr response buffer for ATR request (if result=BTA_SC_RESULT_OK) -** atrlen length of response buffer -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_ci_atr(tBTA_SC_RESULT result, UINT8 *p_atr, UINT16 atrlen); - -/******************************************************************************* -** -** Function bta_sc_ci_sim_on -** -** Description This function sends an event to SC to indicate the SIM_ON request -** has been completed -** -** Parameters -** result result of operation -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_ci_sim_on(tBTA_SC_RESULT result); - -/******************************************************************************* -** -** Function bta_sc_ci_sim_off -** -** Description This function sends an event to SC to indicate the SIM_OFF request -** has been completed -** -** Parameters -** result result of operation -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_ci_sim_off(tBTA_SC_RESULT result); - -/******************************************************************************* -** -** Function bta_sc_ci_sim_reset -** -** Description This function sends an event to SC to indicate the SIM_RESET request -** has been completed -** -** Parameters -** result result of operation -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_ci_sim_reset(tBTA_SC_RESET_RESULT result); - -#ifdef __cplusplus -} -#endif - -#endif /* BTA_SC_CI_H */ - diff --git a/bta/include/bta_sc_co.h b/bta/include/bta_sc_co.h deleted file mode 100644 index a088823..0000000 --- a/bta/include/bta_sc_co.h +++ /dev/null @@ -1,153 +0,0 @@ -/***************************************************************************** -** -** Name: bta_sc_co.h -** -** Description: This is the interface file for the SIM access -** server call-out functions. -** -** Copyright (c) 2003, Widcomm Inc., All Rights Reserved. -** Widcomm Bluetooth Core. Proprietary and confidential. -** -*****************************************************************************/ -#ifndef BTA_SC_CO_H -#define BTA_SC_CO_H - -#include "bta_sc_api.h" - -/***************************************************************************** -** Constants and Data Types -*****************************************************************************/ - -/***************************************************************************** -** Function Declarations -*****************************************************************************/ -#ifdef __cplusplus -extern "C" -{ -#endif - -/******************************************************************************* -** -** Function bta_sc_co_sim_opem -** -** Description Called when client connection is opened, in case any special -** handling or intialization of the SIM is required. -** -** Parameters -** None. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_co_sim_open(void); - -/******************************************************************************* -** -** Function bta_sc_co_sim_close -** -** Description Called when client connection is closed. -** -** Parameters -** None. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_co_sim_close(void); - -/******************************************************************************* -** -** Function bta_sc_co_sim_reset -** -** Description This function is called by BTA to reset the SIM card -** -** Once SIM has been turned reset, call bta_sc_ci_sim_reset(). -** -** Parameters -** None. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_co_sim_reset(void); - -/******************************************************************************* -** -** Function bta_sc_co_sim_off -** -** Description This function is called by BTA to turn the SIM card off -** -** Once SIM has been turned on, call bta_sc_ci_sim_on(). -** -** Parameters -** None. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_co_sim_off(void); - -/******************************************************************************* -** -** Function bta_sc_co_sim_on -** -** Description This function is called by BTA to turn the SIM card on -** -** Once SIM has been turned on, call bta_sc_ci_sim_on(). -** -** Parameters -** None. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_co_sim_on(void); - -/******************************************************************************* -** -** Function bta_sc_co_atr -** -** Description This function is called by BTA to retrieve ATR information -** (operational requirements of the SIM, as described in -** section 5.8 of GSM 11.11) -** -** Once the ATR information is retrieved, call bta_sc_ci_atr(). -** -** Parameters -** None. -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_co_atr(void); - -/******************************************************************************* -** -** Function bta_sc_co_apdu -** -** Description This function is called by BTA to to transfer APDU command -** messages to the SIM. Generally used for selecting, storing -** and retrieving data from the SIM. -** -** Once the command has been completed, call bta_sc_ci_apdu() -** with the result. -** -** Parameters -** p_apdu_req Pointer to the APDU message from the client. Format -** is described in section 9 of GSM 11.11 -** -** req_len Length of APDU message. -** -** rsp_maxlen Maximum length of response message allowed by client -** (negotiated during CONNECT_REQ) -** -** Returns void -** -*******************************************************************************/ -BTA_API extern void bta_sc_co_apdu(UINT8 *p_apdu_req, UINT16 req_len, UINT16 rsp_maxlen, BOOLEAN is_apdu_7816); - -#ifdef __cplusplus -} -#endif - -#endif /* BTA_SC_CO_H */ |