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

Method addGpsDevice

Tactility/Source/service/gps/GpsService.cpp:34–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void GpsService::addGpsDevice(const std::shared_ptr<GpsDevice>& device) {
35 auto lock = mutex.asScopedLock();
36 lock.lock();
37
38 GpsDeviceRecord record = {.device = device};
39
40 if (getState() == State::On) { // Ignore during OnPending due to risk of data corruption
41 startGpsDevice(record);
42 }
43
44 deviceRecords.push_back(record);
45}
46
47void GpsService::removeGpsDevice(const std::shared_ptr<GpsDevice>& device) {
48 auto lock = mutex.asScopedLock();

Callers

nothing calls this directly

Calls 3

getStateFunction · 0.85
asScopedLockMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected