| 43 | } |
| 44 | |
| 45 | static 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 | |
| 54 | static BluetoothSettings getCachedOrLoad() { |
| 55 | settings_mutex.lock(); |
no test coverage detected