return true;
}
+API bool sensord_is_wakeup_supported(sensor_t sensor)
+{
+ sensor_info* info = sensor_to_sensor_info(sensor);
+
+ retvm_if (!sensor_info_manager::get_instance().is_valid(info),
+ false, "Invalid param: sensor (%p)", sensor);
+
+ return info->is_wakeup_supported();
+}
+
API int sensord_connect(sensor_t sensor)
{
command_channel *cmd_channel = NULL;
}
+API bool sensord_set_wakeup(int handle, int wakeup)
+{
+ sensor_id_t sensor_id;
+ command_channel *cmd_channel;
+ int client_id;
+
+ AUTOLOCK(lock);
+
+ if (!event_listener.get_sensor_id(handle, sensor_id)) {
+ ERR("client %s failed to get handle information", get_client_name());
+ return false;
+ }
+
+ retvm_if ((wakeup != SENSOR_WAKEUP_ON) && (wakeup != SENSOR_WAKEUP_OFF), false, "Invalid wakeup value : %d, handle: %d, %s, %s",
+ wakeup, handle, get_sensor_name(sensor_id), get_client_name());
+
+ event_listener.set_sensor_wakeup(handle, wakeup);
+
+ if (!event_listener.get_command_channel(sensor_id, &cmd_channel)) {
+ ERR("client %s failed to get command channel for %s", get_client_name(), get_sensor_name(sensor_id));
+ return false;
+ }
+
+ client_id = event_listener.get_client_id();
+ retvm_if ((client_id < 0), false, "Invalid client id : %d, handle: %d, %s, %s", client_id, handle, get_sensor_name(sensor_id), get_client_name());
+
+ if (!cmd_channel->cmd_set_wakeup(wakeup)) {
+ ERR("Sending cmd_set_wakeup(%d, %s, %d) failed for %s", client_id, get_sensor_name(sensor_id), wakeup, get_client_name());
+ return false;
+ }
+
+ return true;
+}
+
API bool sensord_send_sensorhub_data(int handle, const char *data, int data_len)
{
sensor_id_t sensor_id;
return true;
}
+bool command_channel::cmd_set_wakeup(int wakeup)
+{
+ cpacket *packet;
+ cmd_set_wakeup_t *cmd_set_wakeup;
+ cmd_done_t *cmd_done;
+
+ packet = new(std::nothrow) cpacket(sizeof(cmd_set_wakeup_t));
+ retvm_if(!packet, false, "Failed to allocate memory");
+
+ packet->set_cmd(CMD_SET_WAKEUP);
+
+ cmd_set_wakeup = (cmd_set_wakeup_t*)packet->data();
+ cmd_set_wakeup->wakeup = wakeup;
+
+ INFO("%s send cmd_set_wakeup(client_id=%d, %s, wakeup=%d)",
+ get_client_name(), m_client_id, get_sensor_name(m_sensor_id), wakeup);
+
+ if (!command_handler(packet, (void **)&cmd_done)) {
+ ERR("Client %s failed to send/receive command for sensor[%s] with client_id [%d], wakeup[%d]",
+ get_client_name(), get_sensor_name(m_sensor_id), m_client_id, wakeup);
+ delete packet;
+ return false;
+ }
+
+ if (cmd_done->value < 0) {
+ ERR("Client %s got error[%d] from server for sensor[%s] with client_id [%d], wakeup[%d]",
+ get_client_name(), cmd_done->value, get_sensor_name(m_sensor_id), m_client_id, wakeup);
+
+ delete[] (char *)cmd_done;
+ delete packet;
+ return false;
+ }
+
+ delete[] (char *)cmd_done;
+ delete packet;
+
+ return true;
+}
+
bool command_channel::cmd_register_event(unsigned int event_type)
{
cpacket *packet;
bool cmd_start(void);
bool cmd_stop(void);
bool cmd_set_option(int option);
+ bool cmd_set_wakeup(int wakeup);
bool cmd_register_event(unsigned int event_type);
bool cmd_register_events(event_type_vector &event_vec);
bool cmd_unregister_event(unsigned int event_type);
return true;
}
+bool csensor_event_listener::get_sensor_wakeup(int handle, int &sensor_wakeup)
+{
+ AUTOLOCK(m_handle_info_lock);
+
+ auto it_handle = m_sensor_handle_infos.find(handle);
+
+ if (it_handle == m_sensor_handle_infos.end()) {
+ ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+ return false;
+ }
+
+ sensor_wakeup = it_handle->second.m_sensor_wakeup;
+
+ return true;
+}
+
+bool csensor_event_listener::set_sensor_wakeup(int handle, int sensor_wakeup)
+{
+ AUTOLOCK(m_handle_info_lock);
+
+ auto it_handle = m_sensor_handle_infos.find(handle);
+
+ if (it_handle == m_sensor_handle_infos.end()) {
+ ERR("Handle[%d] is not found for client %s", handle, get_client_name());
+ return false;
+ }
+
+ it_handle->second.m_sensor_wakeup = sensor_wakeup;
+
+ return true;
+}
+
void csensor_event_listener::get_active_event_types(sensor_id_t sensor, event_type_vector &active_event_types)
{
event_type_vector event_types;
bool get_sensor_id(int handle, sensor_id_t &sensor_id);
bool get_sensor_state(int handle, int &state);
+ bool get_sensor_wakeup(int handle, int &sensor_wakeup);
+ bool set_sensor_wakeup(int handle, int sensor_wakeup);
+
void get_sensor_rep(sensor_id_t sensor_id, sensor_rep& rep);
bool has_client_id(void);
, m_sensor_id(UNKNOWN_SENSOR)
, m_sensor_state(SENSOR_STATE_UNKNOWN)
, m_sensor_option(SENSOR_OPTION_DEFAULT)
+, m_sensor_wakeup(SENSOR_WAKEUP_OFF)
, m_bad_accuracy(false)
, m_accuracy(-1)
, m_accuracy_cb(NULL)
sensor_id_t m_sensor_id;
int m_sensor_state;
int m_sensor_option;
+ int m_sensor_wakeup;
int m_bad_accuracy;
int m_accuracy;
sensor_accuracy_changed_cb_t m_accuracy_cb;
bool sensord_is_supported_event_type(sensor_t sensor, unsigned int event_type, bool *supported);
/**
+ * @brief Check a wakeup supported or not by this sensor.
+ *
+ * @param[in] sensor a sensor to check a given event type is supporeted.
+ * @return true on success, otherwise false.
+ */
+bool sensord_is_wakeup_supported(sensor_t sensor);
+
+/**
* @brief Connect a given sensor and get a handle of a given sensor.
*
* @param[in] sensor a sensor to connect
bool sensord_set_option(int handle, int option);
/**
+ * @brief Change the wakeup mode of a connected sensor.
+ *
+ * @param[in] handle a handle represensting a connected sensor.
+ * @param[in] wakeup either one of SENSOR_WAKEUP_OFF and SENSOR_WAKEUP_ON.
+ * with SENSOR_WAKEUP_OFF, it stops to listening events when AP is asleep.
+ * with SENSOR_WAKEUP_ON, it continues to listening events even when AP is asleep.
+ * @return true on success, otherwise false.
+ */
+bool sensord_set_wakeup(int handle, int wakeup);
+
+/**
* @brief Send data to sensorhub
*
* @param[in] handle a handle represensting a connected context sensor.
m_cmd_handlers[CMD_REG] = &command_worker::cmd_register_event;
m_cmd_handlers[CMD_UNREG] = &command_worker::cmd_unregister_event;
m_cmd_handlers[CMD_SET_OPTION] = &command_worker::cmd_set_option;
+ m_cmd_handlers[CMD_SET_WAKEUP] = &command_worker::cmd_set_wakeup;
m_cmd_handlers[CMD_SET_BATCH] = &command_worker::cmd_set_batch;
m_cmd_handlers[CMD_UNSET_BATCH] = &command_worker::cmd_unset_batch;
m_cmd_handlers[CMD_SET_COMMAND] = &command_worker::cmd_set_command;
return true;
}
+bool command_worker::cmd_set_wakeup(void *payload)
+{
+ cmd_set_wakeup_t *cmd;
+ long ret_value = OP_ERROR;
+
+ cmd = (cmd_set_wakeup_t*)payload;
+
+ if (!is_permission_allowed()) {
+ ERR("Permission denied to set wakeup for client [%d], for sensor [0x%x] with wakeup [%d] to client info manager",
+ m_client_id, m_sensor_id, cmd->wakeup);
+ ret_value = OP_ERROR;
+ goto out;
+ }
+
+ if (!get_client_info_manager().set_wakeup(m_client_id, m_sensor_id, cmd->wakeup)) {
+ ERR("Failed to set wakeup for client [%d], for sensor [0x%x] with wakeup [%d] to client info manager",
+ m_client_id, m_sensor_id, cmd->wakeup);
+ ret_value = OP_ERROR;
+ goto out;
+ }
+
+ ret_value = m_module->add_wakeup(m_client_id, cmd->wakeup);
+
+out:
+ if (!send_cmd_done(ret_value))
+ ERR("Failed to send cmd_done to a client");
+
+ return true;
+}
+
bool command_worker::cmd_set_command(void *payload)
{
cmd_set_command_t *cmd;
bool cmd_set_batch(void *payload);
bool cmd_unset_batch(void *payload);
bool cmd_set_option(void *payload);
+ bool cmd_set_wakeup(void *payload);
bool cmd_set_command(void *payload);
bool cmd_get_data(void *payload);
bool cmd_send_sensorhub_data(void *payload);
cclient_info_manager.cpp
cclient_sensor_record.cpp
cinterval_info_list.cpp
+ cwakeup_info_list.cpp
batch_info_list.cpp
sensor_plugin_loader.cpp
sensor_hal.cpp
cvirtual_sensor_config.h
csensor_event_queue.h
cinterval_info_list.h
+ cwakeup_info_list.h
batch_info_list.h
sensor_plugin_loader.h
sensor_hal.h
return true;
}
+bool cclient_info_manager::set_wakeup(int client_id, sensor_id_t sensor_id, int wakeup)
+{
+ AUTOLOCK(m_mutex);
+
+ auto it_record = m_clients.find(client_id);
+
+ if (it_record == m_clients.end()) {
+ ERR("Client[%d] is not found", client_id);
+ return false;
+ }
+
+ if(!it_record->second.set_wakeup(sensor_id, wakeup))
+ return false;
+
+ return true;
+}
bool cclient_info_manager::set_start(int client_id, sensor_id_t sensor_id, bool start)
{
bool set_batch(int client_id, sensor_id_t sensor_id, unsigned int interval, unsigned int latency);
bool get_batch(int client_id, sensor_id_t sensor_id, unsigned int &interval, unsigned int &latency);
bool set_option(int client_id, sensor_id_t sensor_id, int option);
+ bool set_wakeup(int client_id, sensor_id_t sensor_id, int wakeup);
bool set_start(int client_id, sensor_id_t sensor_id, bool start);
bool is_started(int client_id, sensor_id_t sensor_id);
return true;
}
+bool cclient_sensor_record::set_wakeup(sensor_id_t sensor_id, int wakeup)
+{
+ auto it_usage = m_sensor_usages.find(sensor_id);
+
+ if (it_usage == m_sensor_usages.end()) {
+ csensor_usage usage;
+ usage.m_wakeup = wakeup;
+ m_sensor_usages.insert(pair<sensor_id_t, csensor_usage>(sensor_id, usage));
+ } else {
+ it_usage->second.m_wakeup = wakeup;
+ }
+
+ return true;
+}
bool cclient_sensor_record::set_start(sensor_id_t sensor_id, bool start)
{
bool set_batch(sensor_id_t sensor_id, unsigned int interval, unsigned int latency);
bool get_batch(sensor_id_t sensor_id, unsigned int &interval, unsigned int &latency);
bool set_option(sensor_id_t sensor_id, int option);
+ bool set_wakeup(sensor_id_t sensor_id, int wakeup);
bool set_start(sensor_id_t sensor_id, bool start);
bool is_started(sensor_id_t sensor_id);
: m_interval(POLL_MAX_HZ_MS)
, m_latency(0)
, m_option(SENSOR_OPTION_DEFAULT)
+, m_wakeup(SENSOR_WAKEUP_OFF)
, m_start(false)
{
unsigned int m_interval;
unsigned int m_latency;
int m_option;
+ int m_wakeup;
reg_event_vector m_reg_events;
bool m_start;
--- /dev/null
+/*
+ * libsensord-share
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <cwakeup_info_list.h>
+#include <algorithm>
+
+
+cwakeup_info::cwakeup_info(int client_id, int wakeup)
+{
+ this->client_id = client_id;
+ this->wakeup = wakeup;
+}
+
+cwakeup_info_iterator cwakeup_info_list::find_if(int client_id)
+{
+ auto iter = m_list.begin();
+
+ while (iter != m_list.end()) {
+ if (iter->client_id == client_id)
+ break;
+
+ ++iter;
+ }
+
+ return iter;
+}
+
+
+bool cwakeup_info_list::add_wakeup(int client_id, int wakeup)
+{
+ auto iter = find_if(client_id);
+
+ if (iter != m_list.end())
+ *iter = cwakeup_info(client_id, wakeup);
+ else
+ m_list.push_back(cwakeup_info(client_id, wakeup));
+
+ return true;
+}
+
+bool cwakeup_info_list::delete_wakeup(int client_id)
+{
+ auto iter = find_if(client_id);
+
+ if (iter == m_list.end())
+ return false;
+
+ m_list.erase(iter);
+
+ return true;
+}
+
+int cwakeup_info_list::get_wakeup(int client_id)
+{
+ auto iter = find_if(client_id);
+
+ if (iter == m_list.end())
+ return -1;
+
+ return iter->wakeup;
+}
+
+int cwakeup_info_list::is_wakeup_on(void)
+{
+ if (m_list.empty())
+ return -1;
+
+ auto iter = m_list.begin();
+
+ while (iter != m_list.end()) {
+ if (iter->wakeup == true)
+ break;
+
+ ++iter;
+ }
+
+ return iter->wakeup;
+}
+
--- /dev/null
+/*
+ * libsensord-share
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef _CWAKEUP_INFO_LIST_CLASS_H_
+#define _CWAKEUP_INFO_LIST_CLASS_H_
+
+#include <list>
+
+class cwakeup_info
+{
+public:
+ cwakeup_info(int client_id, int wakeup);
+ int client_id;
+ int wakeup;
+};
+
+typedef std::list<cwakeup_info>::iterator cwakeup_info_iterator;
+
+class cwakeup_info_list
+{
+private:
+ cwakeup_info_iterator find_if(int client_id);
+
+ std::list<cwakeup_info> m_list;
+
+public:
+ bool add_wakeup(int client_id, int wakeup);
+ bool delete_wakeup(int client_id);
+ int get_wakeup(int client_id);
+ int is_wakeup_on(void);
+};
+#endif
return m_interval_info_list.get_interval(client_id, is_processor);
}
+bool sensor_base::add_wakeup(int client_id, int wakeup)
+{
+ int prev_wakeup, cur_wakeup;
+
+ AUTOLOCK(m_wakeup_info_list_mutex);
+
+ prev_wakeup = m_wakeup_info_list.is_wakeup_on();
+
+ if (!m_wakeup_info_list.add_wakeup(client_id, wakeup))
+ return false;
+
+ cur_wakeup = m_wakeup_info_list.is_wakeup_on();
+
+ if ((cur_wakeup == SENSOR_WAKEUP_ON) && (prev_wakeup < SENSOR_WAKEUP_ON)) {
+ INFO("Wakeup for sensor[0x%x] is changed from %d to %d by client[%d] adding wakeup",
+ get_id(), prev_wakeup, cur_wakeup, client_id);
+ set_wakeup(client_id, SENSOR_WAKEUP_ON);
+ }
+
+ return true;
+}
+
+bool sensor_base::delete_wakeup(int client_id)
+{
+ int prev_wakeup, cur_wakeup;
+ AUTOLOCK(m_wakeup_info_list_mutex);
+
+ prev_wakeup = m_wakeup_info_list.is_wakeup_on();
+
+ if (!m_wakeup_info_list.delete_wakeup(client_id))
+ return false;
+
+ cur_wakeup = m_wakeup_info_list.is_wakeup_on();
+
+ if ((cur_wakeup < SENSOR_WAKEUP_ON) && (prev_wakeup == SENSOR_WAKEUP_ON)) {
+ INFO("Wakeup for sensor[0x%x] is changed from %d to %d by client[%d] deleting wakeup",
+ get_id(), prev_wakeup, cur_wakeup, client_id);
+ set_wakeup(client_id, SENSOR_WAKEUP_OFF);
+ }
+
+ return true;
+}
+
+int sensor_base::get_wakeup(int client_id)
+{
+ AUTOLOCK(m_wakeup_info_list_mutex);
+
+ return m_wakeup_info_list.is_wakeup_on();
+}
+
void sensor_base::get_sensor_info(sensor_type_t sensor_type, sensor_info &info)
{
sensor_properties_s properties;
+ properties.wakeup_supported = false;
+
get_properties(sensor_type, properties);
info.set_type(sensor_type);
}
info.set_supported_events(events);
+ info.set_wakeup_supported(properties.wakeup_supported);
return;
}
return true;
}
+bool sensor_base::is_wakeup_supported(void)
+{
+ return false;
+}
+
long sensor_base::set_command(unsigned int cmd, long value)
{
return -1;
}
+bool sensor_base::set_wakeup(int client_id, int wakeup)
+{
+ return false;
+}
+
int sensor_base::send_sensorhub_data(const char* data, int data_len)
{
return -1;
#include <string>
#include <cinterval_info_list.h>
+#include <cwakeup_info_list.h>
#include <cmutex.h>
#include <common.h>
virtual bool delete_interval(int client_id, bool is_processor);
unsigned int get_interval(int client_id, bool is_processor);
+ virtual bool add_wakeup(int client_id, int wakeup);
+ virtual bool delete_wakeup(int client_id);
+ int get_wakeup(int client_id);
+
void get_sensor_info(sensor_type_t sensor_type, sensor_info &info);
virtual bool get_properties(sensor_type_t sensor_type, sensor_properties_s &properties);
bool is_supported(unsigned int event_type);
+ bool is_wakeup_supported(void);
virtual long set_command(unsigned int cmd, long value);
+ virtual bool set_wakeup(int client_id, int wakeup);
virtual int send_sensorhub_data(const char* data, int data_len);
virtual int get_sensor_data(unsigned int type, sensor_data_t &data);
int m_permission;
cinterval_info_list m_interval_info_list;
+ cwakeup_info_list m_wakeup_info_list;
cmutex m_interval_info_list_mutex;
+ cmutex m_wakeup_info_list_mutex;
cmutex m_mutex;
typedef enum sensor_option_t sensor_option_e;
#endif
+/*
+ * To prevent naming confliction as using same enums as sensor CAPI use
+ */
+#ifndef __SENSOR_H__
+enum sensor_wakeup_t {
+ SENSOR_WAKEUP_UNKNOWN = -1,
+ SENSOR_WAKEUP_OFF = 0,
+ SENSOR_WAKEUP_ON = 1,
+};
+
+typedef enum sensor_wakeup_t sensor_wakeup_e;
+#endif
+
enum sensor_interval_t {
SENSOR_INTERVAL_FASTEST = 0,
SENSOR_INTERVAL_NORMAL = 200,
return true;
}
+bool sensor_hal::is_wakeup_supported(void)
+{
+ return false;
+}
+
bool sensor_hal::set_interval(unsigned long val)
{
return true;
return -1;
}
+bool sensor_hal::set_wakeup(int wakeup)
+{
+ return false;
+}
+
int sensor_hal::send_sensorhub_data(const char* data, int data_len)
{
return -1;
virtual bool disable(void) = 0;
virtual bool set_interval(unsigned long val);
virtual bool is_data_ready(bool wait) = 0;
+ virtual bool is_wakeup_supported(void);
virtual bool get_properties(sensor_properties_s &properties) {return false;};
virtual bool get_properties(sensor_type_t sensor_type, sensor_properties_s &properties) {return false;};
virtual int get_sensor_data(sensor_data_t &data);
virtual int get_sensor_data(sensorhub_data_t &data);
virtual long set_command(unsigned int cmd, long val);
+ virtual bool set_wakeup(int wakeup);
virtual int send_sensorhub_data(const char *data, int data_len);
protected:
return true;
}
+bool sensor_info::is_wakeup_supported(void)
+{
+ return m_wakeup_supported;
+}
+
void sensor_info::set_type(sensor_type_t type)
{
m_type = type;
copy(events.begin(), events.end(), back_inserter(m_supported_events));
}
+void sensor_info::set_wakeup_supported(bool supported)
+{
+ m_wakeup_supported = supported;
+}
+
void sensor_info::get_raw_data(raw_data_t &data)
{
put(data, (int)m_type);
put(data, m_fifo_count);
put(data, m_max_batch_count);
put(data, m_supported_events);
+ put(data, m_wakeup_supported);
}
void sensor_info::set_raw_data(const char *data, int data_len)
it_r_data = get(it_r_data, m_fifo_count);
it_r_data = get(it_r_data, m_max_batch_count);
it_r_data = get(it_r_data, m_supported_events);
+ it_r_data = get(it_r_data, m_wakeup_supported);
}
void sensor_info::show(void)
for (unsigned int i = 0; i < m_supported_events.size(); ++i)
INFO("supported_events[%u] = 0x%x", i, m_supported_events[i]);
+
+ INFO("Wakeup_supported = %d", m_wakeup_supported);
}
m_fifo_count = 0;
m_max_batch_count = 0;
m_supported_events.clear();
+ m_wakeup_supported = false;
}
}
}
+void sensor_info::put(raw_data_t &data, bool value)
+{
+ char buffer[sizeof(value)];
+
+ bool *temp = (bool *) buffer;
+ *temp = value;
+
+ copy(&buffer[0], &buffer[sizeof(buffer)], back_inserter(data));
+}
+
raw_data_iterator sensor_info::get(raw_data_iterator it, int &value)
{
copy(it, it + sizeof(value), (char*) &value);
return it;
}
+
+raw_data_iterator sensor_info::get(raw_data_iterator it, bool &value)
+{
+ copy(it, it + sizeof(value), (char*) &value);
+
+ return it + sizeof(value);
+}
int get_max_batch_count(void);
void get_supported_events(std::vector<unsigned int> &events);
bool is_supported_event(unsigned int event);
+ bool is_wakeup_supported(void);
void set_type(sensor_type_t type);
void set_id(sensor_id_t id);
void set_max_batch_count(int max_batch_count);
void register_supported_event(unsigned int event);
void set_supported_events(std::vector<unsigned int> &events);
+ void set_wakeup_supported(bool supported);
void clear(void);
int m_fifo_count;
int m_max_batch_count;
std::vector<unsigned int> m_supported_events;
+ bool m_wakeup_supported;
void put(raw_data_t &data, int value);
void put(raw_data_t &data, float value);
void put(raw_data_t &data, std::string &value);
void put(raw_data_t &data, std::vector<unsigned int> &value);
+ void put(raw_data_t &data, bool value);
raw_data_iterator get(raw_data_iterator it, int &value);
raw_data_iterator get(raw_data_iterator it, float &value);
raw_data_iterator get(raw_data_iterator it, std::string &value);
raw_data_iterator get(raw_data_iterator it, std::vector<unsigned int> &value);
+ raw_data_iterator get(raw_data_iterator it, bool &value);
};
#endif /* _SENSOR_INFO_H_ */
CMD_REG,
CMD_UNREG,
CMD_SET_OPTION,
+ CMD_SET_WAKEUP,
CMD_SET_BATCH,
CMD_UNSET_BATCH,
CMD_SET_COMMAND,
int option;
} cmd_set_option_t;
+typedef struct {
+ int wakeup;
+} cmd_set_wakeup_t;
+
typedef struct {
unsigned int cmd;
long value;
int min_interval;
int fifo_count;
int max_batch_count;
+ bool wakeup_supported;
} sensor_properties_s;