summaryrefslogtreecommitdiffstats
path: root/src/detection/bluetooth/bluetooth_haiku.cpp
diff options
context:
space:
mode:
authorsumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
committersumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
commit76424950e373d3b04ac3dd13019151bfba3e8423 (patch)
tree4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/detection/bluetooth/bluetooth_haiku.cpp
Add the files
Diffstat (limited to 'src/detection/bluetooth/bluetooth_haiku.cpp')
-rw-r--r--src/detection/bluetooth/bluetooth_haiku.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/detection/bluetooth/bluetooth_haiku.cpp b/src/detection/bluetooth/bluetooth_haiku.cpp
new file mode 100644
index 0000000..8ed52c5
--- /dev/null
+++ b/src/detection/bluetooth/bluetooth_haiku.cpp
@@ -0,0 +1,30 @@
+extern "C" {
+#include "bluetooth.h"
+#include "common/io.h"
+}
+
+#include <bluetooth/LocalDevice.h>
+
+const char* ffDetectBluetooth(FF_A_UNUSED FFBluetoothOptions* options, FFlist* devices /* FFBluetoothResult */) {
+ using namespace Bluetooth;
+ FF_SUPPRESS_IO();
+
+ LocalDevice* dev = LocalDevice::GetLocalDevice();
+ if (!dev) {
+ return NULL;
+ }
+
+ BString devClass;
+ dev->GetDeviceClass().DumpDeviceClass(devClass);
+
+ FFBluetoothResult* device = FF_LIST_ADD(FFBluetoothResult, *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;
+}