summaryrefslogtreecommitdiffstats
path: root/stack/include
diff options
context:
space:
mode:
authorHarish Paryani <hparyani@broadcom.com>2012-04-03 23:49:45 -0700
committerMatthew Xie <mattx@google.com>2012-07-14 11:19:14 -0700
commit66aa5171e4e7c9f942971a30419c03134e67a4a4 (patch)
tree60fe10f29e7c3a574dcc317567a3c9bf05c85387 /stack/include
parent04db88d9bd23fa98916e031987f3ba2063783acc (diff)
downloadexternal_bluetooth_bluedroid-66aa5171e4e7c9f942971a30419c03134e67a4a4.zip
external_bluetooth_bluedroid-66aa5171e4e7c9f942971a30419c03134e67a4a4.tar.gz
external_bluetooth_bluedroid-66aa5171e4e7c9f942971a30419c03134e67a4a4.tar.bz2
Check in for - new rfc multi accept code
Change-Id: I66794a8821481c58e045bb8acd8b7b758900d3e9
Diffstat (limited to 'stack/include')
-rw-r--r--stack/include/port_api.h129
-rw-r--r--stack/include/sdp_api.h52
2 files changed, 108 insertions, 73 deletions
diff --git a/stack/include/port_api.h b/stack/include/port_api.h
index 26e0299..b7a7417 100644
--- a/stack/include/port_api.h
+++ b/stack/include/port_api.h
@@ -17,11 +17,11 @@
** Constants and Types
*****************************************************************************/
-/*
-** Define port settings structure send from the application in the
+/*
+** Define port settings structure send from the application in the
** set settings request, or to the application in the set settings indication.
*/
-typedef struct
+typedef struct
{
#define PORT_BAUD_RATE_2400 0x00
@@ -79,11 +79,17 @@ typedef struct
} tPORT_STATE;
-/*
+/*
** Define the callback function prototypes. Parameters are specific
-** to each event and are described bellow
+** to each event and are described bellow
*/
typedef int (tPORT_DATA_CALLBACK) (UINT16 port_handle, void *p_data, UINT16 len);
+
+#define DATA_CO_CALLBACK_TYPE_INCOMING 1
+#define DATA_CO_CALLBACK_TYPE_OUTGOING_SIZE 2
+#define DATA_CO_CALLBACK_TYPE_OUTGOING 3
+typedef int (tPORT_DATA_CO_CALLBACK) (UINT16 port_handle, UINT8* p_buf, UINT16 len, int type);
+
typedef void (tPORT_CALLBACK) (UINT32 code, UINT16 port_handle);
/*
@@ -112,7 +118,7 @@ typedef void (tPORT_CALLBACK) (UINT32 code, UINT16 port_handle);
#define PORT_EV_FCS 0x00020000 /* data flow enable status true = enabled */
/*
-** To register for events application should provide bitmask with
+** To register for events application should provide bitmask with
** corresponding bit set
*/
@@ -125,7 +131,7 @@ typedef void (tPORT_CALLBACK) (UINT32 code, UINT16 port_handle);
/*
-** Define port result codes
+** Define port result codes
*/
#define PORT_SUCCESS 0
@@ -169,18 +175,18 @@ extern "C"
**
** Function RFCOMM_CreateConnection
**
-** Description RFCOMM_CreateConnection function is used from the application
-** to establish serial port connection to the peer device,
-** or allow RFCOMM to accept a connection from the peer
-** application.
+** Description RFCOMM_CreateConnection function is used from the application
+** to establish serial port connection to the peer device,
+** or allow RFCOMM to accept a connection from the peer
+** application.
**
-** Parameters: scn - Service Channel Number as registered with
-** the SDP (server) or obtained using SDP from
+** Parameters: scn - Service Channel Number as registered with
+** the SDP (server) or obtained using SDP from
** the peer device (client).
** is_server - TRUE if requesting application is a server
** mtu - Maximum frame size the application can accept
** bd_addr - BD_ADDR of the peer (client)
-** mask - specifies events to be enabled. A value
+** mask - specifies events to be enabled. A value
** of zero disables all events.
** p_handle - OUT pointer to the handle.
** p_mgmt_cb - pointer to callback function to receive
@@ -220,7 +226,7 @@ RFC_API extern int RFCOMM_RemoveConnection (UINT16 handle);
**
** Description This function is called to close the server port.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
**
*******************************************************************************/
RFC_API extern int RFCOMM_RemoveServer (UINT16 handle);
@@ -233,8 +239,8 @@ RFC_API extern int RFCOMM_RemoveServer (UINT16 handle);
** Description Set event callback the specified connection.
**
** Parameters: handle - Handle of the port returned in the Open
-** p_callback - address of the callback function which should
-** be called from the RFCOMM when an event
+** p_callback - address of the callback function which should
+** be called from the RFCOMM when an event
** specified in the mask occurs.
**
*******************************************************************************/
@@ -249,15 +255,15 @@ RFC_API extern int PORT_SetEventCallback (UINT16 port_handle,
** Description Set event data callback the specified connection.
**
** Parameters: handle - Handle of the port returned in the Open
-** p_callback - address of the callback function which should
-** be called from the RFCOMM when a data
+** p_callback - address of the callback function which should
+** be called from the RFCOMM when a data
** packet is received.
**
*******************************************************************************/
RFC_API extern int PORT_SetDataCallback (UINT16 port_handle,
tPORT_DATA_CALLBACK *p_cb);
-
+RFC_API extern int PORT_SetDataCOCallback (UINT16 port_handle, tPORT_DATA_CO_CALLBACK *p_port_cb);
/*******************************************************************************
**
** Function PORT_SetEventMask
@@ -265,7 +271,7 @@ RFC_API extern int PORT_SetDataCallback (UINT16 port_handle,
** Description This function is called to close the specified connection.
**
** Parameters: handle - Handle of the port returned in the Open
-** mask - specifies events to be enabled. A value
+** mask - specifies events to be enabled. A value
** of zero disables all events.
**
*******************************************************************************/
@@ -304,11 +310,11 @@ RFC_API extern BOOLEAN PORT_IsOpening (BD_ADDR bd_addr);
**
** Function PORT_SetState
**
-** Description This function configures connection according to the
+** Description This function configures connection according to the
** specifications in the tPORT_STATE structure.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
-** p_settings - Pointer to a tPORT_STATE structure containing
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** p_settings - Pointer to a tPORT_STATE structure containing
** configuration information for the connection.
**
*******************************************************************************/
@@ -320,7 +326,7 @@ RFC_API extern int PORT_SetState (UINT16 handle, tPORT_STATE *p_settings);
**
** Description This function return number of buffers on the rx queue.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
** p_rx_queue_count - Pointer to return queue count in.
**
*******************************************************************************/
@@ -333,7 +339,7 @@ RFC_API extern int PORT_GetRxQueueCnt (UINT16 handle, UINT16 *p_rx_queue_count);
** Description This function is called to fill tPORT_STATE structure
** with the current control settings for the port
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
** p_settings - Pointer to a tPORT_STATE structure in which
** configuration information is returned.
**
@@ -345,10 +351,10 @@ RFC_API extern int PORT_GetState (UINT16 handle, tPORT_STATE *p_settings);
**
** Function PORT_Control
**
-** Description This function directs a specified connection to pass control
+** Description This function directs a specified connection to pass control
** control information to the peer device.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
** signal - specify the function to be passed
**
*******************************************************************************/
@@ -369,11 +375,11 @@ RFC_API extern int PORT_Control (UINT16 handle, UINT8 signal);
**
** Function PORT_FlowControl
**
-** Description This function directs a specified connection to pass
-** flow control message to the peer device. Enable flag passed
+** Description This function directs a specified connection to pass
+** flow control message to the peer device. Enable flag passed
** shows if port can accept more data.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
** enable - enables data flow
**
*******************************************************************************/
@@ -384,12 +390,12 @@ RFC_API extern int PORT_FlowControl (UINT16 handle, BOOLEAN enable);
**
** Function PORT_GetModemStatus
**
-** Description This function retrieves modem control signals. Normally
-** application will call this function after a callback
-** function is called with notification that one of signals
+** Description This function retrieves modem control signals. Normally
+** application will call this function after a callback
+** function is called with notification that one of signals
** has been changed.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
** callback.
** p_signal - specify the pointer to control signals info
**
@@ -415,14 +421,14 @@ RFC_API extern int PORT_GetModemStatus (UINT16 handle, UINT8 *p_control_signal);
** Function PORT_ClearError
**
** Description This function retreives information about a communications
-** error and reports current status of a connection. The
+** error and reports current status of a connection. The
** function should be called when an error occures to clear
** the connection error flag and to enable additional read
** and write operations.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
** p_errors - pointer of the variable to receive error codes
-** p_status - pointer to the tPORT_STATUS structur to receive
+** p_status - pointer to the tPORT_STATUS structur to receive
** connection status
**
*******************************************************************************/
@@ -456,7 +462,7 @@ RFC_API extern int PORT_ClearError (UINT16 handle, UINT16 *p_errors,
**
** Description This function send a communications error to the peer device
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
** errors - receive error codes
**
*******************************************************************************/
@@ -467,10 +473,10 @@ RFC_API extern int PORT_SendError (UINT16 handle, UINT8 errors);
**
** Function PORT_GetQueueStatus
**
-** Description This function reports current status of a connection.
+** Description This function reports current status of a connection.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
-** p_status - pointer to the tPORT_STATUS structur to receive
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** p_status - pointer to the tPORT_STATUS structur to receive
** connection status
**
*******************************************************************************/
@@ -481,11 +487,11 @@ RFC_API extern int PORT_GetQueueStatus (UINT16 handle, tPORT_STATUS *p_status);
**
** Function PORT_Purge
**
-** Description This function discards all the data from the output or
+** Description This function discards all the data from the output or
** input queues of the specified connection.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
-** purge_flags - specify the action to take.
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** purge_flags - specify the action to take.
**
*******************************************************************************/
#define PORT_PURGE_TXCLEAR 0x01
@@ -498,15 +504,15 @@ RFC_API extern int PORT_Purge (UINT16 handle, UINT8 purge_flags);
**
** Function PORT_Read
**
-** Description This function returns the pointer to the buffer received
-** from the peer device. Normally application will call this
-** function after receiving PORT_EVT_RXCHAR event.
+** Description This function returns the pointer to the buffer received
+** from the peer device. Normally application will call this
+** function after receiving PORT_EVT_RXCHAR event.
** Application calling this function is responsible to free
** buffer returned.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
** callback.
-** pp_buf - pointer to address of buffer with data,
+** pp_buf - pointer to address of buffer with data,
**
*******************************************************************************/
RFC_API extern int PORT_Read (UINT16 handle, BT_HDR **pp_buf);
@@ -519,7 +525,7 @@ RFC_API extern int PORT_Read (UINT16 handle, BT_HDR **pp_buf);
** Description Normally application will call this function after receiving
** PORT_EVT_RXCHAR event.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
** callback.
** p_data - Data area
** max_len - Byte count requested
@@ -537,8 +543,8 @@ RFC_API extern int PORT_ReadData (UINT16 handle, char *p_data, UINT16 max_len,
** Description This function to send BT buffer to the peer device.
** Application should not free the buffer.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
-** p_buf - pointer to the buffer with data,
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** p_buf - pointer to the buffer with data,
**
*******************************************************************************/
RFC_API extern int PORT_Write (UINT16 handle, BT_HDR *p_buf);
@@ -548,10 +554,10 @@ RFC_API extern int PORT_Write (UINT16 handle, BT_HDR *p_buf);
**
** Function PORT_WriteData
**
-** Description This function is called from the legacy application to
-** send data.
+** Description This function is called from the legacy application to
+** send data.
**
-** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
** p_data - Data area
** max_len - Byte count to write
** p_len - Bytes written
@@ -560,6 +566,17 @@ RFC_API extern int PORT_Write (UINT16 handle, BT_HDR *p_buf);
RFC_API extern int PORT_WriteData (UINT16 handle, char *p_data, UINT16 max_len,
UINT16 *p_len);
+/*******************************************************************************
+**
+** Function PORT_WriteDataCO
+**
+** Description Normally not GKI aware application will call this function
+** to send data to the port by callout functions.
+**
+** Parameters: handle - Handle returned in the RFCOMM_CreateConnection
+**
+*******************************************************************************/
+RFC_API extern int PORT_WriteDataCO (UINT16 handle, int* p_len);
/*******************************************************************************
**
diff --git a/stack/include/sdp_api.h b/stack/include/sdp_api.h
index 00de801..e4774c3 100644
--- a/stack/include/sdp_api.h
+++ b/stack/include/sdp_api.h
@@ -68,6 +68,7 @@
/* Define a callback function for when discovery is complete. */
typedef void (tSDP_DISC_CMPL_CB) (UINT16 result);
+typedef void (tSDP_DISC_CMPL_CB2) (UINT16 result, void* user_data);
typedef struct
{
@@ -138,14 +139,14 @@ typedef struct
}tSDP_DISCOVERY_DB;
/* This structure is used to add protocol lists and find protocol elements */
-typedef struct
+typedef struct
{
UINT16 protocol_uuid;
UINT16 num_params;
UINT16 params[SDP_MAX_PROTOCOL_PARAMS];
} tSDP_PROTOCOL_ELEM;
-typedef struct
+typedef struct
{
UINT16 num_elems;
tSDP_PROTOCOL_ELEM list_elem[SDP_MAX_LIST_ELEMS];
@@ -160,7 +161,7 @@ typedef struct t_sdp_di_record
UINT16 vendor_id_source;
UINT16 product;
UINT16 version;
- BOOLEAN primary_record;
+ BOOLEAN primary_record;
char client_executable_url[SDP_MAX_ATTR_LEN]; /* optional */
char service_description[SDP_MAX_ATTR_LEN]; /* optional */
char documentation_url[SDP_MAX_ATTR_LEN]; /* optional */
@@ -203,9 +204,9 @@ SDP_API extern BOOLEAN SDP_InitDiscoveryDb (tSDP_DISCOVERY_DB *p_db, UINT32 len,
**
** Function SDP_CancelServiceSearch
**
-** Description This function cancels an active query to an SDP server.
+** Description This function cancels an active query to an SDP server.
**
-** Returns TRUE if discovery cancelled, FALSE if a matching activity is not found.
+** Returns TRUE if discovery cancelled, FALSE if a matching activity is not found.
**
*******************************************************************************/
SDP_API extern BOOLEAN SDP_CancelServiceSearch (tSDP_DISCOVERY_DB *p_db);
@@ -214,9 +215,9 @@ SDP_API extern BOOLEAN SDP_CancelServiceSearch (tSDP_DISCOVERY_DB *p_db);
**
** Function SDP_ServiceSearchRequest
**
-** Description This function queries an SDP server for information.
+** Description This function queries an SDP server for information.
**
-** Returns TRUE if discovery started, FALSE if failed.
+** Returns TRUE if discovery started, FALSE if failed.
**
*******************************************************************************/
SDP_API extern BOOLEAN SDP_ServiceSearchRequest (UINT8 *p_bd_addr,
@@ -228,19 +229,36 @@ SDP_API extern BOOLEAN SDP_ServiceSearchRequest (UINT8 *p_bd_addr,
**
** Function SDP_ServiceSearchAttributeRequest
**
-** Description This function queries an SDP server for information.
+** Description This function queries an SDP server for information.
**
** The difference between this API function and the function
-** SDP_ServiceSearchRequest is that this one does a
+** SDP_ServiceSearchRequest is that this one does a
** combined ServiceSearchAttributeRequest SDP function.
**
-** Returns TRUE if discovery started, FALSE if failed.
+** Returns TRUE if discovery started, FALSE if failed.
**
*******************************************************************************/
SDP_API extern BOOLEAN SDP_ServiceSearchAttributeRequest (UINT8 *p_bd_addr,
tSDP_DISCOVERY_DB *p_db,
tSDP_DISC_CMPL_CB *p_cb);
+/*******************************************************************************
+**
+** Function SDP_ServiceSearchAttributeRequest2
+**
+** Description This function queries an SDP server for information.
+**
+** The difference between this API function and the function
+** SDP_ServiceSearchRequest is that this one does a
+** combined ServiceSearchAttributeRequest SDP function with the
+** user data piggyback
+**
+** Returns TRUE if discovery started, FALSE if failed.
+**
+*******************************************************************************/
+SDP_API extern BOOLEAN SDP_ServiceSearchAttributeRequest2 (UINT8 *p_bd_addr,
+ tSDP_DISCOVERY_DB *p_db,
+ tSDP_DISC_CMPL_CB2 *p_cb, void * user_data);
/* API of utilities to find data in the local discovery database */
@@ -351,7 +369,7 @@ SDP_API extern BOOLEAN SDP_FindAddProtoListsElemInRec (tSDP_DISC_REC *p_rec,
**
** Description This function looks at a specific discovery record for the
** Profile list descriptor, and pulls out the version number.
-** The version number consists of an 8-bit major version and
+** The version number consists of an 8-bit major version and
** an 8-bit minor version.
**
** Returns TRUE if found, FALSE if not
@@ -568,7 +586,7 @@ SDP_API extern BOOLEAN SDP_DeleteAttribute (UINT32 handle, UINT16 attr_id);
**
** Function SDP_SetLocalDiRecord
**
-** Description This function adds a DI record to the local SDP database.
+** Description This function adds a DI record to the local SDP database.
**
** Returns Returns SDP_SUCCESS if record added successfully, else error
**
@@ -622,7 +640,7 @@ SDP_API extern UINT8 SDP_GetNumDiRecords (tSDP_DISCOVERY_DB *p_db);
** Function SDP_GetDiRecord
**
** Description This function retrieves a remote device's DI record from
-** the specified database.
+** the specified database.
**
** Returns SDP_SUCCESS if record retrieved, else error
**
@@ -649,7 +667,7 @@ SDP_API extern UINT8 SDP_SetTraceLevel (UINT8 new_level);
** Function SDP_ConnOpen
**
** Description This function creates a connection to the SDP server on the
-** given device.
+** given device.
**
** Returns 0, if failed to initiate connection. Otherwise, the handle.
**
@@ -663,7 +681,7 @@ SDP_API UINT32 SDP_ConnOpen (UINT8 *p_bd_addr, tSDP_DISC_RES_CB *p_rcb,
**
** Description This function sends data to the connected SDP server.
**
-** Returns TRUE if data is sent, FALSE if failed.
+** Returns TRUE if data is sent, FALSE if failed.
**
*******************************************************************************/
SDP_API BOOLEAN SDP_WriteData (UINT32 handle, BT_HDR *p_msg);
@@ -676,7 +694,7 @@ SDP_API BOOLEAN SDP_WriteData (UINT32 handle, BT_HDR *p_msg);
**
** Parameters: handle - Handle of the connection returned by SDP_ConnOpen
**
-** Returns TRUE if connection is closed, FALSE if failed to find the handle.
+** Returns TRUE if connection is closed, FALSE if failed to find the handle.
**
*******************************************************************************/
SDP_API BOOLEAN SDP_ConnClose (UINT32 handle);
@@ -690,7 +708,7 @@ SDP_API BOOLEAN SDP_ConnClose (UINT32 handle);
**
** Parameters: p_rec - pointer to a SDP record.
**
-** Returns TRUE if found, otherwise FALSE.
+** Returns TRUE if found, otherwise FALSE.
**
*******************************************************************************/
SDP_API BOOLEAN SDP_FindServiceUUIDInRec(tSDP_DISC_REC *p_rec, tBT_UUID *p_uuid);