diff options
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib/SDPServices.c')
-rw-r--r-- | Demos/Host/Incomplete/BluetoothHost/Lib/SDPServices.c | 150 |
1 files changed, 122 insertions, 28 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/SDPServices.c b/Demos/Host/Incomplete/BluetoothHost/Lib/SDPServices.c index 28b9d7774..96401c010 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/SDPServices.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/SDPServices.c @@ -30,6 +30,8 @@ #include "SDPServices.h"
+/* ------------------------------ SDP SERVICE ATTRIBUTES ------------------------------ */
+
const struct
{
uint8_t Header;
@@ -50,25 +52,7 @@ const struct (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable16Bit),
SWAPENDIAN_16(sizeof(ItemUUID_t) * 1),
{
- {(SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x10, 0x00}}}
- }
- };
-
-const struct
-{
- uint8_t Header;
- uint16_t Size;
- ItemProtocol_t ProtocolList[];
-} PROGMEM SDP_Attribute_ProtocolDescriptor =
- {
- (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable16Bit),
- SWAPENDIAN_16(sizeof(ItemProtocol_t) * 1),
- {
- {
- (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit),
- sizeof(UUID_t),
- {(SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x01, 0x00}}},
- }
+ {(SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), SDP_CLASS_UUID}
}
};
@@ -115,7 +99,6 @@ const ServiceAttributeTable_t SDP_Attribute_Table[] PROGMEM = {
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICERECORDHANDLE, .Data = &SDP_Attribute_ServiceHandle },
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICECLASSIDS, .Data = &SDP_Attribute_ServiceClassIDs },
-// {.AttributeID = SDP_ATTRIBUTE_ID_PROTOCOLDESCRIPTORLIST, .Data = &SDP_Attribute_ProtocolDescriptor },
{.AttributeID = SDP_ATTRIBUTE_ID_VERSION, .Data = &SDP_Attribute_Version },
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICENAME, .Data = &SDP_Attribute_ServiceName },
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION, .Data = &SDP_Attribute_ServiceDescription },
@@ -123,6 +106,10 @@ const ServiceAttributeTable_t SDP_Attribute_Table[] PROGMEM = SERVICE_ATTRIBUTE_TABLE_TERMINATOR
};
+
+/* ------------------------------ RFCOMM SERVICE ATTRIBUTES ------------------------------ */
+
+
const struct
{
uint8_t Header;
@@ -143,21 +130,35 @@ const struct (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable16Bit),
SWAPENDIAN_16(sizeof(ItemUUID_t) * 1),
{
- {(SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), {BASE_80BIT_UUID, {0x00, 0x00, 0x00, 0x00, 0x11, 0x01}}}
+ {(SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), SP_CLASS_UUID}
}
};
const struct
{
- uint8_t Header;
- uint8_t Size;
- Item16Bit_t OffsetList[];
-} PROGMEM RFCOMM_Attribute_LangOffset =
+ uint8_t Header;
+ uint16_t Size;
+
+ ItemProtocol_t ProtocolList[];
+} PROGMEM RFCOMM_Attribute_ProtocolDescriptor =
{
- (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit),
- (sizeof(Item16Bit_t) * 1),
+ (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable16Bit),
+ SWAPENDIAN_16(sizeof(ItemProtocol_t) * 2),
{
- {(SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_16Bit), SWAPENDIAN_16(0x0100)}
+ {
+ (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit),
+ sizeof(UUID_t),
+ {
+ {(SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), L2CAP_UUID},
+ }
+ },
+ {
+ (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit),
+ sizeof(UUID_t),
+ {
+ {(SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), RFCOMM_UUID},
+ }
+ }
}
};
@@ -189,8 +190,101 @@ const ServiceAttributeTable_t RFCOMM_Attribute_Table[] PROGMEM = {
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICERECORDHANDLE, .Data = &RFCOMM_Attribute_ServiceHandle },
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICECLASSIDS, .Data = &RFCOMM_Attribute_ServiceClassIDs },
+ {.AttributeID = SDP_ATTRIBUTE_ID_PROTOCOLDESCRIPTORLIST, .Data = &RFCOMM_Attribute_ProtocolDescriptor },
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICENAME, .Data = &RFCOMM_Attribute_ServiceName },
{.AttributeID = SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION, .Data = &RFCOMM_Attribute_ServiceDescription },
SERVICE_ATTRIBUTE_TABLE_TERMINATOR
};
+
+
+/* ------------------------------ L2CAP SERVICE ATTRIBUTES ------------------------------ */
+
+
+const struct
+{
+ uint8_t Header;
+ uint32_t Data;
+} PROGMEM L2CAP_Attribute_ServiceHandle =
+ {
+ (SDP_DATATYPE_UnsignedInt | SDP_DATASIZE_32Bit),
+ SWAPENDIAN_32(0x00010002),
+ };
+
+const struct
+{
+ uint8_t Header;
+ uint16_t Size;
+ ItemUUID_t UUIDList[];
+} PROGMEM L2CAP_Attribute_ServiceClassIDs =
+ {
+ (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable16Bit),
+ SWAPENDIAN_16(sizeof(ItemUUID_t) * 2),
+ {
+ {(SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), SDP_CLASS_UUID },
+ {(SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), SP_CLASS_UUID },
+ }
+ };
+
+const struct
+{
+ uint8_t Header;
+ uint16_t Size;
+
+ ItemProtocol_t ProtocolList[];
+} PROGMEM L2CAP_Attribute_ProtocolDescriptor =
+ {
+ (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable16Bit),
+ SWAPENDIAN_16(sizeof(ItemProtocol_t) * 2),
+ {
+ {
+ (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit),
+ sizeof(UUID_t),
+ {
+ {(SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), L2CAP_UUID},
+ }
+ },
+ {
+ (SDP_DATATYPE_Sequence | SDP_DATASIZE_Variable8Bit),
+ sizeof(UUID_t),
+ {
+ {(SDP_DATATYPE_UUID | SDP_DATASIZE_128Bit), RFCOMM_UUID},
+ }
+ }
+ }
+ };
+
+const struct
+{
+ uint8_t Header;
+ uint8_t Size;
+ char Text[];
+} PROGMEM L2CAP_Attribute_ServiceName =
+ {
+ (SDP_DATATYPE_String | SDP_DATASIZE_Variable8Bit),
+ sizeof("L2CAP") - 1,
+ "L2CAP",
+ };
+
+const struct
+{
+ uint8_t Header;
+ uint8_t Size;
+ char Text[];
+} PROGMEM L2CAP_Attribute_ServiceDescription =
+ {
+ (SDP_DATATYPE_String | SDP_DATASIZE_Variable8Bit),
+ sizeof("Logical Link Layer") - 1,
+ "Logical Link Layer",
+ };
+
+const ServiceAttributeTable_t L2CAP_Attribute_Table[] PROGMEM =
+ {
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICERECORDHANDLE, .Data = &L2CAP_Attribute_ServiceHandle },
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICECLASSIDS, .Data = &L2CAP_Attribute_ServiceClassIDs },
+ {.AttributeID = SDP_ATTRIBUTE_ID_PROTOCOLDESCRIPTORLIST, .Data = &L2CAP_Attribute_ProtocolDescriptor },
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICENAME, .Data = &L2CAP_Attribute_ServiceName },
+ {.AttributeID = SDP_ATTRIBUTE_ID_SERVICEDESCRIPTION, .Data = &L2CAP_Attribute_ServiceDescription },
+
+ SERVICE_ATTRIBUTE_TABLE_TERMINATOR
+ };
|