Ken Van Hoeylandt 14e459e50f
GPS implementation (#216)
Implemented basic GPS support:
- GPS HAL
- GPS Service
- GPS Settings app
2025-02-11 23:46:52 +01:00

39 lines
911 B
C++

#include "Tactility/service/ServiceManifest.h"
#include "Tactility/service/ServiceRegistry.h"
#include "Tactility/service/gps/GpsService.h"
using tt::hal::gps::GpsDevice;
namespace tt::service::gps {
extern ServiceManifest manifest;
static std::shared_ptr<GpsService> findGpsService() {
auto service = findServiceById(manifest.id);
assert(service != nullptr);
return std::static_pointer_cast<GpsService>(service);
}
void addGpsDevice(const std::shared_ptr<GpsDevice>& device) {
return findGpsService()->addGpsDevice(device);
}
void removeGpsDevice(const std::shared_ptr<GpsDevice>& device) {
return findGpsService()->removeGpsDevice(device);
}
bool startReceiving() {
return findGpsService()->startReceiving();
}
void stopReceiving() {
findGpsService()->stopReceiving();
}
bool isReceiving() {
return findGpsService()->isReceiving();
}
} // namespace tt::service::gps