sensor-hal: change the interface of set_attribute_*
authorkibak.yoon <kibak.yoon@samsung.com>
Fri, 12 Feb 2016 06:36:21 +0000 (15:36 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Fri, 12 Feb 2016 09:39:29 +0000 (18:39 +0900)
Change-Id: I0cda7289e9251f4ce794b8df0ef18c07f67e0f2a
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
src/accel/accel.cpp
src/accel/accel.h
src/proxi/proxi.cpp
src/proxi/proxi.h
src/sensor_hal.h
src/sensorhub/sensorhub.cpp
src/sensorhub/sensorhub.h
src/sensorhub/sensorhub_sensor.cpp
src/sensorhub/sensorhub_sensor.h
src/sensorhub/wristup.cpp
src/sensorhub/wristup.h

index ea8b84b12d9469d68ebbab8e16fcd3c5707623d6..f01b7fe82d17fcc035d4f2bda883cc1d78861d7b 100644 (file)
@@ -157,12 +157,12 @@ bool accel_device::set_batch_latency(uint32_t id, unsigned long val)
        return false;
 }
 
-bool accel_device::set_attribute(uint32_t id, int32_t attribute, int32_t value)
+bool accel_device::set_attribute_int(uint32_t id, int32_t attribute, int32_t value)
 {
        return false;
 }
 
-bool accel_device::set_attribute_str(uint32_t id, char *attribute, char *value, int value_len)
+bool accel_device::set_attribute_str(uint32_t id, int32_t attribute, char *value, int value_len)
 {
        return false;
 }
index 58cbbef2ca8e6eab72be708d6426bc0a35069f34..da27f023d8322edcfb50b84395dd0b8a782c8ee5 100644 (file)
@@ -35,8 +35,8 @@ public:
 
        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);
+       bool set_attribute_int(uint32_t id, int32_t attribute, int32_t value);
+       bool set_attribute_str(uint32_t id, int32_t attribute, char *value, int value_len);
 
        int read_fd(uint32_t **ids);
        int get_data(uint32_t id, sensor_data_t **data, int *length);
index 06521ffe2bb710db2a0b8654b1ce5bf0c381dfdf..6ee63eb28b1e5e3ccd78de29a1e7380bb0122023 100644 (file)
@@ -134,12 +134,12 @@ bool proxi_device::set_batch_latency(uint32_t id, unsigned long val)
        return false;
 }
 
-bool proxi_device::set_attribute(uint32_t id, int32_t attribute, int32_t value)
+bool proxi_device::set_attribute_int(uint32_t id, int32_t attribute, int32_t value)
 {
        return false;
 }
 
-bool proxi_device::set_attribute_str(uint32_t id, char *attribute, char *value, int value_len)
+bool proxi_device::set_attribute_str(uint32_t id, int32_t attribute, char *value, int value_len)
 {
        return false;
 }
index 001a6ff91d129816f4577830529cc2056d9306de..49fcff0f6d082bf7def2ffdba78a067f0b89f11b 100644 (file)
@@ -36,8 +36,8 @@ public:
 
        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);
+       bool set_attribute_int(uint32_t id, int32_t attribute, int32_t value);
+       bool set_attribute_str(uint32_t id, int32_t attribute, char *value, int value_len);
 
        int read_fd(uint32_t **ids);
        int get_data(uint32_t id, sensor_data_t **data, int *length);
index 2b10c3eb4115967b210fdc67ed654aeafcdf9147..ded1a9073922867828400261e4ffd2110c1ebcfe 100644 (file)
@@ -177,8 +177,8 @@ public:
 
        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 bool set_attribute_int(uint32_t id, int32_t attribute, int32_t value) = 0;
+       virtual bool set_attribute_str(uint32_t id, int32_t attribute, char *value, int value_len) = 0;
 
        virtual int read_fd(uint32_t **ids) = 0;
        virtual int get_data(uint32_t id, sensor_data_t **data, int *length) = 0;
index 14c0fbe91b67fdb129d8bf3e3a253ce25d8a4101..4e2faeb5c75e6e2561b9a90863d6766d6615f3fc 100644 (file)
@@ -114,7 +114,7 @@ bool sensorhub_device::set_batch_latency(uint32_t id, unsigned long val)
        return sensor->set_batch_latency(val);
 }
 
-bool sensorhub_device::set_attribute(uint32_t id, int32_t attribute, int32_t value)
+bool sensorhub_device::set_attribute_int(uint32_t id, int32_t attribute, int32_t value)
 {
        int ret;
 
@@ -125,7 +125,7 @@ bool sensorhub_device::set_attribute(uint32_t id, int32_t attribute, int32_t val
                return false;
        }
 
-       ret = sensor->set_attribute(attribute, value);
+       ret = sensor->set_attribute_int(attribute, value);
 
        if ((ret < 0) && (ret != -EBUSY)) {
                ERR("Failed to send sensorhub data");
@@ -140,7 +140,7 @@ bool sensorhub_device::set_attribute(uint32_t id, int32_t attribute, int32_t val
        return true;
 }
 
-bool sensorhub_device::set_attribute_str(uint32_t id, char *attribute, char *value, int value_len)
+bool sensorhub_device::set_attribute_str(uint32_t id, int32_t attribute, char *value, int value_len)
 {
        int ret;
 
index 4748bbc2f26e5e3c6c2e512c3bf0b4aff3d4f663..dc59974eda959162779d80600f2d1e4616c2555d 100644 (file)
@@ -37,8 +37,8 @@ public:
 
        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);
+       bool set_attribute_int(uint32_t id, int32_t attribute, int32_t value);
+       bool set_attribute_str(uint32_t id, int32_t attribute, char *value, int value_len);
 
        int read_fd(uint32_t **ids);
        int get_data(uint32_t id, sensor_data_t **data, int *length);
index b1b99638804aa9e1df4f5d0c77181631a8864c19..56656b5a2789e52fa977e6b2c5cf86bca3920c89 100644 (file)
@@ -35,12 +35,12 @@ bool sensorhub_sensor::set_batch_latency(unsigned long val)
        return false;
 }
 
-bool sensorhub_sensor::set_attribute(int32_t attribute, int32_t value)
+bool sensorhub_sensor::set_attribute_int(int32_t attribute, int32_t value)
 {
        return false;
 }
 
-bool sensorhub_sensor::set_attribute_str(char *attribute, char *value, int value_len)
+bool sensorhub_sensor::set_attribute_str(int32_t attribute, char *value, int value_len)
 {
        return false;
 }
index c3c791847f0d39585cdd08e0ebe1673a2b9621e1..aa500b5c4620091e359d8bfed80d8a2a87562331 100644 (file)
@@ -34,8 +34,8 @@ public:
 
        virtual bool set_interval(unsigned long val);
        virtual bool set_batch_latency(unsigned long val);
-       virtual bool set_attribute(int32_t attribute, int32_t value);
-       virtual bool set_attribute_str(char *key, char *value, int value_len);
+       virtual bool set_attribute_int(int32_t attribute, int32_t value);
+       virtual bool set_attribute_str(int32_t key, char *value, int value_len);
 
        virtual bool flush(void);
 protected:
index f67347155c4569ca5e519a8cf02a0e63d699920f..4a8e5aa2e118e9f182135bf76d39a7bc18b297d7 100644 (file)
@@ -76,12 +76,12 @@ int wristup_sensor::get_data(sensor_data_t **data, int *length)
        return -1;
 }
 
-bool wristup_sensor::set_attribute(int32_t attribute, int32_t value)
+bool wristup_sensor::set_attribute_int(int32_t attribute, int32_t value)
 {
        return false;
 }
 
-bool wristup_sensor::set_attribute_str(char *key, char *value, int value_len)
+bool wristup_sensor::set_attribute_str(int32_t attribute, char *value, int value_len)
 {
        return false;
 }
index 4d1036f5268e318300c92a330a623fb7d2529c75..42dbdc5935ce0c6ce0f535e43e4a71aad72bf2a1 100644 (file)
@@ -33,8 +33,8 @@ public:
        int parse(const char *data, int data_len);
        int get_data(sensor_data_t **data, int *length);
 
-       bool set_attribute(int32_t attribute, int32_t value);
-       bool set_attribute_str(char *attribute, char *value, int value_len);
+       bool set_attribute_int(int32_t attribute, int32_t value);
+       bool set_attribute_str(int32_t attribute, char *value, int value_len);
 
 private:
        sensorhub_data_t m_data;