⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 btifdefinitions.h

📁 基于widcomm的蓝牙传输功能程序
💻 H
📖 第 1 页 / 共 4 页
字号:
*  | OBEX_USER_TYPE_UNI   | p_string  | Pointer to null   |
*  |                      |           | terminated        |
*  |                      |           | UNICODE text      |
*  |                      |           | string            |
*  |                      |-----------|-------------------|
*  |                      | length    | Number of         |
*  |                      |           | characters in     |
*  |                      |           | the UNICODE text  |
*  |                      |           | string (including |
*  |                      |           | the terminating   |
*  |                      |           | NULL character)   |
*  |----------------------|-----------|-------------------|
*  | OBEX_USER_TYPE_ARRAY | p_array   | Pointer to        |
*  |                      |           | unstructured      |
*  |                      |           | octet array       |
*  |                      |-----------|-------------------|
*  |                      | length    | Number octets of  |
*  |                      |           | data in the array |
*  |----------------------|-----------|-------------------|
*  | OBEX_USER_TYPE_BYTE  | user_byte | One byte of       |
*  |                      |           | user data         |
*  |                      |-----------|-------------------|
*  |                      | length    | N/A               |
*  |----------------------|-----------|-------------------|
*  | OBEX_USER_TYPE_INT   | user_int  | One 32-bit        |
*  |                      |           | integer of user   |
*  |                      |           | data              |
*  |                      |-----------|-------------------|
*  |                      | length    | N/A               |
*   ---------------------- ----------- -------------------
*
* If the application has registered with OBEX as being 'well behaved',
* it is assumed that each 'p_array' and 'p_string' member in use 
* points to a GKI buffer and ownership of each buffer will follow the 
* rules specified above for the tOBEX_HEADERS structure.  If the 
* application has not registered with OBEX as being 'well behaved', 
* the OBEX API functions assume that each 'p_array' member points to 
* static memory it does not alter that memory.  OBEX also assumes 
* that the Application Callback Functions will treat the memory 
* pointed to by each 'p_array' member as static and will not alter 
* that memory.
*/
typedef struct 
{ 
    UINT8   id;
#define OBEX_USER_TYPE_MASK  0xC0
#define OBEX_USER_TYPE_UNI   0x00 /* Null terminated ASCII text */
#define OBEX_USER_TYPE_ARRAY 0x40 /* Unstructured octet array */
#define OBEX_USER_TYPE_BYTE  0x80 /* Single byte */
#define OBEX_USER_TYPE_INT   0xC0 /* 32 bit integer */
    UINT16  length;
    union
    {
        WCHAR   *p_string;
        UINT8   *p_array;
        UINT8   user_byte;
        UINT32  user_int;
    } value;
} tOBEX_USER_HDR;



