Path: blob/next/external/cache/sources/hcitools/lib/bluetooth/sdp.h
18125 views
/*1*2* BlueZ - Bluetooth protocol stack for Linux3*4* Copyright (C) 2001-2002 Nokia Corporation5* Copyright (C) 2002-2003 Maxim Krasnyansky <[email protected]>6* Copyright (C) 2002-2010 Marcel Holtmann <[email protected]>7* Copyright (C) 2002-2003 Stephen Crane <[email protected]>8*9*10* This program is free software; you can redistribute it and/or modify11* it under the terms of the GNU General Public License as published by12* the Free Software Foundation; either version 2 of the License, or13* (at your option) any later version.14*15* This program is distributed in the hope that it will be useful,16* but WITHOUT ANY WARRANTY; without even the implied warranty of17* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the18* GNU General Public License for more details.19*20* You should have received a copy of the GNU General Public License21* along with this program; if not, write to the Free Software22* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA23*24*/2526#ifndef __SDP_H27#define __SDP_H2829#ifdef __cplusplus30extern "C" {31#endif3233#include <stdint.h>34#include <bluetooth/bluetooth.h>3536#define SDP_UNIX_PATH "/var/run/sdp"37#define SDP_RESPONSE_TIMEOUT 2038#define SDP_REQ_BUFFER_SIZE 204839#define SDP_RSP_BUFFER_SIZE 6553540#define SDP_PDU_CHUNK_SIZE 10244142/*43* All definitions are based on Bluetooth Assigned Numbers44* of the Bluetooth Specification45*/46#define SDP_PSM 0x00014748/*49* Protocol UUIDs50*/51#define SDP_UUID 0x000152#define UDP_UUID 0x000253#define RFCOMM_UUID 0x000354#define TCP_UUID 0x000455#define TCS_BIN_UUID 0x000556#define TCS_AT_UUID 0x000657#define ATT_UUID 0x000758#define OBEX_UUID 0x000859#define IP_UUID 0x000960#define FTP_UUID 0x000a61#define HTTP_UUID 0x000c62#define WSP_UUID 0x000e63#define BNEP_UUID 0x000f64#define UPNP_UUID 0x001065#define HIDP_UUID 0x001166#define HCRP_CTRL_UUID 0x001267#define HCRP_DATA_UUID 0x001468#define HCRP_NOTE_UUID 0x001669#define AVCTP_UUID 0x001770#define AVDTP_UUID 0x001971#define CMTP_UUID 0x001b72#define UDI_UUID 0x001d73#define MCAP_CTRL_UUID 0x001e74#define MCAP_DATA_UUID 0x001f75#define L2CAP_UUID 0x01007677/*78* Service class identifiers of standard services and service groups79*/80#define SDP_SERVER_SVCLASS_ID 0x100081#define BROWSE_GRP_DESC_SVCLASS_ID 0x100182#define PUBLIC_BROWSE_GROUP 0x100283#define SERIAL_PORT_SVCLASS_ID 0x110184#define LAN_ACCESS_SVCLASS_ID 0x110285#define DIALUP_NET_SVCLASS_ID 0x110386#define IRMC_SYNC_SVCLASS_ID 0x110487#define OBEX_OBJPUSH_SVCLASS_ID 0x110588#define OBEX_FILETRANS_SVCLASS_ID 0x110689#define IRMC_SYNC_CMD_SVCLASS_ID 0x110790#define HEADSET_SVCLASS_ID 0x110891#define CORDLESS_TELEPHONY_SVCLASS_ID 0x110992#define AUDIO_SOURCE_SVCLASS_ID 0x110a93#define AUDIO_SINK_SVCLASS_ID 0x110b94#define AV_REMOTE_TARGET_SVCLASS_ID 0x110c95#define ADVANCED_AUDIO_SVCLASS_ID 0x110d96#define AV_REMOTE_SVCLASS_ID 0x110e97#define AV_REMOTE_CONTROLLER_SVCLASS_ID 0x110f98#define INTERCOM_SVCLASS_ID 0x111099#define FAX_SVCLASS_ID 0x1111100#define HEADSET_AGW_SVCLASS_ID 0x1112101#define WAP_SVCLASS_ID 0x1113102#define WAP_CLIENT_SVCLASS_ID 0x1114103#define PANU_SVCLASS_ID 0x1115104#define NAP_SVCLASS_ID 0x1116105#define GN_SVCLASS_ID 0x1117106#define DIRECT_PRINTING_SVCLASS_ID 0x1118107#define REFERENCE_PRINTING_SVCLASS_ID 0x1119108#define IMAGING_SVCLASS_ID 0x111a109#define IMAGING_RESPONDER_SVCLASS_ID 0x111b110#define IMAGING_ARCHIVE_SVCLASS_ID 0x111c111#define IMAGING_REFOBJS_SVCLASS_ID 0x111d112#define HANDSFREE_SVCLASS_ID 0x111e113#define HANDSFREE_AGW_SVCLASS_ID 0x111f114#define DIRECT_PRT_REFOBJS_SVCLASS_ID 0x1120115#define REFLECTED_UI_SVCLASS_ID 0x1121116#define BASIC_PRINTING_SVCLASS_ID 0x1122117#define PRINTING_STATUS_SVCLASS_ID 0x1123118#define HID_SVCLASS_ID 0x1124119#define HCR_SVCLASS_ID 0x1125120#define HCR_PRINT_SVCLASS_ID 0x1126121#define HCR_SCAN_SVCLASS_ID 0x1127122#define CIP_SVCLASS_ID 0x1128123#define VIDEO_CONF_GW_SVCLASS_ID 0x1129124#define UDI_MT_SVCLASS_ID 0x112a125#define UDI_TA_SVCLASS_ID 0x112b126#define AV_SVCLASS_ID 0x112c127#define SAP_SVCLASS_ID 0x112d128#define PBAP_PCE_SVCLASS_ID 0x112e129#define PBAP_PSE_SVCLASS_ID 0x112f130#define PBAP_SVCLASS_ID 0x1130131#define MAP_MSE_SVCLASS_ID 0x1132132#define MAP_MCE_SVCLASS_ID 0x1133133#define MAP_SVCLASS_ID 0x1134134#define GNSS_SVCLASS_ID 0x1135135#define GNSS_SERVER_SVCLASS_ID 0x1136136#define PNP_INFO_SVCLASS_ID 0x1200137#define GENERIC_NETWORKING_SVCLASS_ID 0x1201138#define GENERIC_FILETRANS_SVCLASS_ID 0x1202139#define GENERIC_AUDIO_SVCLASS_ID 0x1203140#define GENERIC_TELEPHONY_SVCLASS_ID 0x1204141#define UPNP_SVCLASS_ID 0x1205142#define UPNP_IP_SVCLASS_ID 0x1206143#define UPNP_PAN_SVCLASS_ID 0x1300144#define UPNP_LAP_SVCLASS_ID 0x1301145#define UPNP_L2CAP_SVCLASS_ID 0x1302146#define VIDEO_SOURCE_SVCLASS_ID 0x1303147#define VIDEO_SINK_SVCLASS_ID 0x1304148#define VIDEO_DISTRIBUTION_SVCLASS_ID 0x1305149#define HDP_SVCLASS_ID 0x1400150#define HDP_SOURCE_SVCLASS_ID 0x1401151#define HDP_SINK_SVCLASS_ID 0x1402152#define APPLE_AGENT_SVCLASS_ID 0x2112153#define GENERIC_ATTRIB_SVCLASS_ID 0x1801154155/*156* Standard profile descriptor identifiers; note these157* may be identical to some of the service classes defined above158*/159#define SDP_SERVER_PROFILE_ID SDP_SERVER_SVCLASS_ID160#define BROWSE_GRP_DESC_PROFILE_ID BROWSE_GRP_DESC_SVCLASS_ID161#define SERIAL_PORT_PROFILE_ID SERIAL_PORT_SVCLASS_ID162#define LAN_ACCESS_PROFILE_ID LAN_ACCESS_SVCLASS_ID163#define DIALUP_NET_PROFILE_ID DIALUP_NET_SVCLASS_ID164#define IRMC_SYNC_PROFILE_ID IRMC_SYNC_SVCLASS_ID165#define OBEX_OBJPUSH_PROFILE_ID OBEX_OBJPUSH_SVCLASS_ID166#define OBEX_FILETRANS_PROFILE_ID OBEX_FILETRANS_SVCLASS_ID167#define IRMC_SYNC_CMD_PROFILE_ID IRMC_SYNC_CMD_SVCLASS_ID168#define HEADSET_PROFILE_ID HEADSET_SVCLASS_ID169#define CORDLESS_TELEPHONY_PROFILE_ID CORDLESS_TELEPHONY_SVCLASS_ID170#define AUDIO_SOURCE_PROFILE_ID AUDIO_SOURCE_SVCLASS_ID171#define AUDIO_SINK_PROFILE_ID AUDIO_SINK_SVCLASS_ID172#define AV_REMOTE_TARGET_PROFILE_ID AV_REMOTE_TARGET_SVCLASS_ID173#define ADVANCED_AUDIO_PROFILE_ID ADVANCED_AUDIO_SVCLASS_ID174#define AV_REMOTE_PROFILE_ID AV_REMOTE_SVCLASS_ID175#define VIDEO_CONF_PROFILE_ID VIDEO_CONF_SVCLASS_ID176#define INTERCOM_PROFILE_ID INTERCOM_SVCLASS_ID177#define FAX_PROFILE_ID FAX_SVCLASS_ID178#define HEADSET_AGW_PROFILE_ID HEADSET_AGW_SVCLASS_ID179#define WAP_PROFILE_ID WAP_SVCLASS_ID180#define WAP_CLIENT_PROFILE_ID WAP_CLIENT_SVCLASS_ID181#define PANU_PROFILE_ID PANU_SVCLASS_ID182#define NAP_PROFILE_ID NAP_SVCLASS_ID183#define GN_PROFILE_ID GN_SVCLASS_ID184#define DIRECT_PRINTING_PROFILE_ID DIRECT_PRINTING_SVCLASS_ID185#define REFERENCE_PRINTING_PROFILE_ID REFERENCE_PRINTING_SVCLASS_ID186#define IMAGING_PROFILE_ID IMAGING_SVCLASS_ID187#define IMAGING_RESPONDER_PROFILE_ID IMAGING_RESPONDER_SVCLASS_ID188#define IMAGING_ARCHIVE_PROFILE_ID IMAGING_ARCHIVE_SVCLASS_ID189#define IMAGING_REFOBJS_PROFILE_ID IMAGING_REFOBJS_SVCLASS_ID190#define HANDSFREE_PROFILE_ID HANDSFREE_SVCLASS_ID191#define HANDSFREE_AGW_PROFILE_ID HANDSFREE_AGW_SVCLASS_ID192#define DIRECT_PRT_REFOBJS_PROFILE_ID DIRECT_PRT_REFOBJS_SVCLASS_ID193#define REFLECTED_UI_PROFILE_ID REFLECTED_UI_SVCLASS_ID194#define BASIC_PRINTING_PROFILE_ID BASIC_PRINTING_SVCLASS_ID195#define PRINTING_STATUS_PROFILE_ID PRINTING_STATUS_SVCLASS_ID196#define HID_PROFILE_ID HID_SVCLASS_ID197#define HCR_PROFILE_ID HCR_SCAN_SVCLASS_ID198#define HCR_PRINT_PROFILE_ID HCR_PRINT_SVCLASS_ID199#define HCR_SCAN_PROFILE_ID HCR_SCAN_SVCLASS_ID200#define CIP_PROFILE_ID CIP_SVCLASS_ID201#define VIDEO_CONF_GW_PROFILE_ID VIDEO_CONF_GW_SVCLASS_ID202#define UDI_MT_PROFILE_ID UDI_MT_SVCLASS_ID203#define UDI_TA_PROFILE_ID UDI_TA_SVCLASS_ID204#define AV_PROFILE_ID AV_SVCLASS_ID205#define SAP_PROFILE_ID SAP_SVCLASS_ID206#define PBAP_PCE_PROFILE_ID PBAP_PCE_SVCLASS_ID207#define PBAP_PSE_PROFILE_ID PBAP_PSE_SVCLASS_ID208#define PBAP_PROFILE_ID PBAP_SVCLASS_ID209#define PNP_INFO_PROFILE_ID PNP_INFO_SVCLASS_ID210#define GENERIC_NETWORKING_PROFILE_ID GENERIC_NETWORKING_SVCLASS_ID211#define GENERIC_FILETRANS_PROFILE_ID GENERIC_FILETRANS_SVCLASS_ID212#define GENERIC_AUDIO_PROFILE_ID GENERIC_AUDIO_SVCLASS_ID213#define GENERIC_TELEPHONY_PROFILE_ID GENERIC_TELEPHONY_SVCLASS_ID214#define UPNP_PROFILE_ID UPNP_SVCLASS_ID215#define UPNP_IP_PROFILE_ID UPNP_IP_SVCLASS_ID216#define UPNP_PAN_PROFILE_ID UPNP_PAN_SVCLASS_ID217#define UPNP_LAP_PROFILE_ID UPNP_LAP_SVCLASS_ID218#define UPNP_L2CAP_PROFILE_ID UPNP_L2CAP_SVCLASS_ID219#define VIDEO_SOURCE_PROFILE_ID VIDEO_SOURCE_SVCLASS_ID220#define VIDEO_SINK_PROFILE_ID VIDEO_SINK_SVCLASS_ID221#define VIDEO_DISTRIBUTION_PROFILE_ID VIDEO_DISTRIBUTION_SVCLASS_ID222#define HDP_PROFILE_ID HDP_SVCLASS_ID223#define HDP_SOURCE_PROFILE_ID HDP_SOURCE_SVCLASS_ID224#define HDP_SINK_PROFILE_ID HDP_SINK_SVCLASS_ID225#define APPLE_AGENT_PROFILE_ID APPLE_AGENT_SVCLASS_ID226#define GENERIC_ACCESS_PROFILE_ID 0x1800227#define GENERIC_ATTRIB_PROFILE_ID GENERIC_ATTRIB_SVCLASS_ID228229/*230* Compatibility macros for the old MDP acronym231*/232#define MDP_SVCLASS_ID HDP_SVCLASS_ID233#define MDP_SOURCE_SVCLASS_ID HDP_SOURCE_SVCLASS_ID234#define MDP_SINK_SVCLASS_ID HDP_SINK_SVCLASS_ID235#define MDP_PROFILE_ID HDP_PROFILE_ID236#define MDP_SOURCE_PROFILE_ID HDP_SOURCE_PROFILE_ID237#define MDP_SINK_PROFILE_ID HDP_SINK_PROFILE_ID238239/*240* Attribute identifier codes241*/242#define SDP_SERVER_RECORD_HANDLE 0x0000243244/*245* Possible values for attribute-id are listed below.246* See SDP Spec, section "Service Attribute Definitions" for more details.247*/248#define SDP_ATTR_RECORD_HANDLE 0x0000249#define SDP_ATTR_SVCLASS_ID_LIST 0x0001250#define SDP_ATTR_RECORD_STATE 0x0002251#define SDP_ATTR_SERVICE_ID 0x0003252#define SDP_ATTR_PROTO_DESC_LIST 0x0004253#define SDP_ATTR_BROWSE_GRP_LIST 0x0005254#define SDP_ATTR_LANG_BASE_ATTR_ID_LIST 0x0006255#define SDP_ATTR_SVCINFO_TTL 0x0007256#define SDP_ATTR_SERVICE_AVAILABILITY 0x0008257#define SDP_ATTR_PFILE_DESC_LIST 0x0009258#define SDP_ATTR_DOC_URL 0x000a259#define SDP_ATTR_CLNT_EXEC_URL 0x000b260#define SDP_ATTR_ICON_URL 0x000c261#define SDP_ATTR_ADD_PROTO_DESC_LIST 0x000d262263#define SDP_ATTR_GROUP_ID 0x0200264#define SDP_ATTR_IP_SUBNET 0x0200265#define SDP_ATTR_VERSION_NUM_LIST 0x0200266#define SDP_ATTR_SUPPORTED_FEATURES_LIST 0x0200267#define SDP_ATTR_GOEP_L2CAP_PSM 0x0200268#define SDP_ATTR_SVCDB_STATE 0x0201269270#define SDP_ATTR_SERVICE_VERSION 0x0300271#define SDP_ATTR_EXTERNAL_NETWORK 0x0301272#define SDP_ATTR_SUPPORTED_DATA_STORES_LIST 0x0301273#define SDP_ATTR_DATA_EXCHANGE_SPEC 0x0301274#define SDP_ATTR_NETWORK 0x0301275#define SDP_ATTR_FAX_CLASS1_SUPPORT 0x0302276#define SDP_ATTR_REMOTE_AUDIO_VOLUME_CONTROL 0x0302277#define SDP_ATTR_MCAP_SUPPORTED_PROCEDURES 0x0302278#define SDP_ATTR_FAX_CLASS20_SUPPORT 0x0303279#define SDP_ATTR_SUPPORTED_FORMATS_LIST 0x0303280#define SDP_ATTR_FAX_CLASS2_SUPPORT 0x0304281#define SDP_ATTR_AUDIO_FEEDBACK_SUPPORT 0x0305282#define SDP_ATTR_NETWORK_ADDRESS 0x0306283#define SDP_ATTR_WAP_GATEWAY 0x0307284#define SDP_ATTR_HOMEPAGE_URL 0x0308285#define SDP_ATTR_WAP_STACK_TYPE 0x0309286#define SDP_ATTR_SECURITY_DESC 0x030a287#define SDP_ATTR_NET_ACCESS_TYPE 0x030b288#define SDP_ATTR_MAX_NET_ACCESSRATE 0x030c289#define SDP_ATTR_IP4_SUBNET 0x030d290#define SDP_ATTR_IP6_SUBNET 0x030e291#define SDP_ATTR_SUPPORTED_CAPABILITIES 0x0310292#define SDP_ATTR_SUPPORTED_FEATURES 0x0311293#define SDP_ATTR_SUPPORTED_FUNCTIONS 0x0312294#define SDP_ATTR_TOTAL_IMAGING_DATA_CAPACITY 0x0313295#define SDP_ATTR_SUPPORTED_REPOSITORIES 0x0314296#define SDP_ATTR_MAS_INSTANCE_ID 0x0315297#define SDP_ATTR_SUPPORTED_MESSAGE_TYPES 0x0316298299#define SDP_ATTR_SPECIFICATION_ID 0x0200300#define SDP_ATTR_VENDOR_ID 0x0201301#define SDP_ATTR_PRODUCT_ID 0x0202302#define SDP_ATTR_VERSION 0x0203303#define SDP_ATTR_PRIMARY_RECORD 0x0204304#define SDP_ATTR_VENDOR_ID_SOURCE 0x0205305306#define SDP_ATTR_HID_DEVICE_RELEASE_NUMBER 0x0200307#define SDP_ATTR_HID_PARSER_VERSION 0x0201308#define SDP_ATTR_HID_DEVICE_SUBCLASS 0x0202309#define SDP_ATTR_HID_COUNTRY_CODE 0x0203310#define SDP_ATTR_HID_VIRTUAL_CABLE 0x0204311#define SDP_ATTR_HID_RECONNECT_INITIATE 0x0205312#define SDP_ATTR_HID_DESCRIPTOR_LIST 0x0206313#define SDP_ATTR_HID_LANG_ID_BASE_LIST 0x0207314#define SDP_ATTR_HID_SDP_DISABLE 0x0208315#define SDP_ATTR_HID_BATTERY_POWER 0x0209316#define SDP_ATTR_HID_REMOTE_WAKEUP 0x020a317#define SDP_ATTR_HID_PROFILE_VERSION 0x020b318#define SDP_ATTR_HID_SUPERVISION_TIMEOUT 0x020c319#define SDP_ATTR_HID_NORMALLY_CONNECTABLE 0x020d320#define SDP_ATTR_HID_BOOT_DEVICE 0x020e321322/*323* These identifiers are based on the SDP spec stating that324* "base attribute id of the primary (universal) language must be 0x0100"325*326* Other languages should have their own offset; e.g.:327* #define XXXLangBase yyyy328* #define AttrServiceName_XXX 0x0000+XXXLangBase329*/330#define SDP_PRIMARY_LANG_BASE 0x0100331332#define SDP_ATTR_SVCNAME_PRIMARY 0x0000 + SDP_PRIMARY_LANG_BASE333#define SDP_ATTR_SVCDESC_PRIMARY 0x0001 + SDP_PRIMARY_LANG_BASE334#define SDP_ATTR_PROVNAME_PRIMARY 0x0002 + SDP_PRIMARY_LANG_BASE335336/*337* The Data representation in SDP PDUs (pps 339, 340 of BT SDP Spec)338* These are the exact data type+size descriptor values339* that go into the PDU buffer.340*341* The datatype (leading 5bits) + size descriptor (last 3 bits)342* is 8 bits. The size descriptor is critical to extract the343* right number of bytes for the data value from the PDU.344*345* For most basic types, the datatype+size descriptor is346* straightforward. However for constructed types and strings,347* the size of the data is in the next "n" bytes following the348* 8 bits (datatype+size) descriptor. Exactly what the "n" is349* specified in the 3 bits of the data size descriptor.350*351* TextString and URLString can be of size 2^{8, 16, 32} bytes352* DataSequence and DataSequenceAlternates can be of size 2^{8, 16, 32}353* The size are computed post-facto in the API and are not known apriori354*/355#define SDP_DATA_NIL 0x00356#define SDP_UINT8 0x08357#define SDP_UINT16 0x09358#define SDP_UINT32 0x0A359#define SDP_UINT64 0x0B360#define SDP_UINT128 0x0C361#define SDP_INT8 0x10362#define SDP_INT16 0x11363#define SDP_INT32 0x12364#define SDP_INT64 0x13365#define SDP_INT128 0x14366#define SDP_UUID_UNSPEC 0x18367#define SDP_UUID16 0x19368#define SDP_UUID32 0x1A369#define SDP_UUID128 0x1C370#define SDP_TEXT_STR_UNSPEC 0x20371#define SDP_TEXT_STR8 0x25372#define SDP_TEXT_STR16 0x26373#define SDP_TEXT_STR32 0x27374#define SDP_BOOL 0x28375#define SDP_SEQ_UNSPEC 0x30376#define SDP_SEQ8 0x35377#define SDP_SEQ16 0x36378#define SDP_SEQ32 0x37379#define SDP_ALT_UNSPEC 0x38380#define SDP_ALT8 0x3D381#define SDP_ALT16 0x3E382#define SDP_ALT32 0x3F383#define SDP_URL_STR_UNSPEC 0x40384#define SDP_URL_STR8 0x45385#define SDP_URL_STR16 0x46386#define SDP_URL_STR32 0x47387388/*389* The PDU identifiers of SDP packets between client and server390*/391#define SDP_ERROR_RSP 0x01392#define SDP_SVC_SEARCH_REQ 0x02393#define SDP_SVC_SEARCH_RSP 0x03394#define SDP_SVC_ATTR_REQ 0x04395#define SDP_SVC_ATTR_RSP 0x05396#define SDP_SVC_SEARCH_ATTR_REQ 0x06397#define SDP_SVC_SEARCH_ATTR_RSP 0x07398399/*400* Some additions to support service registration.401* These are outside the scope of the Bluetooth specification402*/403#define SDP_SVC_REGISTER_REQ 0x75404#define SDP_SVC_REGISTER_RSP 0x76405#define SDP_SVC_UPDATE_REQ 0x77406#define SDP_SVC_UPDATE_RSP 0x78407#define SDP_SVC_REMOVE_REQ 0x79408#define SDP_SVC_REMOVE_RSP 0x80409410/*411* SDP Error codes412*/413#define SDP_INVALID_VERSION 0x0001414#define SDP_INVALID_RECORD_HANDLE 0x0002415#define SDP_INVALID_SYNTAX 0x0003416#define SDP_INVALID_PDU_SIZE 0x0004417#define SDP_INVALID_CSTATE 0x0005418419/*420* SDP PDU421*/422typedef struct {423uint8_t pdu_id;424uint16_t tid;425uint16_t plen;426} __attribute__ ((packed)) sdp_pdu_hdr_t;427428/*429* Common definitions for attributes in the SDP.430* Should the type of any of these change, you need only make a change here.431*/432433typedef struct {434uint8_t type;435union {436uint16_t uuid16;437uint32_t uuid32;438uint128_t uuid128;439} value;440} uuid_t;441442#define SDP_IS_UUID(x) ((x) == SDP_UUID16 || (x) == SDP_UUID32 || \443(x) == SDP_UUID128)444#define SDP_IS_ALT(x) ((x) == SDP_ALT8 || (x) == SDP_ALT16 || (x) == SDP_ALT32)445#define SDP_IS_SEQ(x) ((x) == SDP_SEQ8 || (x) == SDP_SEQ16 || (x) == SDP_SEQ32)446#define SDP_IS_TEXT_STR(x) ((x) == SDP_TEXT_STR8 || (x) == SDP_TEXT_STR16 || \447(x) == SDP_TEXT_STR32)448449typedef struct _sdp_list sdp_list_t;450struct _sdp_list {451sdp_list_t *next;452void *data;453};454455/*456* User-visible strings can be in many languages457* in addition to the universal language.458*459* Language meta-data includes language code in ISO639460* followed by the encoding format. The third field in this461* structure is the attribute offset for the language.462* User-visible strings in the specified language can be463* obtained at this offset.464*/465typedef struct {466uint16_t code_ISO639;467uint16_t encoding;468uint16_t base_offset;469} sdp_lang_attr_t;470471/*472* Profile descriptor is the Bluetooth profile metadata. If a473* service conforms to a well-known profile, then its profile474* identifier (UUID) is an attribute of the service. In addition,475* if the profile has a version number it is specified here.476*/477typedef struct {478uuid_t uuid;479uint16_t version;480} sdp_profile_desc_t;481482typedef struct {483uint8_t major;484uint8_t minor;485} sdp_version_t;486487typedef struct {488uint8_t *data;489uint32_t data_size;490uint32_t buf_size;491} sdp_buf_t;492493typedef struct {494uint32_t handle;495496/* Search pattern: a sequence of all UUIDs seen in this record */497sdp_list_t *pattern;498sdp_list_t *attrlist;499500/* Main service class for Extended Inquiry Response */501uuid_t svclass;502} sdp_record_t;503504typedef struct sdp_data_struct sdp_data_t;505struct sdp_data_struct {506uint8_t dtd;507uint16_t attrId;508union {509int8_t int8;510int16_t int16;511int32_t int32;512int64_t int64;513uint128_t int128;514uint8_t uint8;515uint16_t uint16;516uint32_t uint32;517uint64_t uint64;518uint128_t uint128;519uuid_t uuid;520char *str;521sdp_data_t *dataseq;522} val;523sdp_data_t *next;524int unitSize;525};526527#ifdef __cplusplus528}529#endif530531#endif /* __SDP_H */532533534