3 Copyright (C) Dean Camera, 2010.
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
10 Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
33 * Header file for SDPServices.c.
36 #ifndef _SDPSERVICES_H_
37 #define _SDPSERVICES_H_
40 #include "ServiceDiscoveryProtocol.h"
43 /** Size of a full 128 bit UUID, in bytes. */
44 #define UUID_SIZE_BYTES 16
46 /** First 80 bits common to all standardized Bluetooth services. */
47 #define BASE_80BIT_UUID SWAPENDIAN_32(0xFB349B5F), SWAPENDIAN_16(0x8000), SWAPENDIAN_16(0x0080), SWAPENDIAN_16(0x0010)
49 #define SDP_UUID {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}
50 #define RFCOMM_UUID {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}
51 #define L2CAP_UUID {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x01, 0x00}}
52 #define SDP_CLASS_UUID {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x10, 0x00}}
53 #define SP_CLASS_UUID {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x11, 0x01}}
54 #define PUBLICBROWSEGROUP_CLASS_UUID {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x10, 0x02}}
56 #define SDP_ATTRIBUTE_ID_SERVICERECORDHANDLE 0x0000
57 #define SDP_ATTRIBUTE_ID_SERVICECLASSIDS 0x0001
58 #define SDP_ATTRIBUTE_ID_PROTOCOLDESCRIPTORLIST 0x0004
59 #define SDP_ATTRIBUTE_ID_BROWSEGROUPLIST 0x0005
60 #define SDP_ATTRIBUTE_ID_LANGUAGEBASEATTROFFSET 0x0006
61 #define SDP_ATTRIBUTE_ID_VERSION 0x0200
62 #define SDP_ATTRIBUTE_ID_SERVICENAME 0x0100
63 #define SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION 0x0101
65 #define SWAPENDIAN_16(x) ((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8))
66 #define SWAPENDIAN_32(x) ((((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | \
67 (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24))
69 /** Terminator for a service attribute table of type \ref ServiceAttributeTable_t. */
70 #define SERVICE_ATTRIBUTE_TABLE_TERMINATOR {.Data = NULL}
82 /** Structure for the association of attribute ID values to an attribute value in FLASH. A table of these
83 * structures can then be built up for each supported UUID service within the device.
87 uint16_t AttributeID
; /**< Attribute ID of the table element which the UUID service supports */
88 const void* Data
; /**< Pointer to the attribute data, located in PROGMEM memory space */
89 } ServiceAttributeTable_t
;
91 /** Structure for a list of Data Elements containing 8-bit integers, for service attributes requiring such lists. */
94 uint8_t Header
; /**< Data Element header, should be (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_8Bit) */
95 uint8_t Value
; /**< Value to store in the list Data Element */
98 /** Structure for a list of Data Elements containing 16-bit integers, for service attributes requiring such lists. */
101 uint8_t Header
; /**< Data Element header, should be (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_16Bit) */
102 uint16_t Value
; /**< Value to store in the list Data Element */
105 /** Structure for a list of Data Elements containing 32-bit integers, for service attributes requiring such lists. */
108 uint8_t Header
; /**< Data Element header, should be (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_32Bit) */
109 uint32_t Value
; /**< Value to store in the list Data Element */
112 /** Structure for a list of Data Elements containing UUIDs, for service attributes requiring UUID lists. */
115 uint8_t Header
; /**< Data Element header, should be (SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit) */
116 UUID_t UUID
; /**< UUID to store in the list Data Element */
119 /** Structure for a list of Data Elements Sequences containing UUID Data Elements, for service attributes requiring
124 uint8_t Header
; /**< Data Element header, should be (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit) */
125 uint8_t Size
; /**< Size of the inner Data Element sequence */
129 ItemUUID_t UUID
; /**< UUID to store in the protocol list Data Element sequence */
135 Item16Bit_t LanguageID
;
136 Item16Bit_t EncodingID
;
137 Item16Bit_t OffsetID
;
140 /* External Variables: */
141 extern const ServiceAttributeTable_t RFCOMM_Attribute_Table
[];