MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / save

Function save

Tactility/Source/bluetooth/BluetoothSettings.cpp:45–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45static bool save(const BluetoothSettings& s) {
46 std::map<std::string, std::string> map;
47 file::loadPropertiesFile(SETTINGS_PATH, map); // ignore failure — may not exist yet
48 map[KEY_ENABLE_ON_BOOT] = s.enableOnBoot ? "true" : "false";
49 map[KEY_SPP_AUTO_START] = s.sppAutoStart ? "true" : "false";
50 map[KEY_MIDI_AUTO_START] = s.midiAutoStart ? "true" : "false";
51 return file::savePropertiesFile(SETTINGS_PATH, map);
52}
53
54static BluetoothSettings getCachedOrLoad() {
55 settings_mutex.lock();

Callers 5

setEnableOnBootFunction · 0.70
setSppAutoStartFunction · 0.70
setMidiAutoStartFunction · 0.70
hidHostSubscribeNextFunction · 0.70
bt_event_bridgeFunction · 0.70

Calls 2

loadPropertiesFileFunction · 0.85
savePropertiesFileFunction · 0.85

Tested by

no test coverage detected