|
roo_transceivers
API Documentation for roo_transceivers
|
Convenience Universe for identical, basic sensor-only transceivers.
More...
#include <simple_sensor_universe.h>
Public Member Functions | |
| bool | getDeviceDescriptor (const DeviceLocator &locator, roo_transceivers_Descriptor &descriptor) const override |
Synthesizes a single-sensor descriptor for locator. | |
| Measurement | read (const SensorLocator &locator) const override |
| Reads the single sensor of a device. | |
| bool | write (const ActuatorLocator &locator, float value) override |
| This universe is sensor-only; writes are always rejected. | |
Public Member Functions inherited from roo_transceivers::Universe | |
| virtual | ~Universe ()=default |
| virtual size_t | deviceCount () const =0 |
| Returns the total number of transceiver devices in this universe. | |
| virtual bool | forEachDevice (std::function< bool(const DeviceLocator &)> callback) const =0 |
Iterates over all transceiver devices in this universe, calling callback for each device. | |
| virtual void | requestUpdate ()=0 |
| Requests sensor reading update from underlying devices. | |
| virtual void | addEventListener (EventListener *listener) |
| Registers a listener for device-set and reading update events. | |
| virtual void | removeEventListener (EventListener *listener) |
| Removes a previously registered event listener. | |
Protected Member Functions | |
| virtual Measurement | readSensor (const DeviceLocator &locator) const =0 |
| virtual roo_transceivers_Quantity | getSensorQuantity (DeviceLocator device_locator) const =0 |
Convenience Universe for identical, basic sensor-only transceivers.
Each device exposes exactly one sensor and no actuators.
Can be used e.g. for a collection of identical thermometers.
This class implements the full Universe contract. Implementations only need to provide:
readSensor() to return reading for a device,getSensorQuantity() to define sensor quantity type. Definition at line 17 of file simple_sensor_universe.h.
|
inlineoverridevirtual |
Synthesizes a single-sensor descriptor for locator.
Returns false when locator is not recognized by this universe.
Implements roo_transceivers::Universe.
Definition at line 22 of file simple_sensor_universe.h.
References _roo_transceivers_Descriptor::actuators_count, getSensorQuantity(), _roo_transceivers_Descriptor_Sensor::id, _roo_transceivers_Descriptor_Sensor::quantity, roo_transceivers_Quantity_kUnspecifiedQuantity, _roo_transceivers_Descriptor::sensors, and _roo_transceivers_Descriptor::sensors_count.
|
protectedpure virtual |
Implemented in roo_transceivers::OneWireUniverse.
Referenced by getDeviceDescriptor().
|
inlineoverridevirtual |
Reads the single sensor of a device.
Only empty sensor id ("") is valid. Any non-empty sensor id returns an initial/unspecified measurement.
Implements roo_transceivers::Universe.
Definition at line 40 of file simple_sensor_universe.h.
References roo_transceivers::SensorLocator::device_locator(), readSensor(), and roo_transceivers::SensorLocator::sensor_id().
|
protectedpure virtual |
Implemented in roo_transceivers::OneWireUniverse.
Referenced by read().
|
inlineoverridevirtual |
This universe is sensor-only; writes are always rejected.
Implements roo_transceivers::Universe.
Definition at line 48 of file simple_sensor_universe.h.