Skip to main content

Interface ISensorService

Represents a sensor service interface for registering sensors.

Assembly: Meadow.Contracts.dll
View Source
Declaration
public interface ISensorService

Methods

RegisterSensor(ISensor)

Registers a sampling sensor with the sensor service.

View Source
Declaration
void RegisterSensor(ISensor sensor)
Parameters
TypeNameDescription
Meadow.Peripherals.Sensors.ISensorsensorThe sensor to register.

GetSensorsOfType<TSensor>()

Gets all registered sensors of a specified type

View Source
Declaration
IEnumerable<TSensor> GetSensorsOfType<TSensor>() where TSensor : ISensor
Returns

System.Collections.Generic.IEnumerable<<TSensor>>

Type Parameters
NameDescription
TSensorThe type of sensor to search for

GetSensorsWithData<TUnit>()

Gets all registered sensors that can provide data of a specified unit type

View Source
Declaration
IEnumerable<ISensor> GetSensorsWithData<TUnit>() where TUnit : struct
Returns

System.Collections.Generic.IEnumerable<Meadow.Peripherals.Sensors.ISensor>

Type Parameters
NameDescription
TUnitThe unit type of the sensor data to search for