📄 btifdefinitions.h
字号:
UINT16 uuid16;
UINT32 uuid32;
UINT8 uuid128[MAX_UUID_SIZE];
} uu;
} tBT_UUID;
#endif
// Define the service record attribute IDs.
//
#define ATTR_ID_SERVICE_RECORD_HDL 0x0000
#define ATTR_ID_SERVICE_CLASS_ID_LIST 0x0001
#define ATTR_ID_SERVICE_RECORD_STATE 0x0002
#define ATTR_ID_SERVICE_ID 0x0003
#define ATTR_ID_PROTOCOL_DESC_LIST 0x0004
#define ATTR_ID_BROWSE_GROUP_LIST 0x0005
#define ATTR_ID_LANGUAGE_BASE_ATTR_ID_LIST 0x0006
#define ATTR_ID_SERVICE_INFO_TIME_TO_LIVE 0x0007
#define ATTR_ID_SERVICE_AVAILABILITY 0x0008
#define ATTR_ID_BT_PROFILE_DESC_LIST 0x0009
#define ATTR_ID_DOCUMENTATION_URL 0x000A
#define ATTR_ID_CLIENT_EXE_URL 0x000B
#define ATTR_ID_ICON_URL 0x000C
#define ATTR_ID_ADDITION_PROTO_DESC_LISTS 0x000D
#define LANGUAGE_BASE_ID 0x0100
#define ATTR_ID_SERVICE_NAME (LANGUAGE_BASE_ID + 0x0000)
#define ATTR_ID_SERVICE_DESCRIPTION (LANGUAGE_BASE_ID + 0x0001)
#define ATTR_ID_PROVIDER_NAME (LANGUAGE_BASE_ID + 0x0002)
#define ATTR_ID_VERSION_OR_GROUP 0x0200
#define ATTR_ID_VERSION_NUMBER_LIST ATTR_ID_VERSION_OR_GROUP
#define ATTR_ID_GROUP_ID ATTR_ID_VERSION_OR_GROUP
#define ATTR_ID_SERVICE_DATABASE_STATE 0x0201
#define ATTR_ID_DATA_STORES_OR_NETWORK 0x0301
#define ATTR_ID_SUPPORTED_DATA_STORES ATTR_ID_DATA_STORES_OR_NETWORK
#define ATTR_ID_EXTERNAL_NETWORK ATTR_ID_DATA_STORES_OR_NETWORK
#define ATTR_ID_FAX_1_OR_AUD_VOL_OR_DEV_NAME 0x0302
#define ATTR_ID_FAX_CLASS_1_OR_AUDIO_VOLUME ATTR_ID_FAX_1_OR_AUD_VOL_OR_DEV_NAME
#define ATTR_ID_FAX_CLASS_1_SUPPORT ATTR_ID_FAX_1_OR_AUD_VOL_OR_DEV_NAME
#define ATTR_ID_REMOTE_AUDIO_VOLUME_CONTROL ATTR_ID_FAX_1_OR_AUD_VOL_OR_DEV_NAME
#define ATTR_ID_DEVICE_NAME ATTR_ID_FAX_1_OR_AUD_VOL_OR_DEV_NAME
#define ATTR_ID_FORMATS_OR_FAX_2_0 0x0303
#define ATTR_ID_SUPPORTED_FORMATS_LIST ATTR_ID_FORMATS_OR_FAX_2_0
#define ATTR_ID_FAX_CLASS_2_0_SUPPORT ATTR_ID_FORMATS_OR_FAX_2_0
#define ATTR_ID_FAX_CLASS_2_OR_FRIENDLY_NAME 0x0304
#define ATTR_ID_FAX_CLASS_2_SUPPORT ATTR_ID_FAX_CLASS_2_OR_FRIENDLY_NAME
#define ATTR_ID_FRIENDLY_NAME ATTR_ID_FAX_CLASS_2_OR_FRIENDLY_NAME
#define ATTR_ID_AUDIO_FEEDBACK_SUPPORT 0x0305
// Define for service attribute, all the 'Descriptor Type' values.
// These are also referred to as 'attribute type' values
#define NULL_DESC_TYPE 0
#define UINT_DESC_TYPE 1
#define TWO_COMP_INT_DESC_TYPE 2
#define UUID_DESC_TYPE 3
#define TEXT_STR_DESC_TYPE 4
#define BOOLEAN_DESC_TYPE 5
#define DATA_ELE_SEQ_DESC_TYPE 6
#define DATA_ELE_ALT_DESC_TYPE 7
#define URL_DESC_TYPE 8
// Define common 16-bit protocol UUIDs
//
#define UUID_PROTOCOL_SDP 0x0001
#define UUID_PROTOCOL_UDP 0x0002
#define UUID_PROTOCOL_RFCOMM 0x0003
#define UUID_PROTOCOL_TCP 0x0004
#define UUID_PROTOCOL_TCS_BIN 0x0005
#define UUID_PROTOCOL_TCS_AT 0x0006
#define UUID_PROTOCOL_OBEX 0x0008
#define UUID_PROTOCOL_IP 0x0009
#define UUID_PROTOCOL_FTP 0x000A
#define UUID_PROTOCOL_HTTP 0x000C
#define UUID_PROTOCOL_WSP 0x000E
#define UUID_PROTOCOL_BNEP 0x000F
#define UUID_PROTOCOL_UPNP 0x0010
#define UUID_PROTOCOL_HIDP 0x0011
#define UUID_PROTOCOL_HCRP_CTRL 0x0012
#define UUID_PROTOCOL_HCRP_DATA 0x0014
#define UUID_PROTOCOL_HCRP_NOTIF 0x0016
#define UUID_PROTOCOL_AVCTP 0x0017
#define UUID_PROTOCOL_AVDTP 0x0019
#define UUID_PROTOCOL_L2CAP 0x0100
// Define common 16-bit service class UUIDs
//
#define UUID_SERVCLASS_SERVICE_DISCOVERY_SERVER 0X1000
#define UUID_SERVCLASS_BROWSE_GROUP_DESCRIPTOR 0X1001
#define UUID_SERVCLASS_PUBLIC_BROWSE_GROUP 0X1002
#define UUID_SERVCLASS_SERIAL_PORT 0X1101
#define UUID_SERVCLASS_LAN_ACCESS_USING_PPP 0X1102
#define UUID_SERVCLASS_DIALUP_NETWORKING 0X1103
#define UUID_SERVCLASS_IRMC_SYNC 0X1104
#define UUID_SERVCLASS_OBEX_OBJECT_PUSH 0X1105
#define UUID_SERVCLASS_OBEX_FILE_TRANSFER 0X1106
#define UUID_SERVCLASS_IRMC_SYNC_COMMAND 0X1107
#define UUID_SERVCLASS_HEADSET 0X1108
#define UUID_SERVCLASS_CORDLESS_TELEPHONY 0X1109
#define UUID_SERVCLASS_INTERCOM 0X1110
#define UUID_SERVCLASS_FAX 0X1111
#define UUID_SERVCLASS_HEADSET_AUDIO_GATEWAY 0X1112
#define UUID_SERVCLASS_PNP_INFORMATION 0X1200
#define UUID_SERVCLASS_GENERIC_NETWORKING 0X1201
#define UUID_SERVCLASS_GENERIC_FILETRANSFER 0X1202
#define UUID_SERVCLASS_GENERIC_AUDIO 0X1203
#define UUID_SERVCLASS_GENERIC_TELEPHONY 0X1204
#define UUID_SERVCLASS_AUDIO_SINK 0X110B
////////////////////////////////////////////////////////////////////////////////
// Definitions for RFCOMM and PORT functions
//
//
// Define port settings structure send from the application in the
// set settings request, or to the application in the set settings indication.
//
typedef struct
{
#define PORT_BAUD_RATE_2400 0x00
#define PORT_BAUD_RATE_4800 0x01
#define PORT_BAUD_RATE_7200 0x02
#define PORT_BAUD_RATE_9600 0x03
#define PORT_BAUD_RATE_19200 0x04
#define PORT_BAUD_RATE_38400 0x05
#define PORT_BAUD_RATE_57600 0x06
#define PORT_BAUD_RATE_115200 0x07
#define PORT_BAUD_RATE_230400 0x08
UINT8 baud_rate;
#define PORT_5_BITS 0x00
#define PORT_6_BITS 0x01
#define PORT_7_BITS 0x02
#define PORT_8_BITS 0x03
UINT8 byte_size;
#define PORT_ONESTOPBIT 0x00
#define PORT_ONE5STOPBITS 0x01
UINT8 stop_bits;
#define PORT_PARITY_NO 0x00
#define PORT_PARITY_YES 0x01
UINT8 parity;
#define PORT_ODD_PARITY 0x00
#define PORT_EVEN_PARITY 0x01
#define PORT_MARK_PARITY 0x02
#define PORT_SPACE_PARITY 0x03
UINT8 parity_type;
#define PORT_FC_OFF 0x00
#define PORT_FC_XONXOFF_ON_INPUT 0x01
#define PORT_FC_XONXOFF_ON_OUTPUT 0x02
#define PORT_FC_CTS_ON_INPUT 0x04
#define PORT_FC_CTS_ON_OUTPUT 0x08
#define PORT_FC_DSR_ON_INPUT 0x10
#define PORT_FC_DSR_ON_OUTPUT 0x20
UINT8 fc_type;
UINT8 rx_char1;
#define PORT_XON_DC1 0x11
UINT8 xon_char;
#define PORT_XOFF_DC3 0x13
UINT8 xoff_char;
} tPORT_STATE;
typedef struct
{
#define PORT_FLAG_CTS_HOLD 0x01 /* Tx is waiting for CTS signal */
#define PORT_FLAG_DSR_HOLD 0x02 /* Tx is waiting for DSR signal */
#define PORT_FLAG_RLSD_HOLD 0x04 /* Tx is waiting for RLSD signal */
UINT16 flags;
UINT16 in_queue_size; /* Number of bytes in the input queue */
UINT16 out_queue_size; /* Number of bytes in the output queue */
} tPORT_STATUS;
//
// Define RFCOMM Port events that registered application can receive
// in the callback
//
#define PORT_EV_RXCHAR 0x00000001 /* Any Character received */
#define PORT_EV_RXFLAG 0x00000002 /* Received certain character */
#define PORT_EV_TXEMPTY 0x00000004 /* Transmitt Queue Empty */
#define PORT_EV_CTS 0x00000008 /* CTS changed state */
#define PORT_EV_DSR 0x00000010 /* DSR changed state */
#define PORT_EV_RLSD 0x00000020 /* RLSD changed state */
#define PORT_EV_BREAK 0x00000040 /* BREAK received */
#define PORT_EV_ERR 0x00000080 /* Line status error occurred */
#define PORT_EV_RING 0x00000100 /* Ring signal detected */
#define PORT_EV_CTSS 0x00000400 /* CTS state */
#define PORT_EV_DSRS 0x00000800 /* DSR state */
#define PORT_EV_RLSDS 0x00001000 /* RLSD state */
#define PORT_EV_OVERRUN 0x00002000 /* receiver buffer overrun */
#define PORT_EV_TXCHAR 0x00004000 /* Any character transmitted */
#define PORT_EV_CONNECTED 0x00000200 /* RFCOMM connection established */
#define PORT_EV_CONNECT_ERR 0x00008000 /* Was not able to establish connection */
/* or disconnected */
#define PORT_EV_FC 0x00010000 /* flow control enabled flag changed by remote */
#define PORT_EV_FCS 0x00020000 /* flow control status true = enabled */
//
// To register for RFCOMM events application should provide bitmask with
// corresponding bit set
//
#define PORT_MASK_ALL (PORT_EV_RXCHAR | PORT_EV_TXEMPTY | PORT_EV_CTS | \
PORT_EV_DSR | PORT_EV_RLSD | PORT_EV_BREAK | \
PORT_EV_ERR | PORT_EV_RING | PORT_EV_CONNECT_ERR | \
PORT_EV_DSRS | PORT_EV_CTSS | PORT_EV_RLSDS | \
PORT_EV_RXFLAG | PORT_EV_TXCHAR | PORT_EV_OVERRUN | \
PORT_EV_CONNECTED | PORT_EV_FC | PORT_EV_FCS)
//
// Definitions used by RFCOMM to set control leads
//
#define PORT_SET_DTRDSR 0x01
#define PORT_CLR_DTRDSR 0x02
#define PORT_SET_CTSRTS 0x03
#define PORT_CLR_CTSRTS 0x04
#define PORT_SET_RI 0x05 /* DCE only */
#define PORT_CLR_RI 0x06 /* DCE only */
#define PORT_SET_DCD 0x07 /* DCE only */
#define PORT_CLR_DCD 0x08 /* DCE only */
#define PORT_SET_BREAK 0x09
#define PORT_CLR_BREAK 0x0A
//
// RFCOMM Port modem control leads
//
#define PORT_DTRDSR_ON 0x01
#define PORT_CTSRTS_ON 0x02
#define PORT_RING_ON 0x04
#define PORT_DCD_ON 0x08
//
// RFCOMM Port errors
//
#define PORT_ERR_BREAK 0x01 /* Break condition occured on the peer device */
#define PORT_ERR_OVERRUN 0x02 /* Overrun is reported by peer device */
#define PORT_ERR_FRAME 0x04 /* Framing error reported by peer device */
#define PORT_ERR_RXOVER 0x08 /* Input queue overflow occured */
#define PORT_ERR_TXFULL 0x10 /* Output queue overflow occured */
//
// Flags used in the RFCOMM Port purge function
//
#define PORT_PURGE_TXCLEAR 0x01
#define PORT_PURGE_RXCLEAR 0x02
//
// RFCOMM default MTU size
//
#define RFCOMM_DEFAULT_MTU 127
//
// Valid Security Service Levels
//
#define BTM_SEC_NONE 0x0000 /* Nothing required */
#define BTM_SEC_IN_AUTHORIZE 0x0001 /* Inbound call requires authorization */
#define BTM_SEC_IN_AUTHENTICATE 0x0002 /* Inbound call requires authentication */
#define BTM_SEC_IN_ENCRYPT 0x0004 /* Inbound call requires encryption */
#define BTM_SEC_OUT_AUTHORIZE 0x0008 /* Outbound call requires authorization */
#define BTM_SEC_OUT_AUTHENTICATE 0x0010 /* Outbound call requires authentication */
#define BTM_SEC_OUT_ENCRYPT 0x0020 /* Outbound call requires encryption */
#define BTM_SEC_BOND 0x0040 /* Bonding */
//
// definitions for security
//
//
// Predefined security services
//
#define BTM_SEC_SERVICE_SDP_SERVER 0
#define BTM_SEC_SERVICE_SERIAL_PORT 1
#define BTM_SEC_SERVICE_LAN_ACCESS 2
#define BTM_SEC_SERVICE_DUN 3
#define BTM_SEC_SERVICE_IRMCSYBC 4
#define BTM_SEC_SERVICE_OBEX_PUSH 5
#define BTM_SEC_SERVICE_OBEX_FTP 6
#define BTM_SEC_SERVICE_IRMCSYNCCMD 7
#define BTM_SEC_SERVICE_HEADSET 8
#define BTM_SEC_SERVICE_CORDLESS 9
#define BTM_SEC_SERVICE_INTERCOM 10
#define BTM_SEC_SERVICE_FAX 11
#define BTM_SEC_SERVICE_HEADSET_AG 12
#define BTM_SEC_SERVICE_PNP_INFO 13
#define BTM_SEC_SERVICE_PANU 14
#define BTM_SEC_SERVICE_NAP 15
#define BTM_SEC_SERVICE_GN 16
#define BTM_SEC_SERVICE_HCRP_CTRL 17
#define BTM_SEC_SERVICE_AVDTP 18
#define BTM_SEC_SERVICE_AVCTP 19
#define BTM_SEC_SERVICE_HF_HANDSFREE 20
#define BTM_SEC_SERVICE_AG_HANDSFREE 21
#define BTM_SEC_SERVICE_HID_CTRL 22
#define BTM_SEC_SERVICE_HID_INTR 23
#define BTM_SEC_SERVICE_SAP 24
#define BTM_SEC_SERVICE_BIP 25
#define BTM_SEC_SERVICE_HCRP_DATA 26
#define BTM_SEC_SERVICE_BIP_PRINT 27
#define BTM_SEC_SERVICE_BPP 28
#define BTM_SEC_SERVICE_FIRST_EMPTY 29
// Number of services that can be registered with security manager
#define BTM_SEC_MAX_SERVICE_RECORDS 32
// Following bits can be provided by host in the trusted_mask field
#define BTM_SEC_TRUST_SDP_SERVER (1 << BTM_SEC_SERVICE_SDP_SERVER)
#define BTM_SEC_TRUST_SERIAL_PORT (1 << BTM_SEC_SERVICE_SERIAL_PORT)
#define BTM_SEC_TRUST_LAN_ACCESS (1 << BTM_SEC_SERVICE_LAN_ACCESS)
#define BTM_SEC_TRUST_DUN (1 << BTM_SEC_SERVICE_DUN)
#define BTM_SEC_TRUST_IRMCSYBC (1 << BTM_SEC_SERVICE_IRMCSYBC)
#define BTM_SEC_TRUST_OBEX_PUSH (1 << BTM_SEC_SERVICE_OBEX_PUSH)
#define BTM_SEC_TRUST_OBEX_FTP (1 << BTM_SEC_SERVICE_OBEX_FTP)
#define BTM_SEC_TRUST_IRMCSYNCCMD (1 << BTM_SEC_SERVICE_IRMCSYNCCMD)
#define BTM_SEC_TRUST_HEADSET (1 << BTM_SEC_SERVICE_HEADSET)
#define BTM_SEC_TRUST_CORDLESS (1 << BTM_SEC_SERVICE_CORDLESS)
#define BTM_SEC_TRUST_IINTERCOM (1 << BTM_SEC_SERVICE_IINTERCOM)
#define BTM_SEC_TRUST_FAX (1 << BTM_SEC_SERVICE_FAX)
#define BTM_SEC_TRUST_HEADSET_AG (1 << BTM_SEC_SERVICE_HEADSET_AG)
#define BTM_SEC_TRUST_PNP_INFO (1 << BTM_SEC_SERVICE_PNP_INFO)
#define BTM_SEC_TRUST_GEN_NET (1 << BTM_SEC_SERVICE_GEN_NET)
#define BTM_SEC_TRUST_GEN_FILE (1 << BTM_SEC_SERVICE_GEN_FILE)
#define BTM_SEC_TRUST_GEN_AUDIO (1 << BTM_SEC_SERVICE_GEN_AUDIO)
#define BTM_SEC_TRUST_GEN_TEL (1 << BTM_SEC_SERVICE_GEN_TEL)
#define BTM_SEC_TRUST_ALL 0xFFFFFFFF
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -