mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2025-02-20 11:43:27 +08:00
Bluetooth (Haiku): WIP
This commit is contained in:
parent
5e615d12d5
commit
41d930b1e1
@ -1134,7 +1134,7 @@ elseif(Haiku)
|
||||
src/detection/cpucache/cpucache_shared.c
|
||||
src/detection/cpuusage/cpuusage_haiku.c
|
||||
src/detection/cursor/cursor_nosupport.c
|
||||
src/detection/bluetooth/bluetooth_nosupport.c
|
||||
src/detection/bluetooth/bluetooth_haiku.cpp
|
||||
src/detection/bluetoothradio/bluetoothradio_nosupport.c
|
||||
src/detection/disk/disk_haiku.cpp
|
||||
src/detection/dns/dns_linux.c
|
||||
@ -1649,6 +1649,7 @@ elseif(Haiku)
|
||||
PRIVATE "bnetapi"
|
||||
PRIVATE "media"
|
||||
PRIVATE "device"
|
||||
PRIVATE "bluetooth"
|
||||
PRIVATE "be"
|
||||
PRIVATE "gnu"
|
||||
)
|
||||
|
26
src/detection/bluetooth/bluetooth_haiku.cpp
Normal file
26
src/detection/bluetooth/bluetooth_haiku.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
extern "C" {
|
||||
#include "bluetooth.h"
|
||||
}
|
||||
|
||||
#include <bluetooth/LocalDevice.h>
|
||||
|
||||
const char* ffDetectBluetooth(FF_MAYBE_UNUSED FFBluetoothOptions* options, FFlist* devices /* FFBluetoothResult */)
|
||||
{
|
||||
using namespace Bluetooth;
|
||||
LocalDevice* dev = LocalDevice::GetLocalDevice();
|
||||
if (!dev) return NULL;
|
||||
|
||||
BString devClass;
|
||||
dev->GetDeviceClass().DumpDeviceClass(devClass);
|
||||
|
||||
FFBluetoothResult* device = (FFBluetoothResult*) ffListAdd(devices);
|
||||
ffStrbufInitS(&device->name, dev->GetFriendlyName());
|
||||
ffStrbufInitS(&device->address, bdaddrUtils::ToString(dev->GetBluetoothAddress()).String());
|
||||
ffStrbufInitS(&device->type, devClass.String());
|
||||
device->battery = 0;
|
||||
device->connected = true;
|
||||
|
||||
// TODO: more devices?
|
||||
|
||||
return NULL;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user