diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-05-20 13:06:04 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-05-20 13:06:04 +0000 |
| commit | 108ab5307cce5b7e286e66e0938ac5fd63c1b85b (patch) | |
| tree | c970426170a82fb64a892d1348e6cd9f735ed8cb /Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c | |
| parent | 8a51ca21c1d2e0b3e4f7925de39c4d1946612571 (diff) | |
Short UUIDs are measured in bytes, not bits -- update Service Discovery Protocol code so that it can now correctly match against UUIDs in the service table.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1268 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c')
| -rw-r--r-- | Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c b/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c index 4eb26210..c140c17d 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/ServiceDiscoveryProtocol.c @@ -76,10 +76,17 @@ const ServiceTable_t SDP_Services_Table[] = }, }; -/* Base UUID value common to all standardized Bluetooth services */ +/** Base UUID value common to all standardized Bluetooth services */ const uint8_t BaseUUID[] = {BASE_96BIT_UUID, 0x00, 0x00, 0x00, 0x00}; +/** Main Service Discovery Protocol packet processing routine. This function processes incomming SDP packets from + * a connected Bluetooth device, and sends back appropriate responses to allow other devices to determine the + * services the local device exposes. + * + * \param[in] Data Incomming packet data containing the SDP request + * \param[in] Channel Channel the request was issued to by the remote device + */ void ServiceDiscovery_ProcessPacket(void* Data, Bluetooth_Channel_t* Channel) { SDP_PDUHeader_t* SDPHeader = (SDP_PDUHeader_t*)Data; @@ -209,7 +216,7 @@ static uint8_t ServiceDiscovery_GetUUIDList(uint8_t UUIDList[][UUID_SIZE_BYTES], uint8_t UUIDLength = ServiceDiscovery_GetDataElementSize(CurrentParameter, &ElementHeaderSize); memcpy(CurrentUUID, BaseUUID, sizeof(BaseUUID)); - memcpy(&CurrentUUID[(UUIDLength <= 32) ? (sizeof(BaseUUID) - 32) : 0], *CurrentParameter, UUIDLength); + memcpy(&CurrentUUID[(UUIDLength <= 4) ? (UUID_SIZE_BYTES - 4) : 0], *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, |