/*
* The following is the tOBEX_HEADERS structure.
*
* The 'rsp_code' member contains the OBEX Response Code used in the
* OBEX Response Packet.  It is stored without the high-order (final) 
* bit set.  The OBEX Core manages the 'final bit' in Response 
* Packets internally.  When the Server Application calls an OBEX 
* Server API Function it indicates the success or failure of the request
* by passing a tOBEX_ERRORS enumerator to the appropriate API.  If the
* Server Application wants to be more specific in the type of error 
* returned to the Client Application, it can set the specific OBEX 
* Response Code desired in the 'rsp_code' member of the tOBEX_HEADERS
* structure.  If the Server Application does not set the 'rsp_code'
* member to a valid tOBEX_ERRORS enumerator, the OBEX Core will
* generate an appropriate OBEX Response Code based on the tOBEX_ERRORS
* enumerator passed as a parameter to the Confirmation API Function and
* the current operation being performed.
*
* The 'flag' member indicates which headers are present.
*
* If the 'flag' member indicates that the Count Header is 
* present, the 'count' member of the tOBEX_HEADERS structure
* will contain the value found in the Count Header.
*
* If the 'flag' member indicates that the Name Header, Type Header,
* Description Header, Target Header, HTTP Header, Body (or 
* End-of-Body) Header, Who Header, Application Request-Response Header, 
* Authentication Challenge Header, Authentication Response Header, 
* Object Class Header or User Defined Header is present, the 
* corresponding data will be present in the tOBEX_HEADERS structure 
* as specified above.
*
* If the 'flag' member indicates that the Length Header is
* present, the 'hint_of_length' member of the tOBEX_HEADERS 
* structure will contain the value found in the Length Header.
*
* THE FOLLOWING DESCRIPTION APPLIES ONLY TO THE OBEX NON_LEGACY API:    
* If the 'flag' member indicates that the Time Header is present, 
* the 'time' member contains the contents of the Time Header
* as seconds since midnight, January 1, 1970, UTC ('Universal
* Coordinated Time' also known as GMT or 'Greenwich Mean Time') or
* Local Time.  The 'time_qualifier' member of the tOBEX_HEADERS 
* structure indicates whether the time in the header is UTC or Local 
* Time.  The 'IrDA Object Exchange Protocol (IrOBEX)' specification 
* recommends that the Time Header be formatted according to ISO 8601.
* The OBEX core performs the conversion between the ISO 8601 format
* and the tOBEX_HEADERS structure format as appropriate.
* END OF OBEX NON-LEGACY API DESCRIPTION
*
* NOTE!!!!!
*   The bit positions for each header represented in the 'flag' member
*   must not be altered because the OBEX Core relies on them being
*   assigned as defined here.
* 
*/
typedef struct
{
    UINT32              flag;
#define OBEX_FLAG_INTERNAL1         0x00000001  /* Used internally by OBEX Core */
#define OBEX_FLAG_COUNT             0x00000002 
#define OBEX_FLAG_NAME              0x00000004 
#define OBEX_FLAG_TYPE              0x00000008 
#define OBEX_FLAG_LENGTH            0x00000010 
#define OBEX_FLAG_OBJECT_CLASS      0x00000020 
#define OBEX_FLAG_TARGET            0x00000040 
#define OBEX_FLAG_WHO               0x00000080 
#define OBEX_FLAG_TIME              0x00000100 
#define OBEX_FLAG_INTERNAL2         0x00000200  /* Used internally by OBEX Core */
#define OBEX_FLAG_DESCRIPTION       0x00000400 
#define OBEX_FLAG_AUTH_CHALLENGE    0x00000800 
#define OBEX_FLAG_AUTH_RESPONSE     0x00001000 
#define OBEX_FLAG_HTTP              0x00002000 
#define OBEX_FLAG_APPL_REQ_RSP      0x00004000 
#define OBEX_FLAG_USER_DEFINED      0x00008000
#define OBEX_FLAG_BODY              0x00010000
#define OBEX_FLAG_BODY_END          0x00020000
/* flag bits legal for applications to set */
#define OBEX_FLAG_LEGAL_BITS \
       (OBEX_FLAG_COUNT + \
        OBEX_FLAG_NAME + \
        OBEX_FLAG_TYPE + \
        OBEX_FLAG_LENGTH + \
        OBEX_FLAG_OBJECT_CLASS + \
        OBEX_FLAG_TARGET + \
        OBEX_FLAG_WHO + \
        OBEX_FLAG_TIME + \
        OBEX_FLAG_DESCRIPTION + \
        OBEX_FLAG_AUTH_CHALLENGE + \
        OBEX_FLAG_AUTH_RESPONSE + \
        OBEX_FLAG_HTTP + \
        OBEX_FLAG_APPL_REQ_RSP + \
        OBEX_FLAG_USER_DEFINED + \
        OBEX_FLAG_BODY + \
        OBEX_FLAG_BODY_END)
    UINT32              internal1;  /* Used internally by OBEX Core */
    UINT32              count;
    tOBEX_UNI_HDR       uni_name;
    tOBEX_OCTET_HDR     type;
    UINT32              hint_of_length;
    tOBEX_OCTET_HDR     object_class;
    UINT32              num_target;
    tOBEX_OCTET_HDR     target[OBEX_MAX_TARGET];
    tOBEX_OCTET_HDR     who;
    UINT32              time_value;
    UINT8               time_qualifier;
#define OBEX_TIME_LOCAL     0x01
#define OBEX_TIME_UTC       0x02
    tOBEX_UNI_HDR       uni_description;
    UINT32              num_auth_challenge;
    tOBEX_HDR_TRIPLET   auth_challenge[OBEX_MAX_AUTH_CHALLENGE];
    UINT32              num_auth_response;
    tOBEX_HDR_TRIPLET   auth_response[OBEX_MAX_AUTH_RESPONSE];
    UINT32              num_http;
    tOBEX_OCTET_HDR     http[OBEX_MAX_HTTP];
    UINT32              num_app_param;
    tOBEX_HDR_TRIPLET   app_param[OBEX_MAX_APP_PARAM];
    UINT32              num_user;
    tOBEX_USER_HDR      user[OBEX_MAX_USER_HDR];
    tOBEX_OCTET_HDR     body;
} tOBEX_HEADERS;


#endif // !defined (WIDCOMMSDK_EXPORTS)

/* Define the L2CAP connection result codes
*/
#define L2CAP_CONN_OK                0
#define L2CAP_CONN_PENDING           1
#define L2CAP_CONN_NO_PSM            2
#define L2CAP_CONN_SECURITY_BLOCK    3
#define L2CAP_CONN_NO_RESOURCES      4
#define L2CAP_CONN_TIMEOUT           0xEEEE
#define L2CAP_CONN_CFG_UNACCEPTABLE_PARAMS   5       //
#define L2CAP_CONN_CFG_FAILED_NO_REASON      6       // added SDK 6.0.1.300 
#define L2CAP_CONN_CFG_UNKNOWN_OPTIONS       7       //


