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

📄 sdp.h

📁 实现蓝牙的各种profile
💻 H
📖 第 1 页 / 共 2 页
字号:
#define SDP_ATTR_AUDIO_FEEDBACK_SUPPORT		0x0305#define SDP_ATTR_NETWORK_ADDRESS		0x0306#define SDP_ATTR_WAP_GATEWAY			0x0307#define SDP_ATTR_HOMEPAGE_URL			0x0308#define SDP_ATTR_WAP_STACK_TYPE			0x0309#define SDP_ATTR_SECURITY_DESC			0x030a#define SDP_ATTR_NET_ACCESS_TYPE		0x030b#define SDP_ATTR_MAX_NET_ACCESSRATE		0x030c#define SDP_ATTR_IP4_SUBNET			0x030d#define SDP_ATTR_IP6_SUBNET			0x030e#define SDP_ATTR_SUPPORTED_CAPABILITIES		0x0310#define SDP_ATTR_SUPPORTED_FEATURES		0x0311#define SDP_ATTR_SUPPORTED_FUNCTIONS		0x0312#define SDP_ATTR_TOTAL_IMAGING_DATA_CAPACITY	0x0313#define SDP_ATTR_SUPPORTED_REPOSITORIES		0x0314#define SDP_ATTR_SPECIFICATION_ID		0x0200#define SDP_ATTR_VENDOR_ID			0x0201#define SDP_ATTR_PRODUCT_ID			0x0202#define SDP_ATTR_VERSION			0x0203#define SDP_ATTR_PRIMARY_RECORD			0x0204#define SDP_ATTR_VENDOR_ID_SOURCE		0x0205#define SDP_ATTR_HID_DEVICE_RELEASE_NUMBER	0x0200#define SDP_ATTR_HID_PARSER_VERSION		0x0201#define SDP_ATTR_HID_DEVICE_SUBCLASS		0x0202#define SDP_ATTR_HID_COUNTRY_CODE		0x0203#define SDP_ATTR_HID_VIRTUAL_CABLE		0x0204#define SDP_ATTR_HID_RECONNECT_INITIATE		0x0205#define SDP_ATTR_HID_DESCRIPTOR_LIST		0x0206#define SDP_ATTR_HID_LANG_ID_BASE_LIST		0x0207#define SDP_ATTR_HID_SDP_DISABLE		0x0208#define SDP_ATTR_HID_BATTERY_POWER		0x0209#define SDP_ATTR_HID_REMOTE_WAKEUP		0x020a#define SDP_ATTR_HID_PROFILE_VERSION		0x020b#define SDP_ATTR_HID_SUPERVISION_TIMEOUT	0x020c#define SDP_ATTR_HID_NORMALLY_CONNECTABLE	0x020d#define SDP_ATTR_HID_BOOT_DEVICE		0x020e/* * These identifiers are based on the SDP spec stating that  * "base attribute id of the primary (universal) language must be 0x0100" * * Other languages should have their own offset; e.g.: * #define XXXLangBase yyyy * #define AttrServiceName_XXX	0x0000+XXXLangBase */#define SDP_PRIMARY_LANG_BASE 		0x0100#define SDP_ATTR_SVCNAME_PRIMARY	0x0000 + SDP_PRIMARY_LANG_BASE#define SDP_ATTR_SVCDESC_PRIMARY	0x0001 + SDP_PRIMARY_LANG_BASE#define SDP_ATTR_PROVNAME_PRIMARY	0x0002 + SDP_PRIMARY_LANG_BASE/* * The Data representation in SDP PDUs (pps 339, 340 of BT SDP Spec) * These are the exact data type+size descriptor values * that go into the PDU buffer. * * The datatype (leading 5bits) + size descriptor (last 3 bits) * is 8 bits. The size descriptor is critical to extract the * right number of bytes for the data value from the PDU. * * For most basic types, the datatype+size descriptor is * straightforward. However for constructed types and strings, * the size of the data is in the next "n" bytes following the * 8 bits (datatype+size) descriptor. Exactly what the "n" is * specified in the 3 bits of the data size descriptor. * * TextString and URLString can be of size 2^{8, 16, 32} bytes * DataSequence and DataSequenceAlternates can be of size 2^{8, 16, 32} * The size are computed post-facto in the API and are not known apriori */#define SDP_DATA_NIL 		0x00#define SDP_UINT8  		0x08#define SDP_UINT16		0x09#define SDP_UINT32		0x0A#define SDP_UINT64		0x0B#define SDP_UINT128		0x0C#define SDP_INT8		0x10#define SDP_INT16		0x11#define SDP_INT32		0x12#define SDP_INT64		0x13#define SDP_INT128		0x14#define SDP_UUID_UNSPEC		0x18#define SDP_UUID16		0x19#define SDP_UUID32		0x1A#define SDP_UUID128		0x1C#define SDP_TEXT_STR_UNSPEC	0x20#define SDP_TEXT_STR8		0x25#define SDP_TEXT_STR16		0x26#define SDP_TEXT_STR32		0x27#define SDP_BOOL		0x28#define SDP_SEQ_UNSPEC		0x30#define SDP_SEQ8		0x35#define SDP_SEQ16		0x36#define SDP_SEQ32		0x37#define SDP_ALT_UNSPEC		0x38#define SDP_ALT8		0x3D#define SDP_ALT16		0x3E#define SDP_ALT32		0x3F#define SDP_URL_STR_UNSPEC	0x40#define SDP_URL_STR8		0x45#define SDP_URL_STR16		0x46#define SDP_URL_STR32		0x47/* * The PDU identifiers of SDP packets between client and server */#define SDP_ERROR_RSP		0x01#define SDP_SVC_SEARCH_REQ	0x02#define SDP_SVC_SEARCH_RSP	0x03#define SDP_SVC_ATTR_REQ	0x04#define SDP_SVC_ATTR_RSP	0x05#define SDP_SVC_SEARCH_ATTR_REQ	0x06#define SDP_SVC_SEARCH_ATTR_RSP	0x07/* * Some additions to support service registration. * These are outside the scope of the Bluetooth specification */#define SDP_SVC_REGISTER_REQ	0x75#define SDP_SVC_REGISTER_RSP	0x76#define SDP_SVC_UPDATE_REQ	0x77#define SDP_SVC_UPDATE_RSP	0x78#define SDP_SVC_REMOVE_REQ	0x79#define SDP_SVC_REMOVE_RSP	0x80/* * SDP Error codes */#define SDP_INVALID_VERSION		0x0001#define SDP_INVALID_RECORD_HANDLE	0x0002#define SDP_INVALID_SYNTAX		0x0003#define SDP_INVALID_PDU_SIZE		0x0004#define SDP_INVALID_CSTATE		0x0005/* * SDP PDU */typedef struct {	uint8_t  pdu_id;	uint16_t tid;	uint16_t plen;} __attribute__ ((packed)) sdp_pdu_hdr_t;/* * Common definitions for attributes in the SDP. * Should the type of any of these change, you need only make a change here. */typedef struct {	uint8_t data[16];} uint128_t;typedef struct {	uint8_t type;	union {		uint16_t  uuid16;		uint32_t  uuid32;		uint128_t uuid128;	} value;} uuid_t;#define SDP_IS_UUID(x) ((x) == SDP_UUID16 || (x) == SDP_UUID32 || (x) ==SDP_UUID128)typedef struct _sdp_list sdp_list_t;struct _sdp_list {	sdp_list_t *next;	void *data;};/* * User-visible strings can be in many languages * in addition to the universal language. * * Language meta-data includes language code in ISO639 * followed by the encoding format. The third field in this * structure is the attribute offset for the language. * User-visible strings in the specified language can be * obtained at this offset. */typedef struct {	uint16_t code_ISO639;	uint16_t encoding;	uint16_t base_offset;} sdp_lang_attr_t;/* * Profile descriptor is the Bluetooth profile metadata. If a * service conforms to a well-known profile, then its profile * identifier (UUID) is an attribute of the service. In addition, * if the profile has a version number it is specified here. */typedef struct {	uuid_t uuid;	uint16_t version;} sdp_profile_desc_t;typedef struct {	uint8_t major;	uint8_t minor;} sdp_version_t;typedef struct {	uint8_t *data;	uint32_t data_size;	uint32_t buf_size;} sdp_buf_t;typedef struct {	uint32_t handle;	/* Search pattern: a sequence of all UUIDs seen in this record */	sdp_list_t *pattern;	sdp_list_t *attrlist;	/* Main service class for Extended Inquiry Response */	uuid_t svclass;} sdp_record_t;typedef struct sdp_data_struct sdp_data_t;struct sdp_data_struct {	uint8_t dtd;	uint16_t attrId;	union {		int8_t    int8;		int16_t   int16;		int32_t   int32;		int64_t   int64;		uint128_t int128;		uint8_t   uint8;		uint16_t  uint16;		uint32_t  uint32;		uint64_t  uint64;		uint128_t uint128;		uuid_t    uuid;		char     *str;		sdp_data_t *dataseq;	} val;	sdp_data_t *next;	int unitSize;};#ifdef __cplusplus}#endif#endif /* __SDP_H */

⌨️ 快捷键说明

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