if (m_module->stop()) {
get_client_info_manager().set_start(m_client_id, m_sensor_id, false);
+ m_module->delete_attribute(m_client_id);
ret_value = OP_SUCCESS;
} else {
_E("Failed to stop sensor [0x%llx] for client [%d]", m_sensor_id, m_client_id);
goto out;
}
- ret_value = m_module->set_attribute(cmd->attribute, cmd->value);
+ ret_value = m_module->add_attribute(m_client_id, cmd->attribute, cmd->value);
out:
if (!send_cmd_done(ret_value))
goto out;
}
- ret_value = m_module->set_attribute(cmd->attribute, cmd->value, cmd->value_len);
+ ret_value = m_module->add_attribute(m_client_id, cmd->attribute, cmd->value, cmd->value_len);
out:
if (!send_cmd_done(ret_value))
return true;
}
-int sensor_base::set_attribute(int32_t cmd, int32_t value)
+int sensor_base::add_attribute(int client_id, int32_t attribute, int32_t value)
+{
+ return set_attribute(attribute, value);
+}
+
+int sensor_base::add_attribute(int client_id, int32_t attribute, char *value, int value_size)
+{
+ return set_attribute(attribute, value, value_size);
+}
+
+bool sensor_base::delete_attribute(int client_id)
+{
+ return true;
+}
+
+int sensor_base::set_attribute(int32_t attribute, int32_t value)
{
return OP_ERROR;
}
virtual int get_data(sensor_data_t **data, int *length);
virtual bool flush(void);
- virtual int set_attribute(int32_t attribute, int32_t value);
- virtual int set_attribute(int32_t attribute, char *value, int value_size);
+ virtual int add_attribute(int client_id, int32_t attribute, int32_t value);
+ virtual int add_attribute(int client_id, int32_t attribute, char *value, int value_size);
+ virtual bool delete_attribute(int client_id);
/* start/stop */
bool start(void);
unsigned int m_client;
cmutex m_client_mutex;
+ virtual int set_attribute(int32_t attribute, int32_t value);
+ virtual int set_attribute(int32_t attribute, char *value, int value_size);
+
virtual bool set_interval(unsigned long interval);
virtual bool set_batch_latency(unsigned long latency);