Xavia SDK c++ API 2.1.0
API description of the xavia library
Loading...
Searching...
No Matches
iSensor.h
1#pragma once
2
3#include <cstddef>
4#include <vector>
5#include <memory>
6
7namespace xavia::sdk
8{
9 class SerialNumber;
10 class ICamera;
11 enum class SensorState;
12 enum class SensorError;
13 struct FullSensorState;
14 constexpr std::size_t DEFAULT_STATE_CHANGE_TIMEOUT_MS = 5000;
15
24 class ISensor
25 {
26 public:
27 virtual ~ISensor() = default;
28
40 virtual void Start(const std::size_t& timeoutMS = DEFAULT_STATE_CHANGE_TIMEOUT_MS) = 0;
41
53 virtual void Stop(const std::size_t& timeoutMS = DEFAULT_STATE_CHANGE_TIMEOUT_MS) = 0;
54
65 virtual SerialNumber GetSerialNumber() const = 0;
66
77 virtual SensorState GetCurrentState() const = 0;
78
98 virtual std::vector<SensorError> GetErrors(const std::size_t& timeoutMS = DEFAULT_STATE_CHANGE_TIMEOUT_MS ) = 0;
99
111 virtual void Reboot() = 0;
112
125 virtual void Poweroff() = 0;
126
140 virtual std::shared_ptr<ICamera> GetCamera() const = 0;
141 };
142}
Camera object interface.
Definition iCamera.h:24
Sensor object interface.
Definition iSensor.h:25
virtual SensorState GetCurrentState() const =0
Provides the current state of the sensor (running, idle, error).
virtual void Start(const std::size_t &timeoutMS=DEFAULT_STATE_CHANGE_TIMEOUT_MS)=0
Starts the sensor.
virtual void Reboot()=0
Sends a 'reboot' signal to the sensor.
virtual void Poweroff()=0
Sends a 'poweroff' signal to the sensor.
virtual void Stop(const std::size_t &timeoutMS=DEFAULT_STATE_CHANGE_TIMEOUT_MS)=0
Stop the sensor.
virtual SerialNumber GetSerialNumber() const =0
Provides the serial number of the sensor from local memory.
virtual std::vector< SensorError > GetErrors(const std::size_t &timeoutMS=DEFAULT_STATE_CHANGE_TIMEOUT_MS)=0
Retrieves the state from the sensor and reports a list of errors.
virtual std::shared_ptr< ICamera > GetCamera() const =0
Get the camera associated with this sensor.
utility class that holds a serial number and allows interpretation.
Definition serialNumber.h:31