1 /* 2 * Copyright 2008-2009, Oliver Ruiz Dorantes, <oliver.ruiz.dorantes@gmail.com> 3 * Copyright 2012-2013, Tri-Edge AI <triedgeai@gmail.com> 4 * Copyright 2021, Haiku, Inc. 5 * Distributed under the terms of the MIT License. 6 * 7 * Authors: 8 * Fredrik Modéen <fredrik_at_modeen.se> 9 */ 10 11 #ifndef BLUETOOTH_SETTINGS_H 12 #define BLUETOOTH_SETTINGS_H 13 14 #include <bluetooth/bdaddrUtils.h> 15 #include <bluetooth/LocalDevice.h> 16 17 #include <File.h> 18 #include <FindDirectory.h> 19 #include <Path.h> 20 #include <SettingsMessage.h> 21 22 23 class BluetoothSettings 24 { 25 public: 26 BluetoothSettings(); 27 28 bdaddr_t PickedDevice() const 29 { return fCurrentSettings.pickeddevice; } 30 DeviceClass LocalDeviceClass() const 31 { return fCurrentSettings.localdeviceclass; } 32 int32 Policy() const 33 { return fCurrentSettings.policy; } 34 int32 InquiryTime() const 35 { return fCurrentSettings.inquirytime; } 36 37 void SetPickedDevice(bdaddr_t pickeddevice); 38 void SetLocalDeviceClass(DeviceClass localdeviceclass); 39 void SetPolicy(int32 policy); 40 void SetInquiryTime(int32 inquirytime); 41 42 void LoadSettings(); 43 void SaveSettings(); 44 45 private: 46 struct BTSetting { 47 bdaddr_t pickeddevice; 48 DeviceClass localdeviceclass; 49 int32 policy; 50 int32 inquirytime; 51 }; 52 53 SettingsMessage fSettingsMessage; 54 55 BTSetting fCurrentSettings; 56 }; 57 58 #endif // BLUETOOTH_SETTINGS_H 59