From f8aa63d0d8f0f410df84fab22885253843e47fa8 Mon Sep 17 00:00:00 2001 From: Roberto Viola Date: Tue, 10 Dec 2024 15:01:55 +0100 Subject: [PATCH] Update horizontreadmill.cpp --- src/devices/horizontreadmill/horizontreadmill.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/devices/horizontreadmill/horizontreadmill.cpp b/src/devices/horizontreadmill/horizontreadmill.cpp index 3ec2af283..390a560bb 100644 --- a/src/devices/horizontreadmill/horizontreadmill.cpp +++ b/src/devices/horizontreadmill/horizontreadmill.cpp @@ -2316,8 +2316,11 @@ bool horizontreadmill::discoverServicesWin11(const QBluetoothAddress& address) { BLUETOOTH_DEVICE_INFO deviceInfo = { sizeof(BLUETOOTH_DEVICE_INFO) }; deviceInfo.Address.ullLong = address.toUInt64(); - if (BluetoothGetDeviceInfo(nullptr, &deviceInfo) != ERROR_SUCCESS) { - qDebug() << "Failed to get device info"; + DWORD error = BluetoothGetDeviceInfo(nullptr, &deviceInfo); + if (error != ERROR_SUCCESS) { + qDebug() << "Failed to get device info. Error code:" << error; + DWORD lastError = GetLastError(); + qDebug() << "Last error:" << lastError; return false; }