Rename duid to device_uid
authorAbhay agarwal <ay.agarwal@samsung.com>
Thu, 28 Nov 2019 04:23:38 +0000 (09:53 +0530)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 30 Dec 2019 07:29:55 +0000 (16:29 +0900)
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
include/ua-api.h
ua-daemon/include/ua-manager-core.h
ua-daemon/src/pm/ua-plugin-manager.c
ua-daemon/src/pm/ua-pm-util.c
ua-daemon/src/ua-manager-core.c
ua-daemon/src/ua-manager-db.c
ua-daemon/src/ua-manager-device-db.c
ua-daemon/src/ua-manager-request-handler.c
ua-plugins/include/ua-plugin.h

index 6276bd7..846750f 100644 (file)
@@ -56,10 +56,10 @@ typedef enum {
 #define UAM_DEVICE_ID_MAX_STRING_LEN 50
 
 /**
- * @brief Device's BLE payload DUID length.
+ * @brief Device's BLE payload DEVICE_UID length.
  * @since_tizen 5.5
  */
-#define UAM_BLE_PAYLOAD_DUID_LEN 17
+#define UAM_BLE_PAYLOAD_DEVICE_UID_LEN 17
 
 /**
  * @brief Max. BT MAC address length.
@@ -487,7 +487,7 @@ typedef struct {
        char primary_key; /** Primary Key */
        char device_icon; /** Device icon */
        char secondary_key; /** Purpose */
-       char duid[UAM_BLE_PAYLOAD_DUID_LEN + 1]; /** DUID */
+       char device_uid[UAM_BLE_PAYLOAD_DEVICE_UID_LEN + 1]; /** DEVICE_UID */
        char bt_mac[UAM_BT_MAC_ADDRESS_STRING_LEN]; /** BT MAC Address */
 } uam_ble_payload_s;
 
index ccaa431..3ee75ac 100644 (file)
@@ -71,7 +71,7 @@ typedef struct {
        char primary_key; /** Primary key */
        char device_icon; /** Device icon */
        char secondary_key; /** Purpose */
-       char *duid; /** DUID */
+       char *device_uid; /** DEVICE_UID */
        char *bt_mac; /** BT MAC Address */
 } uam_db_ble_payload_t;
 
index 78e3c5d..78c722c 100644 (file)
@@ -294,7 +294,7 @@ static void __uas_device_list_free(int count, uas_device_info_t *devices)
                g_free(device->addr_list);
 
                if(device->payload) {
-                       g_free(device->payload->duid);
+                       g_free(device->payload->device_uid);
                        g_free(device->payload->bt_mac);
                        g_free(device->payload);
                }
index fb00281..240b8d5 100644 (file)
@@ -144,7 +144,7 @@ void _pm_util_uas_device_info_free(uas_device_info_t *device)
        g_free(device->addr_list);
 
        if (device->payload) {
-               g_free(device->payload->duid);
+               g_free(device->payload->device_uid);
                g_free(device->payload->bt_mac);
                g_free(device->payload);
        }
@@ -201,7 +201,7 @@ void _pm_util_uam_db_dev_to_uas_dev(unsigned int tech_type,
                (*device)->payload->primary_key = tech->payload->primary_key;
                (*device)->payload->secondary_key = tech->payload->secondary_key;
                (*device)->payload->device_icon = tech->payload->device_icon;
-               (*device)->payload->duid = g_memdup(tech->payload->duid, UAM_BLE_PAYLOAD_DUID_LEN);
+               (*device)->payload->device_uid = g_memdup(tech->payload->device_uid, UAM_BLE_PAYLOAD_DEVICE_UID_LEN);
                (*device)->payload->bt_mac = g_memdup(tech->payload->bt_mac, UAM_BT_MAC_ADDRESS_STRING_LEN);
        }
 
