NVMeBasicContext: Poll all sensors each polling interval
Rework the polling protocol so that the completion of polling sensor N
invokes polling of sensor N+1 for the given context.
The timer is retained in order to trigger polling the initial sensor.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I599547c8c790905549c0cad9fbfbe63cf6930de4
diff --git a/include/NVMeContext.hpp b/include/NVMeContext.hpp
index f8270f2..2489815 100644
--- a/include/NVMeContext.hpp
+++ b/include/NVMeContext.hpp
@@ -50,22 +50,18 @@
sensors.remove(sensor);
}
- virtual void pollNVMeDevices()
- {}
-
virtual void close()
{
scanTimer.cancel();
}
- virtual void readAndProcessNVMeSensor()
- {}
+ virtual void pollNVMeDevices() = 0;
- virtual void processResponse(void* msg, size_t len)
- {
- (void)msg;
- (void)len;
- }
+ virtual void readAndProcessNVMeSensor(
+ std::list<std::shared_ptr<NVMeSensor>>::iterator iter) = 0;
+
+ virtual void processResponse(std::shared_ptr<NVMeSensor>& sensor, void* msg,
+ size_t len) = 0;
protected:
boost::asio::deadline_timer scanTimer;