Remove incorrect Language ID offset attribute from the SDP server - client assumes...
[pub/USBasp.git] / Demos / Host / Incomplete / BluetoothHost / Lib / SDPServices.c
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2010.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
7 */
8
9 /*
10 Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
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.
20
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
28 this software.
29 */
30
31 #include "SDPServices.h"
32
33 const struct
34 {
35 uint8_t Header;
36 uint32_t Data;
37 } PROGMEM SDP_Attribute_ServiceHandle = {(SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_32Bit), SWAPENDIAN_32(0x00010000)};
38
39 const struct
40 {
41 uint8_t Header;
42 uint16_t Size;
43 ItemUUID_t UUIDList[];
44 } PROGMEM SDP_Attribute_ServiceClassIDs =
45 {
46 .Header = (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable16Bit),
47 .Size = SWAPENDIAN_16(sizeof(ItemUUID_t) * 1),
48 .UUIDList =
49 {
50 {.Header = (SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), .UUID = {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x10, 0x00}},}
51 }
52 };
53
54 const struct
55 {
56 uint8_t Header;
57 uint8_t Size;
58 Item16Bit_t VersionList[];
59 } PROGMEM SDP_Attribute_Version =
60 {
61 .Header = (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit),
62 .Size = (sizeof(Item16Bit_t) * 1),
63 .VersionList =
64 {
65 {.Header = (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_16Bit), .Value = SWAPENDIAN_16(0x0100)}
66 }
67 };
68
69 const struct
70 {
71 uint8_t Header;
72 uint8_t Size;
73 char Text[];
74 } PROGMEM SDP_Attribute_ServiceName =
75 {
76 .Header = (SDP_DATATYPE_String | SDP_DATASIZE_Variable8Bit),
77 .Size = sizeof("SDP") - 1,
78 .Text = "SDP",
79 };
80
81 const struct
82 {
83 uint8_t Header;
84 uint8_t Size;
85 char Text[];
86 } PROGMEM SDP_Attribute_ServiceDescription =
87 {
88 .Header = (SDP_DATATYPE_String | SDP_DATASIZE_Variable8Bit),
89 .Size = sizeof("Service Discovery Protocol Server") - 1,
90 .Text = "Service Discovery Protocol Server",
91 };
92
93 /** Service Discovery Protocol attribute table, listing all supported attributes of the service. */
94 const ServiceAttributeTable_t SDP_Attribute_Table[] PROGMEM =
95 {
96 {.AttributeID = SDP_ATTRIBUTE_ID_SERVICERECORDHANDLE, .Data = &SDP_Attribute_ServiceHandle },
97 {.AttributeID = SDP_ATTRIBUTE_ID_SERVICECLASSIDS, .Data = &SDP_Attribute_ServiceClassIDs },
98 {.AttributeID = SDP_ATTRIBUTE_ID_VERSION, .Data = &SDP_Attribute_Version },
99 {.AttributeID = SDP_ATTRIBUTE_ID_SERVICENAME, .Data = &SDP_Attribute_ServiceName },
100 {.AttributeID = SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION, .Data = &SDP_Attribute_ServiceDescription },
101
102 SERVICE_ATTRIBUTE_TABLE_TERMINATOR
103 };
104
105 const struct
106 {
107 uint8_t Header;
108 uint32_t Data;
109 } PROGMEM RFCOMM_Attribute_ServiceHandle = {(SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_32Bit), SWAPENDIAN_32(0x00010001)};
110
111 const struct
112 {
113 uint8_t Header;
114 uint16_t Size;
115 ItemUUID_t UUIDList[];
116 } PROGMEM RFCOMM_Attribute_ServiceClassIDs =
117 {
118 .Header = (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable16Bit),
119 .Size = SWAPENDIAN_16(sizeof(ItemUUID_t) * 1),
120 .UUIDList =
121 {
122 {.Header = (SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), .UUID = {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x11, 0x01}},}
123 }
124 };
125
126 const struct
127 {
128 uint8_t Header;
129 uint8_t Size;
130 Item16Bit_t OffsetList[];
131 } PROGMEM RFCOMM_Attribute_LangOffset =
132 {
133 .Header = (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit),
134 .Size = (sizeof(Item16Bit_t) * 1),
135 .OffsetList =
136 {
137 {.Header = (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_16Bit), .Value = SWAPENDIAN_16(0x0100)}
138 }
139 };
140
141 const struct
142 {
143 uint8_t Header;
144 uint8_t Size;
145 char Text[];
146 } PROGMEM RFCOMM_Attribute_ServiceName =
147 {
148 .Header = (SDP_DATATYPE_String | SDP_DATASIZE_Variable8Bit),
149 .Size = sizeof("Serial Port") - 1,
150 .Text = "Serial Port",
151 };
152
153 const struct
154 {
155 uint8_t Header;
156 uint8_t Size;
157 char Text[];
158 } PROGMEM RFCOMM_Attribute_ServiceDescription =
159 {
160 .Header = (SDP_DATATYPE_String | SDP_DATASIZE_Variable8Bit),
161 .Size = sizeof("Wireless Serial Port Service") - 1,
162 .Text = "Wireless Serial Port Service",
163 };
164
165 const ServiceAttributeTable_t RFCOMM_Attribute_Table[] PROGMEM =
166 {
167 {.AttributeID = SDP_ATTRIBUTE_ID_SERVICERECORDHANDLE, .Data = &RFCOMM_Attribute_ServiceHandle },
168 {.AttributeID = SDP_ATTRIBUTE_ID_SERVICECLASSIDS, .Data = &RFCOMM_Attribute_ServiceClassIDs },
169 {.AttributeID = SDP_ATTRIBUTE_ID_SERVICENAME, .Data = &RFCOMM_Attribute_ServiceName },
170 {.AttributeID = SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION, .Data = &RFCOMM_Attribute_ServiceDescription },
171
172 SERVICE_ATTRIBUTE_TABLE_TERMINATOR
173 };