X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/23a94a7181a0773431b3ea5dbcddab9e06010391..13d812a7188f0b0ecaa07ee66e376a2c5a88742f:/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c b/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c index df0db3bed..62d4c5e39 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c @@ -119,11 +119,10 @@ static void SDP_ProcessServiceSearch(const SDP_PDUHeader_t* const SDPHeader, Blu /* Copy over the service record handle to the response list */ uint8_t AttrHeaderSize; - SDP_GetLocalAttributeContainerSize(AttributeValue, &AttrHeaderSize); - memcpy_P(CurrResponsePos, AttributeValue + AttrHeaderSize, sizeof(uint32_t)); - CurrResponsePos += AttrHeaderSize + sizeof(uint32_t); + uint8_t AttrSize = SDP_GetLocalAttributeContainerSize(AttributeValue, &AttrHeaderSize); + memcpy_P(CurrResponsePos, AttributeValue + AttrHeaderSize, AttrSize); + CurrResponsePos += AttrHeaderSize + AttrSize; - /* Increment the total number of service records added to the list */ AddedServiceHandles++; } @@ -172,7 +171,7 @@ static void SDP_ProcessServiceAttribute(const SDP_PDUHeader_t* const SDPHeader, BT_SDP_DEBUG(2, "-- Max Return Attribute Bytes: 0x%04X", MaxAttributeSize); /* Retrieve the list of Attributes from the request */ - uint16_t AttributeList[15][2]; + uint16_t AttributeList[8][2]; uint8_t TotalAttributes = SDP_GetAttributeList(AttributeList, &CurrentParameter); BT_SDP_DEBUG(2, "-- Total Attributes: %d", TotalAttributes); @@ -263,7 +262,7 @@ static void SDP_ProcessServiceSearchAttribute(const SDP_PDUHeader_t* const SDPHe BT_SDP_DEBUG(2, "-- Max Return Attribute Bytes: 0x%04X", MaxAttributeSize); /* Retrieve the list of Attributes from the request */ - uint16_t AttributeList[15][2]; + uint16_t AttributeList[8][2]; uint8_t TotalAttributes = SDP_GetAttributeList(AttributeList, &CurrentParameter); BT_SDP_DEBUG(2, "-- Total Attributes: %d", TotalAttributes); @@ -487,16 +486,7 @@ static void SDP_CheckUUIDMatch(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_ /* Look for matches in the UUID list against the current attribute UUID value */ for (uint8_t i = 0; i < TotalUUIDs; i++) { - uint8_t CurrentUUID[16]; - memcpy_P(CurrentUUID, (CurrAttribute + 1), 16); - - BT_SDP_DEBUG(2, "-- TEST UUID: %02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", - CurrentUUID[0], CurrentUUID[1], CurrentUUID[2], CurrentUUID[3], - CurrentUUID[4], CurrentUUID[5], - CurrentUUID[6], CurrentUUID[7], - CurrentUUID[8], CurrentUUID[9], - CurrentUUID[10], CurrentUUID[11], CurrentUUID[12], CurrentUUID[13], CurrentUUID[14], CurrentUUID[15]); - + /* Check if the current unmatched UUID is identical to the search UUID */ if (!(UUIDMatch[i]) && !(memcmp_P(UUIDList[i], (CurrAttribute + 1), UUID_SIZE_BYTES))) { /* Indicate match found for the current attribute UUID and early-abort */