SensorObserverController
open class SensorObserverController : Controller
Observes Sensors and Sensor-related objects. This controller is designed to be used by a client as a counterpart to a SensorSourceController which should answer its requests.
-
Observe the channeled observations for the given Sensor. By default, the channelId is the same as the sensorId.
Declaration
Swift
public func observeChanneledObservations(sensorId: CoatyUUID, channelId: String? = nil) throws -> Observable<Observation>
Parameters
sensorId
ObjectId of the sensor to listen observations of.
channelId
ChannelId to listen to. This is by default the objectId of the Sensor and therefore should be left nil. (optional)
-
Observe the advertised observations for the given Sensor.
Declaration
Swift
public func observeAdvertisedObservations(sensorId: CoatyUUID) throws -> Observable<Observation>
Parameters
sensorId
ObjectId of the sensor to listen observations of.
-
Returns an observable emitting advertised Sensors. This method does not perform any kind of caching and it should be performed on the application-side.
Declaration
Swift
public func observeAdvertisedSensors() throws -> Observable<Sensor>
-
Returns an observable of the Sensors in the system.
This is performed by sending a Discovery event with the object type of Sensor.
This method does not perform any kind of caching and it should be performed on the application-side.
Declaration
Swift
public func discoverSensors() -> Observable<Sensor>
-
Returns an observable of the Sensors that are associated with this Thing.
This is performed by sending a Query event for Sensor objects with the parentObjectId matching the objectId of the Thing.
This method does not perform any kind of caching and it should be performed on the application-side.