| 32 | } |
| 33 | |
| 34 | void 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 | |
| 47 | void GpsService::removeGpsDevice(const std::shared_ptr<GpsDevice>& device) { |
| 48 | auto lock = mutex.asScopedLock(); |
nothing calls this directly
no test coverage detected