From 8f750da55956e4f5ba50dca25c247a4c1a1a0584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 5 Nov 2024 22:11:16 +0800 Subject: [PATCH] Bluetooth (Windows): fix mac address detection --- src/detection/bluetooth/bluetooth_windows.c | 12 ++++++------ .../bluetoothradio/bluetoothradio_windows.c | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/detection/bluetooth/bluetooth_windows.c b/src/detection/bluetooth/bluetooth_windows.c index acb2f4bb4..e163214d3 100644 --- a/src/detection/bluetooth/bluetooth_windows.c +++ b/src/detection/bluetooth/bluetooth_windows.c @@ -33,13 +33,13 @@ const char* ffDetectBluetooth(FFlist* devices /* FFBluetoothResult */) do { FFBluetoothResult* device = ffListAdd(devices); ffStrbufInitWS(&device->name, btdi.szName); - ffStrbufInitF(&device->address, "%02x:%02x:%02x:%02x:%02x:%02x", - btdi.Address.rgBytes[0], - btdi.Address.rgBytes[1], - btdi.Address.rgBytes[2], - btdi.Address.rgBytes[3], + ffStrbufInitF(&device->address, "%02X:%02X:%02X:%02X:%02X:%02X", + btdi.Address.rgBytes[5], btdi.Address.rgBytes[4], - btdi.Address.rgBytes[5]); + btdi.Address.rgBytes[3], + btdi.Address.rgBytes[2], + btdi.Address.rgBytes[1], + btdi.Address.rgBytes[0]); ffStrbufInit(&device->type); device->battery = 0; device->connected = !!btdi.fConnected; diff --git a/src/detection/bluetoothradio/bluetoothradio_windows.c b/src/detection/bluetoothradio/bluetoothradio_windows.c index c8471d442..c4482f14d 100644 --- a/src/detection/bluetoothradio/bluetoothradio_windows.c +++ b/src/detection/bluetoothradio/bluetoothradio_windows.c @@ -84,12 +84,12 @@ const char* ffDetectBluetoothRadio(FFlist* devices /* FFBluetoothRadioResult */) BLUETOOTH_ADDRESS_STRUCT addr = { .ullLong = blri.localInfo.address }; ffStrbufInitF(&device->address, "%02x:%02x:%02x:%02x:%02x:%02x", - addr.rgBytes[0], - addr.rgBytes[1], - addr.rgBytes[2], - addr.rgBytes[3], + addr.rgBytes[5], addr.rgBytes[4], - addr.rgBytes[5]); + addr.rgBytes[3], + addr.rgBytes[2], + addr.rgBytes[1], + addr.rgBytes[0]); device->lmpVersion = blri.radioInfo.lmpVersion; device->lmpSubversion = blri.radioInfo.lmpSubversion;