Fix the problem that the Sensor Frameowk and UAF use different data
authorsaerome.kim <saerome.kim@samsung.com>
Mon, 21 Oct 2019 11:44:26 +0000 (20:44 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Wed, 23 Oct 2019 00:31:02 +0000 (09:31 +0900)
format

- Problem: The data format of timestamp is not different from the sensor framework.
- Cause: The UAF uses 32 bit timestamp but the sensor framework uses 64
bit timestamp.
- Solution: Change timestamps in UAF with 64-bit unsigned long long.

Change-Id: I237f7201d7e7fed00858c47ca9350fcb1ad655c4
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
include/ua-api.h
packaging/ua-manager.spec
ua-api/src/ua-event-handler.c
ua-daemon/include/ua-manager-core.h
ua-daemon/include/ua-manager-database.h
ua-daemon/src/pm/ua-motion-plugin-handler.c
ua-daemon/src/pm/ua-pm-util.c
ua-daemon/src/ua-manager-core.c
ua-daemon/src/ua-manager-device-db.c
ua-plugins/include/ua-plugin.h

index a33fea6..0fa951b 100644 (file)
@@ -494,7 +494,7 @@ typedef struct {
        char device_id[UAM_DEVICE_ID_MAX_STRING_LEN]; /**< Device's uniquie ID */
        uam_ble_payload_s payload; /**< BLE Payload to parse BLE devices*/
        gboolean discriminant; /**< Determines whether to judge PRESENCE/ABSENCE */
-       long last_seen; /**< Latest timestamp when device was discoverd */
+       unsigned long long last_seen; /**< Latest timestamp when device was discoverd */
 } uam_device_info_s;
 
 /**
@@ -504,7 +504,7 @@ typedef struct {
 typedef struct {
        unsigned int status; /**< Sensor status */
        unsigned int sensor_bitmask; /**< sensor bitmask of discovered sensor */
-       long timestamp; /**< Latest timestamp when sensor was discoverd */
+       unsigned long long timestamp; /**< Latest timestamp when sensor was discoverd */
        int accuracy; /**< Accuracy info from sensor sensor */
        int count; /**< count of values from sensor sensor */
        double values[UAM_SENSOR_MAX_VALUES]; /**< info from sensor */
@@ -537,7 +537,7 @@ typedef struct {
        unsigned int sensor_bitmask; /**< Detecting sensor's bitmask */
        char account[UAM_USER_ACCOUNT_MAX_STRING_LEN]; /**< User account */
        char service[UAM_SERVICE_MAX_STRING_LEN]; /**< Service name */
-       long timestamp; /**< Timestamp of detection */
+       unsigned long long timestamp; /**< Timestamp of detection */
        char device_id[UAM_DEVICE_ID_MAX_STRING_LEN]; /**< Device's unique ID */
 } uam_detection_event_data_s;
 
index a1ba30d..6ab9eb4 100644 (file)
@@ -1,6 +1,6 @@
 Name:       ua-manager
 Summary:    User awareness manager
-Version:    0.12.0
+Version:    0.12.1
 Release:    1
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
index e09fe62..8a5bef8 100644 (file)
@@ -29,7 +29,7 @@ static gboolean is_registered = FALSE;
 static uam_event_handler_data_t *event_handler_data = NULL;
 
 static void __uam_copy_sensor_data(uam_sensor_info_s *sensor_info, int status,
-       unsigned int bitmask, long int timestamp, int accuracy, int count, double *values)
+       unsigned int bitmask, unsigned long long timestamp, int accuracy, int count, double *values)
 {
        FUNC_ENTRY;
 
@@ -45,7 +45,7 @@ static void __uam_copy_sensor_data(uam_sensor_info_s *sensor_info, int status,
                sensor_info->values[i] = values[i];
        }
 
-       UAM_INFO("status [%d] sensor bitmask [%u] timestamp [%ld] accuracy [%d]" \
+       UAM_INFO("status [%d] sensor bitmask [%u] timestamp [%llu] accuracy [%d]" \
                "count [%d] value0 [%f] value1 [%f] value2 [%f] value3 [%f]",
                sensor_info->status, sensor_info->sensor_bitmask, sensor_info->timestamp,
                sensor_info->accuracy, sensor_info->count, sensor_info->values[0],
@@ -103,9 +103,9 @@ static void __uam_event_handler(GDBusConnection *connection,
                const char *account = NULL;
                const char *service = NULL;
                const char *device_id = NULL;
-               long timestamp;
+               unsigned long long timestamp;
 
-               g_variant_get(parameters, "(u&s&s&sx)", &sensor_bitmask, &account,
+               g_variant_get(parameters, "(u&s&s&st)", &sensor_bitmask, &account,
                              &service, &device_id, &timestamp);
 
                UAM_DBG("Sensor: 0x%8.8X, User: %s, Device: %s", sensor_bitmask,
@@ -125,9 +125,9 @@ static void __uam_event_handler(GDBusConnection *connection,
                unsigned int sensor_bitmask;
                char *account = NULL;
                char *service = NULL;
-               long timestamp;
+               unsigned long long timestamp;
 
-               g_variant_get(parameters, "(u&s&sx)", &sensor_bitmask, &account,
+               g_variant_get(parameters, "(u&s&st)", &sensor_bitmask, &account,
                              &service, &timestamp);
 
                UAM_DBG("Sensor: 0x%8.8X, User: %s", sensor_bitmask, account);
@@ -143,55 +143,37 @@ static void __uam_event_handler(GDBusConnection *connection,
        } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_PRESENCE_DETECTED)) {
                uam_sensor_info_s sensor_info;
                unsigned int sensor_bitmask;
-               long int timestamp;
+               unsigned long long timestamp;
                int accuracy, count;
                double values[UAM_SENSOR_MAX_VALUES];
 
-               g_variant_get(parameters, "(uiiidddd)", &sensor_bitmask, &timestamp,
+               g_variant_get(parameters, "(utiidddd)", &sensor_bitmask, &timestamp,
                                                &accuracy, &count, &values[0], &values[1],
                                                &values[2], &values[3]);
-               memset(&sensor_info, 0, sizeof(uam_sensor_info_s));
+
+               __uam_copy_sensor_data(&sensor_info, 0, sensor_bitmask, timestamp,
+                                       accuracy, count, values);
+
                event = UAM_EVENT_PRESENCE_DETECTED;
-               sensor_info.sensor_bitmask = sensor_bitmask;
-               sensor_info.timestamp = timestamp;
-               sensor_info.accuracy = accuracy;
-               sensor_info.count = count;
-               for (int i = 0; i < UAM_SENSOR_MAX_VALUES; i++) {
-                       sensor_info.values[i] = values[i];
-               }
-
-               UAM_DBG("sensor bitmask [%u] timestamp [%ld] accuracy [%d] count [%d] " \
-                               "value0 [%f] value1 [%f] value2 [%f] value3 [%f]",
-                               sensor_info.sensor_bitmask, sensor_info.timestamp,
-                               sensor_info.accuracy, sensor_info.count, sensor_info.values[0],
-                               sensor_info.values[1], sensor_info.values[2], sensor_info.values[3]);
+
                __uam_send_event(event, result, &sensor_info,
                                event_info->cb, event_info->user_data);
        } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_ABSENCE_DETECTED)) {
                uam_sensor_info_s sensor_info;
                unsigned int sensor_bitmask;
-               long int timestamp;
+               unsigned long long timestamp;
                int accuracy, count;
                double values[UAM_SENSOR_MAX_VALUES];
 
-               g_variant_get(parameters, "(uiiidddd)", &sensor_bitmask, &timestamp,
+               g_variant_get(parameters, "(utiidddd)", &sensor_bitmask, &timestamp,
                                                &accuracy, &count, &values[0], &values[1],
                                                &values[2], &values[3]);
-               memset(&sensor_info, 0, sizeof(uam_sensor_info_s));
+
+               __uam_copy_sensor_data(&sensor_info, 0, sensor_bitmask, timestamp,
+                                       accuracy, count, values);
+
                event = UAM_EVENT_ABSENCE_DETECTED;
-               sensor_info.sensor_bitmask = sensor_bitmask;
-               sensor_info.timestamp = timestamp;
-               sensor_info.accuracy = accuracy;
-               sensor_info.count = count;
-               for (int i = 0; i < UAM_SENSOR_MAX_VALUES; i++) {
-                       sensor_info.values[i] = values[i];
-               }
-
-               UAM_DBG("sensor bitmask [%u] timestamp [%ld] accuracy [%d] count [%d] " \
-                               "value0 [%f] value1 [%f] value2 [%f] value3 [%f]",
-                               sensor_info.sensor_bitmask, sensor_info.timestamp,
-                               sensor_info.accuracy, sensor_info.count, sensor_info.values[0],
-                               sensor_info.values[1], sensor_info.values[2], sensor_info.values[3]);
+
                __uam_send_event(event, result, &sensor_info,
                                event_info->cb, event_info->user_data);
        } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_SENSOR_STATE_READY)) {
@@ -352,11 +334,11 @@ static void __uam_event_handler(GDBusConnection *connection,
        } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_SENSOR_STATUS_CHANGED)) {
                uam_sensor_info_s sensor_info;
                unsigned int sensor_bitmask;
-               long int timestamp;
+               unsigned long long timestamp;
                int status, accuracy, count;
                double values[UAM_SENSOR_MAX_VALUES];
 
-               g_variant_get(parameters, "(uuiiidddd)", &status, &sensor_bitmask, &timestamp,
+               g_variant_get(parameters, "(uutiidddd)", &status, &sensor_bitmask, &timestamp,
                                                &accuracy, &count, &values[0], &values[1],&values[2], &values[3]);
 
                __uam_copy_sensor_data(&sensor_info, status, sensor_bitmask, timestamp,
index 76f9493..d66752b 100644 (file)
@@ -78,7 +78,7 @@ typedef struct {
        uam_tech_type_e tech_type;
        GSList *addresses;
        int presence_state;
-       long timestamp;
+       unsigned long long timestamp;
        gboolean discriminant;
        struct uam_db_device_info *device;
        GSList *svc_list;
@@ -102,7 +102,7 @@ typedef struct uam_db_user_info {
        char *account;
        GSList *devices;
 //     int presence_state;
-       long timestamp;
+       unsigned long long timestamp;
 } uam_db_user_info_t;
 
 
index 6abdbbd..bf54a02 100644 (file)
@@ -102,7 +102,7 @@ typedef struct {
        int user_id;
        uam_device_info_s dev_info;
        int presence_state;
-       long timestamp;
+       unsigned long long timestamp;
 } db_device_info_t;
 
 /* db init/deinit */
@@ -123,11 +123,12 @@ int _uam_device_db_delete_device_info(
 
 /* insert */
 int _uam_device_db_insert_device_info(
-       int user_id, const uam_device_info_s *dev_info, int presence_state, long timestamp);
+       int user_id, const uam_device_info_s *dev_info, int presence_state,
+       unsigned long long timestamp);
 
 /* update */
 int _uam_device_db_update_device_timestamp(
-       char *device_id, int tech_type, char *address, long timestamp);
+       char *device_id, int tech_type, char *address, unsigned long long timestamp);
 int _uam_device_db_update_device_presence(
        char *device_id, int tech_type, char *address, int presence_state);
 int _uam_device_db_update_device_ip_address(
index 32f8b3a..bb366f9 100644 (file)
@@ -52,7 +52,7 @@ static void motion_detection_status_changed_cb(uas_detection_type_e type,
        uas_sensor_info_t *info = NULL;
        uam_sensor_info_s *motion_info = NULL;
 
-       UAM_ERR("Motion: %s", type == UAS_PRESENCE ? "PRESENCE" : "ABSENCE");
+       UAM_DBG("Motion: %s", type == UAS_PRESENCE ? "PRESENCE" : "ABSENCE");
 
        if (sensor_info)
                info = sensor_info;
index c9c1b30..db0a297 100644 (file)
@@ -376,7 +376,7 @@ uam_sensor_info_s *_pm_util_uas_sensor_info_to_uam_sensor_info(
                sensor_info->values[i] = info->values[i];
        }
 
-       UAM_INFO("t [%ld] Accuaracy [%d] Count [%d] Lux [%f] CCT [%f] Lv[%f] Cv[%f]",
+       UAM_INFO("t [%llu] Accuaracy [%d] Count [%d] Lux [%f] CCT [%f] Lv[%f] Cv[%f]",
                sensor_info->timestamp, sensor_info->accuracy, sensor_info->count,
                sensor_info->values[0], sensor_info->values[1], sensor_info->values[2],
                sensor_info->values[3]);
index 05d00d7..fc29fff 100644 (file)
@@ -509,7 +509,7 @@ static void __get_uam_db_dev_list_to_uam_dev_list(
                        (*device_list)[indx].discriminant = tech->discriminant;
                        (*device_list)[indx].last_seen = tech->timestamp;
                        (*device_list)[indx++].type = tech->tech_type;
-                       UAM_INFO("%s-%d-%s-%s-%ld-%d-%d-0x%2.2X", (*device_list)[indx-1].device_id,
+                       UAM_INFO("%s-%d-%s-%s-%llu-%d-%d-0x%2.2X", (*device_list)[indx-1].device_id,
                                (*device_list)[indx-1].type, (*device_list)[indx-1].mac, (*device_list)[indx-1].ipv4_addr,
                                (*device_list)[indx-1].last_seen, (*device_list)[indx-1].operating_system,
                                (*device_list)[indx-1].discriminant, (*device_list)[indx-1].payload.service_id);
@@ -682,7 +682,7 @@ static GSList *__convert_db_svc_list_to_uam_svc_list(GSList *db_svc_list)
 
 static void __uam_core_add_dev_to_list(
                uam_db_user_info_t *user, const uam_device_info_s *dev_info,
-               int presence_state, long long timestamp, GSList *svc_list)
+               int presence_state, unsigned long long timestamp, GSList *svc_list)
 {
        FUNC_ENTRY;
        uam_db_tech_info_t *tech;
@@ -2400,7 +2400,7 @@ int _uam_core_handle_device_added(int status,
        int ret = UAM_ERROR_NONE;
        uam_db_user_info_t *user = NULL;
        GSList *svc_list = NULL;
-       long long timestamp;
+       unsigned long long timestamp;
 
        /* Send reply over dbus for add device API */
        l = _uam_manager_get_request_list();
@@ -2477,7 +2477,7 @@ int _uam_core_handle_device_added(int status,
                svc_list = g_slist_append(svc_list, service);
        }
 
-       timestamp = time(NULL);
+       timestamp = (unsigned long long)time(NULL);
        __uam_core_add_dev_to_list(user, dev_info,
                        UAM_PRESENCE_STATE_PRESENT, timestamp, svc_list);
 
@@ -2538,7 +2538,7 @@ void __send_sensor_presence_event(uam_sensor_info_s *sensor_info, unsigned int s
 
        if (NULL == sensor_info) {
                _uam_manager_send_event(NULL, UAM_EVENT_PRESENCE_DETECTED,
-                       g_variant_new("(uiiidddd)", sensor, 0, 0, 0, 0, 0, 0, 0));
+                       g_variant_new("(utiidddd)", sensor, 0, 0, 0, 0, 0, 0, 0));
                UAM_DBG("Sent UAM_EVENT_PRESENCE_DETECTED for 0x%8.8X", sensor);
                FUNC_EXIT;
                return;
@@ -2546,7 +2546,7 @@ void __send_sensor_presence_event(uam_sensor_info_s *sensor_info, unsigned int s
 
        if (UAM_SENSOR_BITMASK_LIGHT != sensor) {
                _uam_manager_send_event(NULL, UAM_EVENT_PRESENCE_DETECTED,
-                       g_variant_new("(uiiidddd)", sensor, sensor_info->timestamp,
+                       g_variant_new("(utiidddd)", sensor, sensor_info->timestamp,
                        sensor_info->accuracy, sensor_info->count, sensor_info->values[0],
                        sensor_info->values[1], sensor_info->values[2], sensor_info->values[3]));
                UAM_DBG("Sent UAM_EVENT_PRESENCE_DETECTED for 0x%8.8X", sensor);
@@ -2584,7 +2584,7 @@ void __send_sensor_presence_event(uam_sensor_info_s *sensor_info, unsigned int s
                                continue;
 
                        _uam_manager_send_event(mon->name, UAM_EVENT_PRESENCE_DETECTED,
-                               g_variant_new("(uiiidddd)", sensor, sensor_info->timestamp,
+                               g_variant_new("(utiidddd)", sensor, sensor_info->timestamp,
                                sensor_info->accuracy, sensor_info->count, sensor_info->values[0],
                                sensor_info->values[1], sensor_info->values[2], sensor_info->values[3]));
                        UAM_DBG("Sent UAM_EVENT_PRESENCE_DETECTED to %s for 0x%8.8X",
@@ -2604,7 +2604,7 @@ void __send_sensor_absence_event(uam_sensor_info_s *sensor_info, unsigned int se
 
        if (NULL == sensor_info) {
                _uam_manager_send_event(NULL, UAM_EVENT_ABSENCE_DETECTED,
-                       g_variant_new("(uiiidddd)", sensor, 0, 0, 0, 0, 0, 0, 0));
+                       g_variant_new("(utiidddd)", sensor, 0, 0, 0, 0, 0, 0, 0));
                UAM_DBG("Sent UAM_EVENT_ABSENCE_DETECTED for 0x%8.8X", sensor);
                FUNC_EXIT;
                return;
@@ -2612,7 +2612,7 @@ void __send_sensor_absence_event(uam_sensor_info_s *sensor_info, unsigned int se
 
        if (UAM_SENSOR_BITMASK_LIGHT != sensor) {
                _uam_manager_send_event(NULL, UAM_EVENT_ABSENCE_DETECTED,
-                       g_variant_new("(uiiidddd)", sensor, sensor_info->timestamp,
+                       g_variant_new("(utiidddd)", sensor, sensor_info->timestamp,
                        sensor_info->accuracy, sensor_info->count, sensor_info->values[0],
                        sensor_info->values[1], sensor_info->values[2], sensor_info->values[3]));
                UAM_DBG("Sent UAM_EVENT_ABSENCE_DETECTED for 0x%8.8X", sensor);
@@ -2647,7 +2647,7 @@ void __send_sensor_absence_event(uam_sensor_info_s *sensor_info, unsigned int se
                                continue;
 
                        _uam_manager_send_event(mon->name, UAM_EVENT_ABSENCE_DETECTED,
-                               g_variant_new("(uiiidddd)", sensor, sensor_info->timestamp,
+                               g_variant_new("(utiidddd)", sensor, sensor_info->timestamp,
                                sensor_info->accuracy, sensor_info->count, sensor_info->values[0],
                                sensor_info->values[1], sensor_info->values[2], sensor_info->values[3]));
                        UAM_DBG("Sent UAM_EVENT_ABSENCE_DETECTED for 0x%8.8X", sensor);
@@ -2700,11 +2700,11 @@ void __send_user_presence_event(uam_db_tech_info_t *tech, unsigned int sensor,
                        if (UAM_DETECT_PRESENCE != mon->mode)
                                continue;
 
-                       user->timestamp = (long) time(NULL);
+                       user->timestamp = (unsigned long long) time(NULL);
                        UAM_INFO("sensor [%d]", sensor);
                        _uam_manager_send_event(mon->name,
                                        UAM_EVENT_USER_PRESENCE_DETECTED,
-                                       g_variant_new("(usssx)", sensor,
+                                       g_variant_new("(ussst)", sensor,
                                                user->account, svc->name,
                                                device_id, user->timestamp));
                        UAM_DBG("Sent UAM_EVENT_USER_PRESENCE_DETECTED to %s"
@@ -2776,7 +2776,7 @@ void _uam_core_handle_presence_detected(unsigned int sensor,
        tech = l->data;
 
        tech->presence_state = UAM_PRESENCE_STATE_PRESENT;
-       tech->timestamp = time(NULL);
+       tech->timestamp = (unsigned long long)time(NULL);
 
        /* Check if IP address was updated then update in DB */
        if (UAM_TECH_TYPE_WIFI == dev_info->type) {
@@ -2912,15 +2912,15 @@ static void __send_user_absence_event(uam_tech_type_e type, unsigned int sensor)
                                if (!user)
                                        continue;
 
-                               user->timestamp = (long) time(NULL);
+                               user->timestamp = (unsigned long long) time(NULL);
                                _uam_manager_send_event(mon->name,
                                                UAM_EVENT_USER_ABSENCE_DETECTED,
-                                               g_variant_new("(ussx)", sensor,
+                                               g_variant_new("(usst)", sensor,
                                                        user->account, svc->name,
                                                        user->timestamp));
                                UAM_DBG("Sent UAM_EVENT_USER_ABSENCE_DETECTED to %s"
                                                " for 0x%8.8X, User: %s Service: %s"
-                                               " timestamp [%ld]",
+                                               " timestamp [%llu]",
                                                mon->name, sensor, user->account,
                                                svc->name, user->timestamp);
                        }
@@ -3710,11 +3710,11 @@ void _uam_core_handle_status_changed(unsigned int sensor, unsigned int type,
 
        if (UAS_ABSENCE == type) {
                _uam_manager_send_event(NULL, UAM_EVENT_SENSOR_STATUS_CHANGED,
-                       g_variant_new("(uuiiidddd)", type, sensor, 0, 0, 0, 0, 0, 0, 0));
+                       g_variant_new("(uutiidddd)", type, sensor, 0, 0, 0, 0, 0, 0, 0));
                UAM_DBG("Sent UAM_EVENT_ABSENCE_DETECTED for 0x%8.8X", sensor);
        } else {
                _uam_manager_send_event(NULL, UAM_EVENT_SENSOR_STATUS_CHANGED,
-                       g_variant_new("(uuiiidddd)", type, sensor, sensor_info->timestamp,
+                       g_variant_new("(uutiidddd)", type, sensor, sensor_info->timestamp,
                        sensor_info->accuracy, sensor_info->count, sensor_info->values[0],
                        sensor_info->values[1], sensor_info->values[2], sensor_info->values[3]));
        }
index f0fa635..863a483 100644 (file)
@@ -344,7 +344,7 @@ handle_error:
 }
 
 int _uam_device_db_update_device_timestamp(char *device_id, int tech_type,
-                                         char *address, long timestamp)
+                                         char *address, unsigned long long timestamp)
 {
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = update_timestamp;
@@ -371,7 +371,7 @@ int _uam_device_db_update_device_timestamp(char *device_id, int tech_type,
                goto handle_error;
        }
 
-       UAM_DBG("Device timestamp updated [%ld]", timestamp);
+       UAM_DBG("Device timestamp updated [%llu]", timestamp);
 
 handle_error:
        sqlite3_reset(stmt);
@@ -426,7 +426,7 @@ handle_error:
 }
 
 int _uam_device_db_insert_device_info(int user_id,
-       const uam_device_info_s *dev_info, int presence_state, long timestamp)
+       const uam_device_info_s *dev_info, int presence_state, unsigned long long timestamp)
 {
        FUNC_ENTRY;
        int error_code = UAM_ERROR_NONE;
@@ -435,7 +435,7 @@ int _uam_device_db_insert_device_info(int user_id,
 
        retv_if(NULL == dev_info, UAM_ERROR_INVALID_PARAMETER);
 
-       UAM_INFO("%s-%d-%s-%s-%ld-%d-%d-%d-%d-0x%2.2X", dev_info->device_id,
+       UAM_INFO("%s-%d-%s-%s-%llu-%d-%d-%d-%d-0x%2.2X", dev_info->device_id,
                        dev_info->type, dev_info->mac, dev_info->ipv4_addr,
                        timestamp, presence_state, dev_info->operating_system, dev_info->discriminant,
                        user_id, dev_info->payload.service_id);
@@ -567,7 +567,7 @@ int _uam_device_db_get_device(char *device_id, int tech_type, char *address,
                                UAM_BLE_PAYLOAD_DUID_LEN);
                info->dev_info.payload.device_icon = *(char *)sqlite3_column_text(stmt, 12);
 
-               UAM_INFO("%s-%d-%s-%s-%ld-%d-%d-%d-%d-0x%2.2X",
+               UAM_INFO("%s-%d-%s-%s-%llu-%d-%d-%d-%d-0x%2.2X",
                        info->dev_info.device_id,
                        info->dev_info.type,
                        info->dev_info.mac,
@@ -666,7 +666,7 @@ GSList *_uam_device_db_get_all_devices(void)
                                        UAM_BLE_PAYLOAD_DUID_LEN);
                        info->dev_info.payload.device_icon = *(char *)sqlite3_column_text(stmt, 12);
 
-                       UAM_INFO("%s-%d-%s-%s-%ld-%d-%d-%d-%d-0x%2.2X",
+                       UAM_INFO("%s-%d-%s-%s-%llu-%d-%d-%d-%d-0x%2.2X",
                                info->dev_info.device_id,
                                info->dev_info.type,
                                info->dev_info.mac,
index 25838b3..705e2f5 100644 (file)
@@ -122,7 +122,7 @@ typedef struct {
 
 /* Sensor information structure */
 typedef struct {
-       long int timestamp;
+       unsigned long long timestamp;
        int accuracy;
        int count;
        double *values;