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

Function save

Tactility/Source/bluetooth/BluetoothPairedDevice.cpp:79–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79bool save(const PairedDevice& device) {
80 const auto addr_hex = addrToHex(device.addr);
81 std::map<std::string, std::string> map;
82 map[KEY_NAME] = device.name;
83 map[KEY_ADDR] = addr_hex;
84 map[KEY_AUTO_CONNECT] = device.autoConnect ? "true" : "false";
85 map[KEY_PROFILE_ID] = std::to_string(device.profileId);
86 return file::savePropertiesFile(getFilePath(addr_hex), map);
87}
88
89bool remove(const std::string& addr_hex) {
90 const auto file_path = getFilePath(addr_hex);

Callers

nothing calls this directly

Calls 3

addrToHexFunction · 0.85
savePropertiesFileFunction · 0.85
getFilePathFunction · 0.85

Tested by

no test coverage detected