diff --git a/headers/os/bluetooth/RemoteDevice.h b/headers/os/bluetooth/RemoteDevice.h index 8220dc3d02..2d7ad5c4db 100644 --- a/headers/os/bluetooth/RemoteDevice.h +++ b/headers/os/bluetooth/RemoteDevice.h @@ -53,6 +53,11 @@ class RemoteDevice { bdaddr_t fBdaddr; LocalDevice* fDiscovererLocalDevice; + + uint8 fPageRepetitionMode; + uint8 fScanPeriodMode; + uint8 fScanMode; + uint16 fClockOffset; }; diff --git a/src/kits/bluetooth/DiscoveryListener.cpp b/src/kits/bluetooth/DiscoveryListener.cpp index 722c4a96e0..79ac6fc76e 100644 --- a/src/kits/bluetooth/DiscoveryListener.cpp +++ b/src/kits/bluetooth/DiscoveryListener.cpp @@ -84,6 +84,12 @@ DiscoveryListener::MessageReceived(BMessage* message) if (bdaddrUtils::Compare( (bdaddr_t*) &inquiryInfo->bdaddr, &b1 )) { + // update these values + fRemoteDevicesList.ItemAt(index)->fPageRepetitionMode = inquiryInfo->pscan_rep_mode; + fRemoteDevicesList.ItemAt(index)->fScanPeriodMode = inquiryInfo->pscan_period_mode; + fRemoteDevicesList.ItemAt(index)->fScanMode = inquiryInfo->pscan_mode; + fRemoteDevicesList.ItemAt(index)->fClockOffset = inquiryInfo->clock_offset; + duplicatedFound = true; break; } @@ -92,10 +98,16 @@ DiscoveryListener::MessageReceived(BMessage* message) if (!duplicatedFound) { - // DeviceClass(inquiryInfo->dev_class[0] | inquiryInfo->dev_class[1]<<8 | inquiryInfo->dev_class[2]<<16 ) + // TODO: DeviceClass(inquiryInfo->dev_class[0] | inquiryInfo->dev_class[1]<<8 | inquiryInfo->dev_class[2]<<16 ) rd = new RemoteDevice(inquiryInfo->bdaddr); fRemoteDevicesList.AddItem(rd); + // keep all inquiry reported data rd->SetLocalDeviceOwner(fLocalDevice); + rd->fPageRepetitionMode = inquiryInfo->pscan_rep_mode; + rd->fScanPeriodMode = inquiryInfo->pscan_period_mode; + rd->fScanMode = inquiryInfo->pscan_mode; + rd->fClockOffset = inquiryInfo->clock_offset; + DeviceDiscovered( rd, DeviceClass(inquiryInfo->dev_class[0] | inquiryInfo->dev_class[1]<<8 | inquiryInfo->dev_class[2]<<16 ));