@@ -263,7 +263,7 @@ uas_device_info_t *_pm_util_uam_dev_info_to_uas_dev_info(const uam_device_info_s
        device->payload->primary_key = dev->payload.primary_key;
        device->payload->secondary_key = dev->payload.secondary_key;
        device->payload->device_icon = dev->payload.device_icon;
-       device->payload->duid = g_memdup(&(dev->payload.duid), UAM_BLE_PAYLOAD_DUID_LEN);
+       device->payload->device_uid = g_memdup(&(dev->payload.device_uid), UAM_BLE_PAYLOAD_DEVICE_UID_LEN);
        device->payload->bt_mac = g_memdup(&(dev->payload.bt_mac), UAM_BT_MAC_ADDRESS_STRING_LEN);
 
        device->addr_list = g_new0(uas_address_info_t, device->num_addr);
@@ -297,14 +297,14 @@ uam_device_info_s *_pm_util_uas_dev_info_to_uam_dev_info(const uas_device_info_t
        device->last_seen = dev->last_seen;
        g_strlcpy(device->device_id, dev->device_id, UAM_DEVICE_ID_MAX_STRING_LEN);
 
-       memset(device->payload.duid, 0, UAM_BLE_PAYLOAD_DUID_LEN + 1);
+       memset(device->payload.device_uid, 0, UAM_BLE_PAYLOAD_DEVICE_UID_LEN + 1);
        memset(device->payload.bt_mac, 0, UAM_BT_MAC_ADDRESS_STRING_LEN);
        if (dev->payload) {
                device->payload.primary_key = dev->payload->primary_key;
                device->payload.device_icon = dev->payload->device_icon;
                device->payload.secondary_key = dev->payload->secondary_key;
-               if (dev->payload->duid)
-                       memcpy(device->payload.duid, dev->payload->duid, UAM_BLE_PAYLOAD_DUID_LEN);
+               if (dev->payload->device_uid)
+                       memcpy(device->payload.device_uid, dev->payload->device_uid, UAM_BLE_PAYLOAD_DEVICE_UID_LEN);
                if (dev->payload->bt_mac)
                        g_strlcpy(device->payload.bt_mac,
                        dev->payload->bt_mac, UAM_BT_MAC_ADDRESS_STRING_LEN);
index dc9d942..d2eb599 100644 (file)
@@ -134,7 +134,7 @@ static void __free_dev_tech_info(gpointer data)
        tech_info->addresses = NULL;
 
        if (tech_info->payload) {
-               g_free(tech_info->payload->duid);
+               g_free(tech_info->payload->device_uid);
                g_free(tech_info->payload->bt_mac);
                g_free(tech_info->payload);
        }
@@ -278,9 +278,9 @@ static void __uam_copy_payload_info(uam_ble_payload_s *dev_payload, uam_db_ble_p
                dev_payload->primary_key = payload->primary_key;
                dev_payload->device_icon = payload->device_icon;
                dev_payload->secondary_key = payload->secondary_key;
-               if (payload->duid)
-                       memcpy(dev_payload->duid,
-                       payload->duid, UAM_BLE_PAYLOAD_DUID_LEN);
+               if (payload->device_uid)
+                       memcpy(dev_payload->device_uid,
+                       payload->device_uid, UAM_BLE_PAYLOAD_DEVICE_UID_LEN);
                if (payload->bt_mac)
                        memcpy(dev_payload->bt_mac,
                        payload->bt_mac, UAM_BT_MAC_ADDRESS_STRING_LEN);
@@ -309,7 +309,7 @@ static int __copy_tech_info_to_device_info(uam_db_tech_info_t *tech, uam_device_
                        UAM_DEVICE_ID_MAX_STRING_LEN);
        device->type = tech->tech_type;
        device->discriminant = tech->discriminant;
-       memset(device->payload.duid, 0, UAM_BLE_PAYLOAD_DUID_LEN + 1);
+       memset(device->payload.device_uid, 0, UAM_BLE_PAYLOAD_DEVICE_UID_LEN + 1);
        memset(device->payload.bt_mac, 0, UAM_BT_MAC_ADDRESS_STRING_LEN);
        device->last_seen = tech->last_seen;
        __uam_copy_payload_info(&(device->payload), tech->payload);
@@ -703,7 +703,7 @@ static void __uam_core_add_dev_to_list(
        tech->payload->primary_key = dev_info->payload.primary_key;
        tech->payload->secondary_key = dev_info->payload.secondary_key;
        tech->payload->device_icon = dev_info->payload.device_icon;
-       tech->payload->duid = g_memdup(&(dev_info->payload.duid), UAM_BLE_PAYLOAD_DUID_LEN);
+       tech->payload->device_uid = g_memdup(&(dev_info->payload.device_uid), UAM_BLE_PAYLOAD_DEVICE_UID_LEN);
        tech->payload->bt_mac = g_memdup(&(dev_info->payload.bt_mac), UAM_BT_MAC_ADDRESS_STRING_LEN);
 
        tech->svc_list = svc_list;
@@ -1198,7 +1198,7 @@ int _uam_core_update_device(const uam_device_info_s *a_device)
                tech->payload->primary_key = a_device->payload.primary_key;
                tech->payload->secondary_key = a_device->payload.secondary_key;
                tech->payload->device_icon = a_device->payload.device_icon;
-               tech->payload->duid = g_memdup(&(a_device->payload.duid), UAM_BLE_PAYLOAD_DUID_LEN);
+               tech->payload->device_uid = g_memdup(&(a_device->payload.device_uid), UAM_BLE_PAYLOAD_DEVICE_UID_LEN);
                tech->payload->bt_mac = g_memdup(&(a_device->payload.bt_mac), UAM_BT_MAC_ADDRESS_STRING_LEN);
 
                /* Update device's updated information to database */
index c1f3032..ead3598 100644 (file)
@@ -51,7 +51,7 @@
        "discriminant INTEGER, " \
        "primary_key TEXT, " \
        "secondary_key TEXT, " \
-       "duid TEXT, " \
+       "device_uid TEXT, " \
        "device_icon TEXT, " \
        "FOREIGN KEY(user_id) REFERENCES userdata(user_id), " \
        "UNIQUE (device_id, tech_type) " \
index 632b268..fbce295 100644 (file)
 
 #define SELECT_ALL_DEVICES "SELECT device_id, tech_type, address, " \
        "ip_address, last_seen, presence_state, os_type, " \
-       "user_id, discriminant, primary_key, secondary_key, duid, device_icon FROM devices"
+       "user_id, discriminant, primary_key, secondary_key, device_uid, device_icon FROM devices"
 
 #define SELECT_DEVICE "SELECT device_id, tech_type, address, " \
        "ip_address, last_seen, presence_state, os_type, " \
-       "user_id, discriminant, primary_key, secondary_key, duid, device_icon FROM devices " \
+       "user_id, discriminant, primary_key, secondary_key, device_uid, device_icon FROM devices " \
        "WHERE device_id = ? AND tech_type = ? AND address = ?"
 
 #define SELECT_DEVICE_NUMBER "SELECT device_number FROM devices " \
@@ -39,7 +39,7 @@
 #define INSERT_DEVICE "insert into devices " \
        "(device_id, tech_type, address, ip_address, last_seen, " \
        "presence_state, os_type, user_id, discriminant, primary_key, " \
-       "secondary_key, duid, device_icon)" \
+       "secondary_key, device_uid, device_icon)" \
        "values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
 
 #define UPDATE_LAST_SEEN "UPDATE devices " \
@@ -56,7 +56,7 @@
 
 #define UPDATE_DEVICE "UPDATE devices " \
        "SET (os_type, discriminant, ip_address, primary_key, " \
-       "secondary_key, duid, device_icon) = (?, ?, ?, ?, ?, ?, ?) " \
+       "secondary_key, device_uid, device_icon) = (?, ?, ?, ?, ?, ?, ?) " \
        "WHERE device_id = ? AND tech_type = ? AND address = ?"
 
 #define DELETE_ALL_DEVICES "delete from devices "
@@ -435,7 +435,7 @@ int _uam_device_db_update_device_device(char *device_id, int tech_type,
                error_code, handle_error);
        DB_ACTION(sqlite3_bind_text(stmt, 5, &(payload.secondary_key), 1, SQLITE_TRANSIENT),
                error_code, handle_error);
-       DB_ACTION(sqlite3_bind_text(stmt, 6, payload.duid, UAM_BLE_PAYLOAD_DUID_LEN + 1, SQLITE_TRANSIENT),
+       DB_ACTION(sqlite3_bind_text(stmt, 6, payload.device_uid, UAM_BLE_PAYLOAD_DEVICE_UID_LEN + 1, SQLITE_TRANSIENT),
                error_code, handle_error);
        DB_ACTION(sqlite3_bind_text(stmt, 7, &(payload.device_icon), 1, SQLITE_TRANSIENT),
                error_code, handle_error);
@@ -499,7 +499,7 @@ int _uam_device_db_insert_device_info(int user_id,
                error_code, handle_error);
        DB_ACTION(sqlite3_bind_text(stmt, 11, &(dev_info->payload.secondary_key), 1, SQLITE_TRANSIENT),
                error_code, handle_error);
-       DB_ACTION(sqlite3_bind_text(stmt, 12, dev_info->payload.duid, UAM_BLE_PAYLOAD_DUID_LEN + 1, SQLITE_TRANSIENT),
+       DB_ACTION(sqlite3_bind_text(stmt, 12, dev_info->payload.device_uid, UAM_BLE_PAYLOAD_DEVICE_UID_LEN + 1, SQLITE_TRANSIENT),
                error_code, handle_error);
        DB_ACTION(sqlite3_bind_text(stmt, 13, &(dev_info->payload.device_icon), 1, SQLITE_TRANSIENT),
                error_code, handle_error);
@@ -603,14 +603,14 @@ int _uam_device_db_get_device(char *device_id, int tech_type, char *address,
                info->dev_info.operating_system = sqlite3_column_int(stmt, 6);
                info->user_id = sqlite3_column_int(stmt, 7);
                info->dev_info.discriminant = sqlite3_column_int(stmt, 8);
-               memset(info->dev_info.payload.duid, 0, UAM_BLE_PAYLOAD_DUID_LEN + 1);
+               memset(info->dev_info.payload.device_uid, 0, UAM_BLE_PAYLOAD_DEVICE_UID_LEN + 1);
                buf = (char *)sqlite3_column_text(stmt, 9);
                info->dev_info.payload.primary_key = buf ? *buf : 13;
                buf = (char *)sqlite3_column_text(stmt, 10);
                info->dev_info.payload.secondary_key = buf ? *buf : 1;
                if ((char*)sqlite3_column_text(stmt, 11))
-                       memcpy(info->dev_info.payload.duid, (char *)sqlite3_column_text(stmt, 11),
-                               UAM_BLE_PAYLOAD_DUID_LEN);
+                       memcpy(info->dev_info.payload.device_uid, (char *)sqlite3_column_text(stmt, 11),
+                               UAM_BLE_PAYLOAD_DEVICE_UID_LEN);
                buf = (char *)sqlite3_column_text(stmt, 12);
                info->dev_info.payload.device_icon = buf ? *buf : 1;
 
@@ -706,14 +706,14 @@ GSList *_uam_device_db_get_all_devices(void)
                        info->dev_info.operating_system = sqlite3_column_int(stmt, 6);
                        info->user_id = sqlite3_column_int(stmt, 7);
                        info->dev_info.discriminant = sqlite3_column_int(stmt, 8);
-                       memset(info->dev_info.payload.duid, 0, UAM_BLE_PAYLOAD_DUID_LEN + 1);
+                       memset(info->dev_info.payload.device_uid, 0, UAM_BLE_PAYLOAD_DEVICE_UID_LEN + 1);
                        buf = (char *)sqlite3_column_text(stmt, 9);
                        info->dev_info.payload.primary_key = buf ? *buf : 13;
                        buf = (char *)sqlite3_column_text(stmt, 10);
                        info->dev_info.payload.secondary_key = buf ? *buf : 1;
                        if ((char*)sqlite3_column_text(stmt, 11))
-                               memcpy(info->dev_info.payload.duid, (char *)sqlite3_column_text(stmt, 11),
-                                       UAM_BLE_PAYLOAD_DUID_LEN);
+                               memcpy(info->dev_info.payload.device_uid, (char *)sqlite3_column_text(stmt, 11),
+                                       UAM_BLE_PAYLOAD_DEVICE_UID_LEN);
                        buf = (char *)sqlite3_column_text(stmt, 12);
                        info->dev_info.payload.device_icon = buf ? *buf : 1;
 
index c2965aa..f641bf2 100644 (file)
@@ -806,13 +806,13 @@ static int __uam_manager_async_request_handler(
                __uam_manager_copy_params(in_param2,
                                &dev_info, sizeof(uam_device_info_s));
                UAM_DBG("Account: [%s], Type: %d, MAC: [%s] IP: [%s], ID: [%s], Discriminant: [%s]," \
-                       " Payload ServiceId: [0x%2.2X], Purpose: [0x%2.2X], DUID: [%s]," \
+                       " Payload ServiceId: [0x%2.2X], Purpose: [0x%2.2X], DEVICE_UID: [%s]," \
                        " Device Icon: [0x%2.2X], BT MAC Address: [%s]",
                                account, dev_info.type, dev_info.mac,
                                dev_info.ipv4_addr, dev_info.device_id,
                                dev_info.discriminant ? "true" : "false",
                                dev_info.payload.primary_key, dev_info.payload.secondary_key,
-                               dev_info.payload.duid, dev_info.payload.device_icon,
+                               dev_info.payload.device_uid, dev_info.payload.device_icon,
                                dev_info.payload.bt_mac);
 
                if (__uam_manager_is_request_pending(UAM_REQUEST_ADD_DEVICE,
index f0b73dd..ccdcc7d 100644 (file)
@@ -104,7 +104,7 @@ typedef struct {
        char primary_key; /** Primary Key */
        char device_icon; /** Device icon */
        char secondary_key; /** Purpose */
-       char *duid; /** DUID */
+       char *device_uid; /** DEVICE_UID */
        char *bt_mac; /** BT MAC Address */
 } uas_ble_payload_t;