+ CurrentParameter += AttributeLength;
+ }
+
+ struct
+ {
+ SDP_PDUHeader_t SDPHeader;
+ uint8_t ResponseData[100];
+ } ResponsePacket;
+
+ ResponsePacket.SDPHeader.PDU = SDP_PDU_SERVICESEARCHATTRIBUTERESPONSE;
+ ResponsePacket.SDPHeader.TransactionID = SDPHeader->TransactionID;
+
+ Bluetooth_SendPacket(&ResponsePacket, (sizeof(ResponsePacket.SDPHeader) + ResponsePacket.SDPHeader.ParameterLength),
+ Channel);
+}
+
+static uint8_t ServiceDiscovery_GetUUIDList(uint8_t UUIDList[12][16], const void** CurrentParameter)
+{
+ uint8_t ElementHeaderSize;
+ uint8_t TotalUUIDs = 0;
+
+ uint16_t ServicePatternLength = ServiceDiscovery_GetDataElementSize(CurrentParameter, &ElementHeaderSize);
+ BT_SDP_DEBUG(2, "-- Total UUID Length: 0x%04X", ServicePatternLength);
+ while (ServicePatternLength)
+ {
+ uint8_t* CurrentUUID = UUIDList[TotalUUIDs++];
+
+ uint8_t UUIDLength = ServiceDiscovery_GetDataElementSize(CurrentParameter, &ElementHeaderSize);
+
+ memcpy(CurrentUUID, BaseUUID, sizeof(BaseUUID));
+
+ if (UUIDLength <= 32)
+ memcpy(&CurrentUUID[sizeof(BaseUUID) - sizeof(uint32_t)], *CurrentParameter, UUIDLength);
+ else
+ memcpy(CurrentUUID, *CurrentParameter, UUIDLength);
+
+ BT_SDP_DEBUG(2, "-- UUID (%d): 0x%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
+ UUIDLength,
+ CurrentUUID[15], CurrentUUID[14], CurrentUUID[13], CurrentUUID[12],
+ CurrentUUID[11], CurrentUUID[10], CurrentUUID[9], CurrentUUID[8],
+ CurrentUUID[7], CurrentUUID[6], CurrentUUID[5], CurrentUUID[4],
+ CurrentUUID[3], CurrentUUID[2], CurrentUUID[1], CurrentUUID[0]);
+
+ ServicePatternLength -= (UUIDLength + ElementHeaderSize);
+ *CurrentParameter += UUIDLength;