#define OP_DEFAULT 1
#endif
+namespace sensor {
+class fusion_sensor_handler;
+}
+
/*
* Create sensor
*/
{
return OP_DEFAULT;
}
-;
+
virtual int stop(observer_h ob)
{
return OP_DEFAULT;
{
return OP_DEFAULT;
}
+
+ virtual void set_fusion_sensor_handler(sensor::fusion_sensor_handler* handler)
+ {
+ }
};
#endif /* __FUSION_SENSOR_H__ */
*/
#include "fusion_sensor_handler.h"
+#include "fusion_sensor.h"
#include <message.h>
#include <sensor_log.h>
_I("Started[%s]", m_info.get_uri().c_str());
- return start_internal();
+ return start_required_sensors();
}
int fusion_sensor_handler::stop(sensor_observer *ob)
_I("Stopped[%s]", m_info.get_uri().c_str());
- return stop_internal();
+ return stop_required_sensors();
}
int fusion_sensor_handler::get_min_interval(void)
return OP_SUCCESS;
}
-int fusion_sensor_handler::start_internal(void)
+int fusion_sensor_handler::start_required_sensors(void)
{
auto it = m_required_sensors.begin();
for (; it != m_required_sensors.end(); ++it) {
return OP_SUCCESS;
}
-int fusion_sensor_handler::stop_internal(void)
+int fusion_sensor_handler::stop_required_sensors(void)
{
auto it = m_required_sensors.begin();
for (; it != m_required_sensors.end(); ++it) {
#include <message.h>
#include <sensor_types.h>
-#include <fusion_sensor.h>
#include <unordered_map>
#include "sensor_handler.h"
#include "sensor_observer.h"
+class fusion_sensor;
+
namespace sensor {
class required_sensor {
int flush(sensor_observer *ob);
int get_data(sensor_data_t **data, int *len);
+ int start_required_sensors(void);
+ int stop_required_sensors(void);
private:
- int start_internal(void);
- int stop_internal(void);
int set_interval_internal(int32_t interval);
int set_batch_latency_internal(int32_t latency);
int set_attribute_internal(int32_t attr, int32_t value);
sensor_info sinfo = fsensor->get_sensor_info();
m_sensors[sinfo.get_uri()] = fsensor;
+
+ (*it)->set_fusion_sensor_handler(fsensor);
}
}