2 * Copyright 2008-2009, Oliver Ruiz Dorantes, <oliver.ruiz.dorantes@gmail.com>
3 * Copyright 2012-2013, Tri-Edge AI <triedgeai@gmail.com>
5 * All rights reserved. Distributed under the terms of the MIT license.
8 #include "BluetoothSettings.h"
10 BluetoothSettings::BluetoothSettings()
12 find_directory(B_USER_SETTINGS_DIRECTORY
, &fPath
);
13 fPath
.Append("Bluetooth_settings", true);
17 BluetoothSettings::~BluetoothSettings()
24 BluetoothSettings::Defaults()
26 Data
.PickedDevice
= bdaddrUtils::NullAddress();
27 Data
.LocalDeviceClass
= DeviceClass();
32 BluetoothSettings::Load()
34 fFile
= new BFile(fPath
.Path(), B_READ_ONLY
);
36 if (fFile
->InitCheck() == B_OK
) {
37 fFile
->Read(&Data
, sizeof(Data
));
38 // TODO: Add more settings here.
47 BluetoothSettings::Save()
49 fFile
= new BFile(fPath
.Path(), B_WRITE_ONLY
| B_CREATE_FILE
);
51 if (fFile
->InitCheck() == B_OK
) {
52 fFile
->Write(&Data
, sizeof(Data
));
53 // TODO: Add more settings here.