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_ATTRIBUTE_ID_SERVICERECORDHANDLE 0x0000
50 #define SDP_ATTRIBUTE_ID_SERVICECLASSIDS 0x0001
51 #define SDP_ATTRIBUTE_ID_LANGIDOFFSET 0x0006
52 #define SDP_ATTRIBUTE_ID_VERSION 0x0200
53 #define SDP_ATTRIBUTE_ID_SERVICENAME 0x0100
54 #define SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION 0x0101
56 #define SWAPENDIAN_16(x) ((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8))
57 #define SWAPENDIAN_32(x) ((((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | \
58 (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24))
60 /** Terminator for a service attribute table of type \ref ServiceAttributeTable_t. */
61 #define SERVICE_ATTRIBUTE_TABLE_TERMINATOR {.Data = NULL}
73 /** Structure for the association of attribute ID values to an attribute value in FLASH. A table of these
74 * structures can then be built up for each supported UUID service within the device.
78 uint16_t AttributeID
; /**< Attribute ID of the table element which the UUID service supports */
79 const void* Data
; /**< Pointer to the attribute data, located in PROGMEM memory space */
80 } ServiceAttributeTable_t
;
82 /** Structure for the association of service UUID values to attribute tables stored in FLASH. A table of these
83 * structures can then be built up for each supported UUID service within the device.
87 UUID_t UUID
; /**< UUID of a service supported by the device */
88 const void* AttributeTable
; /**< Pointer to the UUID's attribute table, located in PROGMEM memory space */
91 /** Structure for a list of Data Elements containing UUIDs, for service attributes requiring UUID lists. */
94 uint8_t Header
; /**< Data Element header, should be (SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit) */
95 UUID_t UUID
; /**< UUID to store in the list Data Element */
98 /** Structure for a list of Data Elements containing 8-bit integers, for service attributes requiring such lists. */
101 uint8_t Header
; /**< Data Element header, should be (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_8Bit) */
102 uint8_t Value
; /**< Value to store in the list Data Element */
105 /** Structure for a list of Data Elements containing 16-bit integers, for service attributes requiring such lists. */
108 uint8_t Header
; /**< Data Element header, should be (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_16Bit) */
109 uint16_t Value
; /**< Value to store in the list Data Element */
112 /** Structure for a list of Data Elements containing 32-bit integers, for service attributes requiring such lists. */
115 uint8_t Header
; /**< Data Element header, should be (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_32Bit) */
116 uint32_t Value
; /**< Value to store in the list Data Element */
119 /* External Variables: */
120 extern const ServiceAttributeTable_t SDP_Attribute_Table
[];
121 extern const ServiceAttributeTable_t RFCOMM_Attribute_Table
[];