diff --git a/CMakeLists.txt b/CMakeLists.txt index 86e8f6f86..3e6e85963 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -631,7 +631,7 @@ elseif(APPLE) src/detection/battery/battery_apple.c src/detection/bios/bios_apple.c src/detection/bluetooth/bluetooth_apple.m - src/detection/bluetoothradio/bluetoothradio_nosupport.c + src/detection/bluetoothradio/bluetoothradio_apple.m src/detection/board/board_apple.c src/detection/bootmgr/bootmgr_apple.c src/detection/brightness/brightness_apple.c diff --git a/src/detection/bluetoothradio/bluetoothradio_apple.m b/src/detection/bluetoothradio/bluetoothradio_apple.m new file mode 100644 index 000000000..c68e9eee1 --- /dev/null +++ b/src/detection/bluetoothradio/bluetoothradio_apple.m @@ -0,0 +1,26 @@ +#include "bluetoothradio.h" + +#import + +const char* ffDetectBluetoothRadio(FFlist* devices /* FFBluetoothResult */) +{ + IOBluetoothHostController* ctrl = IOBluetoothHostController.defaultController; + if(!ctrl) + return "IOBluetoothHostController.defaultController failed"; + + FFBluetoothRadioResult* device = ffListAdd(devices); + ffStrbufInitS(&device->name, ctrl.nameAsString.UTF8String); + ffStrbufInitS(&device->address, ctrl.addressAsString.UTF8String); + device->lmpVersion = 0; + device->hciVersion = 0; + device->lmpSubversion = 0; + device->hciRevision = 0; + + #ifdef __aarch64__ + device->vendor = "Apple"; + #else + device->vendor = "Unknown"; // Hackintosh? + #endif + + return NULL; +}