BluetoothRadio (macOS): add dirty support

This commit is contained in:
李通洲
2024-07-28 13:06:29 +08:00
parent 96c58148f6
commit 7a75615d9e
2 changed files with 27 additions and 1 deletions
+1 -1
View File
@@ -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
@@ -0,0 +1,26 @@
#include "bluetoothradio.h"
#import <IOBluetooth/IOBluetooth.h>
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;
}