, m_device(device)
, m_sensor(sensor)
, m_hal_id(hal_id)
-, m_prev_interval(0)
-, m_prev_latency(0)
{
}
ret = m_device->set_interval(m_hal_id, cur_interval);
- m_prev_interval = cur_interval;
-
- _I("Set interval[%d] to sensor[%s]", cur_interval, m_info.get_uri().c_str());
+ update_prev_interval(cur_interval);
return (ret ? OP_SUCCESS : OP_ERROR);
}
+int physical_sensor_handler::get_interval(sensor_observer *ob, int32_t& interval)
+{
+ retv_if(!m_device, -EINVAL);
+ interval = m_prev_interval;
+ return OP_SUCCESS;
+}
+
int physical_sensor_handler::get_min_batch_latency(void)
{
int batch_latency;
ret = m_device->set_batch_latency(m_hal_id, cur_latency);
- m_prev_latency = cur_latency;
-
- _I("Set batch latency[%d] to sensor[%s]", cur_latency, m_info.get_uri().c_str());
+ update_prev_latency(cur_latency);
return (ret ? OP_SUCCESS : OP_ERROR);
}
+int physical_sensor_handler::get_batch_latency(sensor_observer *ob, int32_t &latency)
+{
+ retv_if(!m_device, -EINVAL);
+ latency = m_prev_latency;
+ return OP_SUCCESS;
+}
+
int physical_sensor_handler::delete_batch_latency(sensor_observer *ob)
{
bool ret = false;