+/*\r
+ LUFA Library\r
+ Copyright (C) Dean Camera, 2010.\r
+ \r
+ dean [at] fourwalledcubicle [dot] com\r
+ www.fourwalledcubicle.com\r
+*/\r
+\r
+/*\r
+ Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+\r
+ Permission to use, copy, modify, distribute, and sell this \r
+ software and its documentation for any purpose is hereby granted\r
+ without fee, provided that the above copyright notice appear in \r
+ all copies and that both that the copyright notice and this\r
+ permission notice and warranty disclaimer appear in supporting \r
+ documentation, and that the name of the author not be used in \r
+ advertising or publicity pertaining to distribution of the \r
+ software without specific, written prior permission.\r
+\r
+ The author disclaim all warranties with regard to this\r
+ software, including all implied warranties of merchantability\r
+ and fitness. In no event shall the author be liable for any\r
+ special, indirect or consequential damages or any damages\r
+ whatsoever resulting from loss of use, data or profits, whether\r
+ in an action of contract, negligence or other tortious action,\r
+ arising out of or in connection with the use or performance of\r
+ this software.\r
+*/\r
+\r
+#include "SDPServices.h"\r
+\r
+const struct\r
+{\r
+ uint8_t Header;\r
+ uint32_t Data;\r
+} PROGMEM SDP_Attribute_ServiceHandle = {(SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_32Bit), SWAPENDIAN_32(0x00010000)};\r
+\r
+const struct\r
+{\r
+ uint8_t Header;\r
+ uint16_t Size;\r
+ ClassUUID_t UUIDList[];\r
+} PROGMEM SDP_Attribute_ServiceClassIDs =\r
+ {\r
+ .Header = (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable16Bit),\r
+ .Size = SWAPENDIAN_16(sizeof(ClassUUID_t) * 1),\r
+ .UUIDList =\r
+ {\r
+ {.Header = (SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), .UUID = {BASE_96BIT_UUID, 0x00, 0x10, 0x00, 0x00}}\r
+ }\r
+ };\r
+\r
+const struct\r
+{\r
+ uint8_t Header;\r
+ uint8_t Size;\r
+ Item16Bit_t VersionList[];\r
+} PROGMEM SDP_Attribute_Version =\r
+ {\r
+ .Header = (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit),\r
+ .Size = (sizeof(Item16Bit_t) * 1),\r
+ .VersionList =\r
+ {\r
+ {.Header = (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_16Bit), .Value = SWAPENDIAN_16(0x0100)}\r
+ }\r
+ };\r
+\r
+const struct\r
+{\r
+ uint8_t Header;\r
+ uint8_t Size;\r
+ Item16Bit_t OffsetList[];\r
+} PROGMEM SDP_Attribute_LangOffset =\r
+ {\r
+ .Header = (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit),\r
+ .Size = (sizeof(Item16Bit_t) * 1),\r
+ .OffsetList =\r
+ {\r
+ {.Header = (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_16Bit), .Value = SWAPENDIAN_16(0x0100)}\r
+ }\r
+ };\r
+\r
+const struct\r
+{\r
+ uint8_t Header;\r
+ uint8_t Size;\r
+ char Text[];\r
+} PROGMEM SDP_Attribute_ServiceName =\r
+ {\r
+ .Header = (SDP_DATATYPE_String | SDP_DATASIZE_Variable8Bit),\r
+ .Size = sizeof("SDP") - 1,\r
+ .Text = "SDP",\r
+ };\r
+\r
+const struct\r
+{\r
+ uint8_t Header;\r
+ uint8_t Size;\r
+ char Text[];\r
+} PROGMEM SDP_Attribute_ServiceDescription =\r
+ {\r
+ .Header = (SDP_DATATYPE_String | SDP_DATASIZE_Variable8Bit),\r
+ .Size = sizeof("Service Discovery Protocol Server") - 1,\r
+ .Text = "Service Discovery Protocol Server",\r
+ };\r
+\r
+/** Service Discovery Protocol attribute table, listing all supported attributes of the service. */\r
+const ServiceAttributeTable_t SDP_Attribute_Table[] PROGMEM =\r
+ {\r
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICERECORDHANDLE, .Data = &SDP_Attribute_ServiceHandle },\r
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICECLASSIDS, .Data = &SDP_Attribute_ServiceClassIDs },\r
+ {.AttributeID = SDP_ATTRIBUTE_ID_VERSION, .Data = &SDP_Attribute_Version },\r
+ {.AttributeID = SDP_ATTRIBUTE_ID_LANGIDOFFSET, .Data = &SDP_Attribute_LangOffset },\r
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICENAME, .Data = &SDP_Attribute_ServiceName },\r
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION, .Data = &SDP_Attribute_ServiceDescription },\r
+\r
+ SERVICE_ATTRIBUTE_TABLE_TERMINATOR\r
+ };\r
+\r
+const struct\r
+{\r
+ uint8_t Header;\r
+ uint32_t Data;\r
+} PROGMEM RFCOMM_Attribute_ServiceHandle = {(SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_32Bit), SWAPENDIAN_32(0x00010001)};\r
+\r
+const struct\r
+{\r
+ uint8_t Header;\r
+ uint16_t Size;\r
+ ClassUUID_t UUIDList[];\r
+} PROGMEM RFCOMM_Attribute_ServiceClassIDs =\r
+ {\r
+ .Header = (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable16Bit),\r
+ .Size = SWAPENDIAN_16(sizeof(ClassUUID_t) * 1),\r
+ .UUIDList =\r
+ {\r
+ {.Header = (SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), .UUID = {BASE_96BIT_UUID, 0x01, 0x11, 0x00, 0x00}}\r
+ }\r
+ };\r
+\r
+const struct\r
+{\r
+ uint8_t Header;\r
+ uint8_t Size;\r
+ char Text[];\r
+} PROGMEM RFCOMM_Attribute_ServiceName =\r
+ {\r
+ .Header = (SDP_DATATYPE_String | SDP_DATASIZE_Variable8Bit),\r
+ .Size = sizeof("Serial Port") - 1,\r
+ .Text = "Serial Port",\r
+ };\r
+\r
+const struct\r
+{\r
+ uint8_t Header;\r
+ uint8_t Size;\r
+ char Text[];\r
+} PROGMEM RFCOMM_Attribute_ServiceDescription =\r
+ {\r
+ .Header = (SDP_DATATYPE_String | SDP_DATASIZE_Variable8Bit),\r
+ .Size = sizeof("Wireless Serial Port Service") - 1,\r
+ .Text = "Wireless Serial Port Service",\r
+ };\r
+\r
+const ServiceAttributeTable_t RFCOMM_Attribute_Table[] PROGMEM =\r
+ {\r
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICERECORDHANDLE, .Data = &RFCOMM_Attribute_ServiceHandle },\r
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICECLASSIDS, .Data = &RFCOMM_Attribute_ServiceClassIDs },\r
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICENAME, .Data = &RFCOMM_Attribute_ServiceName },\r
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION, .Data = &RFCOMM_Attribute_ServiceDescription },\r
+\r
+ SERVICE_ATTRIBUTE_TABLE_TERMINATOR\r
+ };\r