#define L2CAP_CONN_NO_LINK           255        /* Add a couple of our own for internal use */


// Define a structure to hold the configuration parameters. Since the
// parameters are optional, for each parameter there is a boolean to
// use to signify its presence or absemce.
//
// NOTE:  This structure is used externally from (or above) the SDK
//        and is mapped to the tL2CAP_CFG_INFO structure when used
//        in the CL2CapConn::Reconfigure method.  This is done so we
//        only expose BOOL types externally.
//
typedef struct
{
    UINT16      result;                 // Only used in confirm messages
    BOOL        mtu_present;
    UINT16      mtu;
    BOOL        qos_present;
    FLOW_SPEC   qos;
    BOOL        flush_to_present;
    UINT16      flush_to;

    UINT16      flags;                  // Internally used by L2CAP

} tL2CAP_CONFIG_INFO;

typedef struct
{
    BD_ADDR     bda;
    GUID        guid;
    char        szServiceName[BT_MAX_SERVICE_NAME_LEN];
    short       com_port;
} tBT_REM_ASSOC_REC;

#ifndef BTM_API_H
/////////////////////////////////////////////////////////////////////////////////////////
//  Definitions for SCO APIs
//

/***************
**  SCO Types
****************/
#define BTM_LINK_TYPE_SCO           HCI_LINK_TYPE_SCO
#define BTM_LINK_TYPE_ESCO          HCI_LINK_TYPE_ESCO
typedef UINT8 tBTM_SCO_TYPE;


#define HCI_SUCCESS                     0x00

/******************
**  eSCO Constants
*******************/
/*Transmit/Receive Bandwidth */
#define BTM_64KBITS_RATE            0x00001f40  /* 64 kbits/sec data rate */

/* Max Latency Range
could be in the range 0x0004 - 0xfffe the value is in milliseconds.
or do not care oxffff
*/ 
#define BTM_ESCO_MAX_LAT_DONTCARE   0xffff

/*voice format */
#define BTM_ESCO_VOICE_SETTING      0x0060      /* CVSD */

/*pack types */
#define BTM_ESCO_PKT_TYPES_MASK_EV3 0x0008

/* Retransmission effort */
#define BTM_ESCO_RETRANS_OFF        0
#define BTM_ESCO_RETRANS_POWER      1
#define BTM_ESCO_RETRANS_QUALITY    2
#define BTM_ESCO_RETRANS_DONTCARE   0xff


/* tBTM_ESCO_CBACK event types */
#define BTM_ESCO_CHG_EVT        1
#define BTM_ESCO_CONN_REQ_EVT   2
typedef UINT8 tBTM_ESCO_EVT;

/* Passed into BTM_SetEScoMode() */
typedef struct
{
    UINT32 tx_bw;
    UINT32 rx_bw;
    UINT16 max_latency;
    UINT16 voice_contfmt;  /* Voice Settings or Content Format */
    UINT16 packet_types;
    UINT8  retrans_effort;
} tBTM_ESCO_PARAMS;

typedef struct
{
    UINT16 max_latency;
    UINT16 packet_types;
    UINT8  retrans_effort;
} tBTM_CHG_ESCO_PARAMS;

/* Returned by BTM_ReadEScoLinkParms() */
typedef struct
{
    UINT16  rx_pkt_len;
    UINT16  tx_pkt_len;
    BD_ADDR bd_addr;
    UINT8   link_type;  /* BTM_LINK_TYPE_SCO or BTM_LINK_TYPE_ESCO */
    UINT8   tx_interval;
    UINT8   retrans_window;
    UINT8   air_mode;
} tBTM_ESCO_DATA;

typedef struct
{
    UINT16  sco_inx;
    UINT16  rx_pkt_len;
    UINT16  tx_pkt_len;
    BD_ADDR bd_addr;
    UINT8   hci_status;
    UINT8   tx_interval;
    UINT8   retrans_window;
} tBTM_CHG_ESCO_EVT_DATA;

typedef struct
{
    UINT16        sco_inx;
    BD_ADDR       bd_addr;
    DEV_CLASS     dev_class;
    tBTM_SCO_TYPE link_type;
} tBTM_ESCO_CONN_REQ_EVT_DATA;

typedef union
{
    tBTM_CHG_ESCO_EVT_DATA      chg_evt;
    tBTM_ESCO_CONN_REQ_EVT_DATA conn_evt;
} tBTM_ESCO_EVT_DATA;


/***************************
**  eSCO Callback Functions
****************************/
typedef void (tBTM_ESCO_CBACK) (tBTM_ESCO_EVT event, tBTM_ESCO_EVT_DATA *p_data);

#endif //BTM_API_H

#ifdef _WIN32_WCE
#pragma pack ()
#else
#include <poppack.h>
#endif

#endif // !defined(AFX_WIDCOMMTYPES_H__1F5ED990_6FC6_4B0D_882C_8D7C98C16A06__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -