summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaemin.yeom <taemin.yeom@samsung.com>2021-06-22 12:01:34 +0900
committertaemin.yeom <taemin.yeom@samsung.com>2021-06-22 12:08:31 +0900
commit99944a3c9ce8d925e044e874be1a019842bb6f6e (patch)
tree56de688a6e48a39717c5caf386e251650fed6d9c
parent943cb7f303e420af76fcc10b6362501a2d7b1249 (diff)
downloadsensor-tw3-99944a3c9ce8d925e044e874be1a019842bb6f6e.tar.gz
sensor-tw3-99944a3c9ce8d925e044e874be1a019842bb6f6e.tar.bz2
sensor-tw3-99944a3c9ce8d925e044e874be1a019842bb6f6e.zip
Change-Id: Ia587aafa45b16b194268a3d081efcfed54d5fc44 Signed-off-by: taemin.yeom <taemin.yeom@samsung.com>
-rw-r--r--src/sensorhub/sensorhub.cpp2
-rw-r--r--src/sensorhub/sensorhub.h2
-rw-r--r--src/sensorhub/sensorhub_sensor.cpp4
-rw-r--r--src/sensorhub/sensorhub_sensor.h4
4 files changed, 6 insertions, 6 deletions
diff --git a/src/sensorhub/sensorhub.cpp b/src/sensorhub/sensorhub.cpp
index 130e46f..2e56182 100644
--- a/src/sensorhub/sensorhub.cpp
+++ b/src/sensorhub/sensorhub.cpp
@@ -126,7 +126,7 @@ bool sensorhub_device::set_attribute_int(uint32_t id, int32_t attribute, int32_t
return sensor->set_attribute_int(attribute, value);
}
-bool sensorhub_device::set_attribute_str(uint32_t id, int32_t attribute, char *value, int len)
+bool sensorhub_device::set_attribute_str(uint32_t id, int32_t attribute, const char *value, int len)
{
sensorhub_sensor *sensor = manager->get_sensor(id);
diff --git a/src/sensorhub/sensorhub.h b/src/sensorhub/sensorhub.h
index 98c5784..50025b3 100644
--- a/src/sensorhub/sensorhub.h
+++ b/src/sensorhub/sensorhub.h
@@ -38,7 +38,7 @@ public:
bool set_interval(uint32_t id, unsigned long val);
bool set_batch_latency(uint32_t id, unsigned long val);
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 len);
+ bool set_attribute_str(uint32_t id, int32_t attribute, const char *value, int len);
int read_fd(uint32_t **ids);
int get_data(uint32_t id, sensor_data_t **data, int *length);
diff --git a/src/sensorhub/sensorhub_sensor.cpp b/src/sensorhub/sensorhub_sensor.cpp
index 2f4b694..de6a924 100644
--- a/src/sensorhub/sensorhub_sensor.cpp
+++ b/src/sensorhub/sensorhub_sensor.cpp
@@ -83,7 +83,7 @@ bool sensorhub_sensor::set_attribute_int(int32_t attribute, int32_t value)
return true;
}
-bool sensorhub_sensor::set_attribute_str(int32_t attribute, char *value, int len)
+bool sensorhub_sensor::set_attribute_str(int32_t attribute, const char *value, int len)
{
attr_info info;
@@ -157,7 +157,7 @@ bool sensorhub_sensor::restore_attributes(void)
for (auto it = attributes_str.begin(); it != attributes_str.end(); ++it) {
int attr = it->first;
- char *val = it->second->value;
+ const char *val = it->second->value;
int len = it->second->len;
if (!set_attribute_str(attr, val, len)) {
_E("Failed to set_attribute_str(%d, %s, %d) for %s",
diff --git a/src/sensorhub/sensorhub_sensor.h b/src/sensorhub/sensorhub_sensor.h
index 672f5eb..421746a 100644
--- a/src/sensorhub/sensorhub_sensor.h
+++ b/src/sensorhub/sensorhub_sensor.h
@@ -33,7 +33,7 @@
#define SHUB_LIB_HRM_BATCH 46
struct attr_info {
- char *value;
+ const char *value;
int len;
};
@@ -57,7 +57,7 @@ public:
virtual bool set_interval(unsigned long val);
virtual bool set_batch_latency(unsigned long val);
virtual bool set_attribute_int(int32_t attribute, int32_t value);
- virtual bool set_attribute_str(int32_t key, char *value, int len);
+ virtual bool set_attribute_str(int32_t key, const char *value, int len);
virtual bool flush(void);
virtual void restore(void);