mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
39 lines
911 B
C++
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
|