public interface ISensorDataInterface extends IStreamingDataInterface
Interface to be implemented by all sensor drivers connected to the system.
Data provided by this interface can be actual measurements but also status information. Each sensor output is mapped to a separate instance of this interface, allowing them to have completely independent sampling rates.
Even when storage is not supported, implementations MUST at least be
capable of retaining the latest record received from sensor and make it
available with getLatestRecord()
.
Implementation MUST send events of type
SensorDataEvent
when new data is produced
by sensor.
Modifier and Type | Method and Description |
---|---|
int |
clearAllRecords()
Clears all records currently stored in driver or sensor memory.
This method must be implemented if isStorageSupported() returns true. |
java.util.List<DataBlock> |
getAllRecords(boolean clear)
Retrieves all records stored by the driver or sensor.
This method must be implemented if isStorageSupported() returns true. |
DataBlock |
getLatestRecord()
Gets the latest record received on this data channel.
|
java.util.List<DataBlock> |
getLatestRecords(int maxRecords,
boolean clear)
Retrieves the N last records stored.
This method must be implemented if isStorageSupported() returns true. |
java.lang.String |
getName()
Gets this output interface name.
|
int |
getNumberOfAvailableRecords()
Retrieves number of record currectly available from driver or on-board sensor memory.
This method must be implemented if isStorageSupported() returns true. |
ISensorModule<?> |
getParentModule()
Allows by-reference access to parent sensor module
|
int |
getStorageCapacity()
Gets the internal storage capacity.
This method must be implemented if isStorageSupported() returns true. |
boolean |
isStorageSupported()
Checks data storage capability
|
getAverageSamplingPeriod, getLatestRecordTime, getRecommendedEncoding, getRecordDescription, isEnabled
registerListener, unregisterListener
ISensorModule<?> getParentModule()
getParentModule
in interface IStreamingDataInterface
java.lang.String getName()
It MUST be the name reported in the map by getXXXOutputs methods
of ISensorModule
getName
in interface IStreamingDataInterface
ISensorModule.getAllOutputs()
DataBlock getLatestRecord()
When storage is supported, this method does not cause data to be removed from memory.
Note that this does not trigger a new measurement but simply retrieves the result of the last measurement made.
getLatestRecord
in interface IStreamingDataInterface
boolean isStorageSupported()
Note that storage can be provided by the sensor itself or by the driver.
int getStorageCapacity() throws SensorException
isStorageSupported()
returns true.SensorException
- if storage is not supported or a problem occured while
checking sensor on-board storage capacityint getNumberOfAvailableRecords() throws SensorException
isStorageSupported()
returns true.SensorException
- if storage is not supported or a problem occured while
reading from on-board sensor storagejava.util.List<DataBlock> getLatestRecords(int maxRecords, boolean clear) throws SensorException
isStorageSupported()
returns true.maxRecords
- Maximum number of records to retrieveclear
- if true, also clears records from driver or sensor memorySensorException
- if storage is not supported or a problem occured while
reading from on-board sensor storagejava.util.List<DataBlock> getAllRecords(boolean clear) throws SensorException
isStorageSupported()
returns true.clear
- if true, also clears records from driver or sensor memorySensorException
- if storage is not supported or a problem occured
while reading from on-board sensor storageint clearAllRecords() throws SensorException
isStorageSupported()
returns true.SensorException
- if storage is not supported or a problem occured while
clearing on-board sensor storage