summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkibak.yoon <kibak.yoon@samsung.com>2016-02-12 15:03:36 +0900
committerkibak.yoon <kibak.yoon@samsung.com>2016-02-12 15:04:27 +0900
commite86711157148a29c355b5269b926710e3afcdabb (patch)
treed3a50e20acc5ff3874ebb81efde17a0c490c7ec7
parent86df2261ae83cfcc2cad4d64bb133dc529c9e0ec (diff)
downloadsensor-tm1-e86711157148a29c355b5269b926710e3afcdabb.tar.gz
sensor-tm1-e86711157148a29c355b5269b926710e3afcdabb.tar.bz2
sensor-tm1-e86711157148a29c355b5269b926710e3afcdabb.zip
sensor-hal: change the type of id to uint32_t
Change-Id: I27de063be69b3b253f244b61704fcaccc18aaf9e Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
-rw-r--r--src/accel/accel.cpp20
-rw-r--r--src/accel/accel.h20
-rw-r--r--src/proxi/proxi.cpp20
-rw-r--r--src/proxi/proxi.h20
-rw-r--r--src/sensor_hal.h20
-rw-r--r--src/sensorhub/sensorhub.cpp18
-rw-r--r--src/sensorhub/sensorhub.h20
-rw-r--r--src/sensorhub/sensorhub_manager.cpp2
-rw-r--r--src/sensorhub/sensorhub_manager.h4
9 files changed, 72 insertions, 72 deletions
diff --git a/src/accel/accel.cpp b/src/accel/accel.cpp
index 5029828..ea8b84b 100644
--- a/src/accel/accel.cpp
+++ b/src/accel/accel.cpp
@@ -57,7 +57,7 @@ static const sensor_handle_t handle = {
wakeup_supported: false
};
-std::vector<uint16_t> accel_device::event_ids;
+std::vector<uint32_t> accel_device::event_ids;
accel_device::accel_device()
: m_node_handle(-1)
@@ -118,7 +118,7 @@ int accel_device::get_sensors(const sensor_handle_t **sensors)
return 1;
}
-bool accel_device::enable(uint16_t id)
+bool accel_device::enable(uint32_t id)
{
util::set_enable_node(m_enable_node, m_sensorhub_controlled, true, SENSORHUB_ACCELEROMETER_ENABLE_BIT);
set_interval(id, m_polling_interval);
@@ -128,7 +128,7 @@ bool accel_device::enable(uint16_t id)
return true;
}
-bool accel_device::disable(uint16_t id)
+bool accel_device::disable(uint32_t id)
{
util::set_enable_node(m_enable_node, m_sensorhub_controlled, false, SENSORHUB_ACCELEROMETER_ENABLE_BIT);
@@ -136,7 +136,7 @@ bool accel_device::disable(uint16_t id)
return true;
}
-bool accel_device::set_interval(uint16_t id, unsigned long val)
+bool accel_device::set_interval(uint32_t id, unsigned long val)
{
unsigned long long polling_interval_ns;
@@ -152,17 +152,17 @@ bool accel_device::set_interval(uint16_t id, unsigned long val)
return true;
}
-bool accel_device::set_batch_latency(uint16_t id, unsigned long val)
+bool accel_device::set_batch_latency(uint32_t id, unsigned long val)
{
return false;
}
-bool accel_device::set_attribute(uint16_t id, int32_t attribute, int32_t value)
+bool accel_device::set_attribute(uint32_t id, int32_t attribute, int32_t value)
{
return false;
}
-bool accel_device::set_attribute_str(uint16_t id, char *attribute, char *value, int value_len)
+bool accel_device::set_attribute_str(uint32_t id, char *attribute, char *value, int value_len)
{
return false;
}
@@ -237,7 +237,7 @@ bool accel_device::update_value_input_event(void)
return true;
}
-int accel_device::read_fd(uint16_t **ids)
+int accel_device::read_fd(uint32_t **ids)
{
if (!update_value_input_event()) {
DBG("Failed to update value");
@@ -252,7 +252,7 @@ int accel_device::read_fd(uint16_t **ids)
return event_ids.size();
}
-int accel_device::get_data(uint16_t id, sensor_data_t **data, int *length)
+int accel_device::get_data(uint32_t id, sensor_data_t **data, int *length)
{
int remains = 1;
sensor_data_t *sensor_data;
@@ -273,7 +273,7 @@ int accel_device::get_data(uint16_t id, sensor_data_t **data, int *length)
return --remains;
}
-bool accel_device::flush(uint16_t id)
+bool accel_device::flush(uint32_t id)
{
return false;
}
diff --git a/src/accel/accel.h b/src/accel/accel.h
index 2135684..58cbbef 100644
--- a/src/accel/accel.h
+++ b/src/accel/accel.h
@@ -30,18 +30,18 @@ public:
int get_poll_fd(void);
int get_sensors(const sensor_handle_t **sensors);
- bool enable(uint16_t id);
- bool disable(uint16_t id);
+ bool enable(uint32_t id);
+ bool disable(uint32_t id);
- bool set_interval(uint16_t id, unsigned long val);
- bool set_batch_latency(uint16_t id, unsigned long val);
- bool set_attribute(uint16_t id, int32_t attribute, int32_t value);
- bool set_attribute_str(uint16_t id, char *attribute, char *value, int value_len);
+ bool set_interval(uint32_t id, unsigned long val);
+ bool set_batch_latency(uint32_t id, unsigned long val);
+ bool set_attribute(uint32_t id, int32_t attribute, int32_t value);
+ bool set_attribute_str(uint32_t id, char *attribute, char *value, int value_len);
- int read_fd(uint16_t **ids);
- int get_data(uint16_t id, sensor_data_t **data, int *length);
+ int read_fd(uint32_t **ids);
+ int get_data(uint32_t id, sensor_data_t **data, int *length);
- bool flush(uint16_t id);
+ bool flush(uint32_t id);
private:
int m_node_handle;
@@ -56,7 +56,7 @@ private:
std::string m_enable_node;
std::string m_interval_node;
- static std::vector<uint16_t> event_ids;
+ static std::vector<uint32_t> event_ids;
bool update_value_input_event(void);
void raw_to_base(sensor_data_t *data);
diff --git a/src/proxi/proxi.cpp b/src/proxi/proxi.cpp
index 904ea5c..06521ff 100644
--- a/src/proxi/proxi.cpp
+++ b/src/proxi/proxi.cpp
@@ -50,7 +50,7 @@ static const sensor_handle_t handle = {
wakeup_supported: false
};
-std::vector<uint16_t> proxi_device::event_ids;
+std::vector<uint32_t> proxi_device::event_ids;
proxi_device::proxi_device()
: m_node_handle(-1)
@@ -107,7 +107,7 @@ int proxi_device::get_sensors(const sensor_handle_t **sensors)
return 1;
}
-bool proxi_device::enable(uint16_t id)
+bool proxi_device::enable(uint32_t id)
{
util::set_enable_node(m_enable_node, m_sensorhub_controlled, true, SENSORHUB_PROXIMITY_ENABLE_BIT);
@@ -116,7 +116,7 @@ bool proxi_device::enable(uint16_t id)
return true;
}
-bool proxi_device::disable(uint16_t id)
+bool proxi_device::disable(uint32_t id)
{
util::set_enable_node(m_enable_node, m_sensorhub_controlled, false, SENSORHUB_PROXIMITY_ENABLE_BIT);
@@ -124,22 +124,22 @@ bool proxi_device::disable(uint16_t id)
return true;
}
-bool proxi_device::set_interval(uint16_t id, unsigned long interval_ms)
+bool proxi_device::set_interval(uint32_t id, unsigned long interval_ms)
{
return true;
}
-bool proxi_device::set_batch_latency(uint16_t id, unsigned long val)
+bool proxi_device::set_batch_latency(uint32_t id, unsigned long val)
{
return false;
}
-bool proxi_device::set_attribute(uint16_t id, int32_t attribute, int32_t value)
+bool proxi_device::set_attribute(uint32_t id, int32_t attribute, int32_t value)
{
return false;
}
-bool proxi_device::set_attribute_str(uint16_t id, char *attribute, char *value, int value_len)
+bool proxi_device::set_attribute_str(uint32_t id, char *attribute, char *value, int value_len)
{
return false;
}
@@ -168,7 +168,7 @@ bool proxi_device::update_value_input_event(void)
return false;
}
-int proxi_device::read_fd(uint16_t **ids)
+int proxi_device::read_fd(uint32_t **ids)
{
if (!update_value_input_event()) {
DBG("Failed to update value");
@@ -183,7 +183,7 @@ int proxi_device::read_fd(uint16_t **ids)
return event_ids.size();
}
-int proxi_device::get_data(uint16_t id, sensor_data_t **data, int *length)
+int proxi_device::get_data(uint32_t id, sensor_data_t **data, int *length)
{
int remains = 1;
sensor_data_t *sensor_data;
@@ -200,7 +200,7 @@ int proxi_device::get_data(uint16_t id, sensor_data_t **data, int *length)
return --remains;
}
-bool proxi_device::flush(uint16_t id)
+bool proxi_device::flush(uint32_t id)
{
return false;
}
diff --git a/src/proxi/proxi.h b/src/proxi/proxi.h
index a885089..001a6ff 100644
--- a/src/proxi/proxi.h
+++ b/src/proxi/proxi.h
@@ -31,18 +31,18 @@ public:
int get_poll_fd(void);
int get_sensors(const sensor_handle_t **sensors);
- bool enable(uint16_t id);
- bool disable(uint16_t id);
+ bool enable(uint32_t id);
+ bool disable(uint32_t id);
- bool set_interval(uint16_t id, unsigned long val);
- bool set_batch_latency(uint16_t id, unsigned long val);
- bool set_attribute(uint16_t id, int32_t attribute, int32_t value);
- bool set_attribute_str(uint16_t id, char *attribute, char *value, int value_len);
+ bool set_interval(uint32_t id, unsigned long val);
+ bool set_batch_latency(uint32_t id, unsigned long val);
+ bool set_attribute(uint32_t id, int32_t attribute, int32_t value);
+ bool set_attribute_str(uint32_t id, char *attribute, char *value, int value_len);
- int read_fd(uint16_t **ids);
- int get_data(uint16_t id, sensor_data_t **data, int *length);
+ int read_fd(uint32_t **ids);
+ int get_data(uint32_t id, sensor_data_t **data, int *length);
- bool flush(uint16_t id);
+ bool flush(uint32_t id);
private:
int m_node_handle;
@@ -53,7 +53,7 @@ private:
std::string m_data_node;
std::string m_enable_node;
- static std::vector<uint16_t> event_ids;
+ static std::vector<uint32_t> event_ids;
bool update_value_input_event(void);
};
diff --git a/src/sensor_hal.h b/src/sensor_hal.h
index 7cdd40a..2b10c3e 100644
--- a/src/sensor_hal.h
+++ b/src/sensor_hal.h
@@ -103,7 +103,7 @@ typedef enum {
* ID can be assigned from HAL developer. so it has to be unique in HAL.
*/
typedef struct sensor_handle_t {
- uint16_t id;
+ uint32_t id;
const char *name;
sensor_device_type type;
unsigned int event_type; // for Internal API
@@ -172,18 +172,18 @@ public:
virtual int get_poll_fd(void) = 0;
virtual int get_sensors(const sensor_handle_t **sensors) = 0;
- virtual bool enable(uint16_t id) = 0;
- virtual bool disable(uint16_t id) = 0;
+ virtual bool enable(uint32_t id) = 0;
+ virtual bool disable(uint32_t id) = 0;
- virtual bool set_interval(uint16_t id, unsigned long val) = 0;
- virtual bool set_batch_latency(uint16_t id, unsigned long val) = 0;
- virtual bool set_attribute(uint16_t id, int32_t attribute, int32_t value) = 0;
- virtual bool set_attribute_str(uint16_t id, char *attribute, char *value, int value_len) = 0;
+ virtual bool set_interval(uint32_t id, unsigned long val) = 0;
+ virtual bool set_batch_latency(uint32_t id, unsigned long val) = 0;
+ virtual bool set_attribute(uint32_t id, int32_t attribute, int32_t value) = 0;
+ virtual bool set_attribute_str(uint32_t id, char *attribute, char *value, int value_len) = 0;
- virtual int read_fd(uint16_t **ids) = 0;
- virtual int get_data(uint16_t id, sensor_data_t **data, int *length) = 0;
+ virtual int read_fd(uint32_t **ids) = 0;
+ virtual int get_data(uint32_t id, sensor_data_t **data, int *length) = 0;
- virtual bool flush(uint16_t id) = 0;
+ virtual bool flush(uint32_t id) = 0;
};
#endif /* __cplusplus */
diff --git a/src/sensorhub/sensorhub.cpp b/src/sensorhub/sensorhub.cpp
index 8b5f231..fbdea40 100644
--- a/src/sensorhub/sensorhub.cpp
+++ b/src/sensorhub/sensorhub.cpp
@@ -60,7 +60,7 @@ int sensorhub_device::get_sensors(const sensor_handle_t **sensors)
return size;
}
-bool sensorhub_device::enable(uint16_t id)
+bool sensorhub_device::enable(uint32_t id)
{
system_state_handler::get_instance().initialize();
@@ -75,7 +75,7 @@ bool sensorhub_device::enable(uint16_t id)
return sensor->enable();
}
-bool sensorhub_device::disable(uint16_t id)
+bool sensorhub_device::disable(uint32_t id)
{
system_state_handler::get_instance().finalize();
@@ -90,7 +90,7 @@ bool sensorhub_device::disable(uint16_t id)
return sensor->disable();
}
-bool sensorhub_device::set_interval(uint16_t id, unsigned long val)
+bool sensorhub_device::set_interval(uint32_t id, unsigned long val)
{
sensorhub_sensor *sensor = manager->get_sensor(id);
@@ -102,7 +102,7 @@ bool sensorhub_device::set_interval(uint16_t id, unsigned long val)
return sensor->set_interval(val);
}
-bool sensorhub_device::set_batch_latency(uint16_t id, unsigned long val)
+bool sensorhub_device::set_batch_latency(uint32_t id, unsigned long val)
{
sensorhub_sensor *sensor = manager->get_sensor(id);
@@ -114,7 +114,7 @@ bool sensorhub_device::set_batch_latency(uint16_t id, unsigned long val)
return sensor->set_batch_latency(val);
}
-bool sensorhub_device::set_attribute(uint16_t id, int32_t attribute, int32_t value)
+bool sensorhub_device::set_attribute(uint32_t id, int32_t attribute, int32_t value)
{
int ret;
@@ -140,7 +140,7 @@ bool sensorhub_device::set_attribute(uint16_t id, int32_t attribute, int32_t val
return true;
}
-bool sensorhub_device::set_attribute_str(uint16_t id, char *attribute, char *value, int value_len)
+bool sensorhub_device::set_attribute_str(uint32_t id, char *attribute, char *value, int value_len)
{
int ret;
@@ -166,7 +166,7 @@ bool sensorhub_device::set_attribute_str(uint16_t id, char *attribute, char *val
return true;
}
-int sensorhub_device::read_fd(uint16_t **ids)
+int sensorhub_device::read_fd(uint32_t **ids)
{
sensorhub_data_t data;
@@ -204,7 +204,7 @@ int sensorhub_device::read_fd(uint16_t **ids)
return size;
}
-int sensorhub_device::get_data(uint16_t id, sensor_data_t **data, int *length)
+int sensorhub_device::get_data(uint32_t id, sensor_data_t **data, int *length)
{
int remains = 1;
@@ -219,7 +219,7 @@ int sensorhub_device::get_data(uint16_t id, sensor_data_t **data, int *length)
return remains;
}
-bool sensorhub_device::flush(uint16_t id)
+bool sensorhub_device::flush(uint32_t id)
{
return false;
}
diff --git a/src/sensorhub/sensorhub.h b/src/sensorhub/sensorhub.h
index d4c3bd7..4748bbc 100644
--- a/src/sensorhub/sensorhub.h
+++ b/src/sensorhub/sensorhub.h
@@ -32,23 +32,23 @@ public:
int get_poll_fd(void);
int get_sensors(const sensor_handle_t **sensors);
- bool enable(uint16_t id);
- bool disable(uint16_t id);
+ bool enable(uint32_t id);
+ bool disable(uint32_t id);
- bool set_interval(uint16_t id, unsigned long val);
- bool set_batch_latency(uint16_t id, unsigned long val);
- bool set_attribute(uint16_t id, int32_t attribute, int32_t value);
- bool set_attribute_str(uint16_t id, char *key, char *value, int value_len);
+ bool set_interval(uint32_t id, unsigned long val);
+ bool set_batch_latency(uint32_t id, unsigned long val);
+ bool set_attribute(uint32_t id, int32_t attribute, int32_t value);
+ bool set_attribute_str(uint32_t id, char *key, char *value, int value_len);
- int read_fd(uint16_t **ids);
- int get_data(uint16_t id, sensor_data_t **data, int *length);
+ int read_fd(uint32_t **ids);
+ int get_data(uint32_t id, sensor_data_t **data, int *length);
- bool flush(uint16_t id);
+ bool flush(uint32_t id);
private:
sensorhub_manager *manager;
sensorhub_controller *controller;
- std::vector<uint16_t> event_ids;
+ std::vector<uint32_t> event_ids;
int parse(const char *hub_data, int data_len);
int parse_data(const char *hub_data, int data_len);
diff --git a/src/sensorhub/sensorhub_manager.cpp b/src/sensorhub/sensorhub_manager.cpp
index 838d169..8e21bb7 100644
--- a/src/sensorhub/sensorhub_manager.cpp
+++ b/src/sensorhub/sensorhub_manager.cpp
@@ -55,7 +55,7 @@ void sensorhub_manager::set_controller(sensorhub_controller *controller)
}
}
-sensorhub_sensor *sensorhub_manager::get_sensor(uint16_t id)
+sensorhub_sensor *sensorhub_manager::get_sensor(uint32_t id)
{
return m_id_sensor[id];
}
diff --git a/src/sensorhub/sensorhub_manager.h b/src/sensorhub/sensorhub_manager.h
index 4e2ab13..f4adc50 100644
--- a/src/sensorhub/sensorhub_manager.h
+++ b/src/sensorhub/sensorhub_manager.h
@@ -33,7 +33,7 @@ public:
static sensorhub_manager& get_instance();
virtual ~sensorhub_manager();
- sensorhub_sensor *get_sensor(uint16_t id);
+ sensorhub_sensor *get_sensor(uint32_t id);
sensorhub_sensor *get_sensor(char key);
int get_sensors(const sensor_handle_t **sensors);
@@ -42,7 +42,7 @@ public:
private:
sensorhub_manager();
- std::map<uint16_t, sensorhub_sensor *> m_id_sensor;
+ std::map<uint32_t, sensorhub_sensor *> m_id_sensor;
std::map<char, sensorhub_sensor *> m_key_sensor;
std::vector<sensor_handle_t> m_handles;
};