From: Abhay agarwal Date: Wed, 27 Nov 2019 06:36:02 +0000 (+0530) Subject: Rename ble payload purpose to secondary key X-Git-Tag: accepted/tizen/unified/20200101.120602~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1265375961e1a08ca98f062b701eeeb4fca4f17c;p=platform%2Fcore%2Fconnectivity%2Fua-manager.git Rename ble payload purpose to secondary key Signed-off-by: Abhay agarwal --- diff --git a/include/ua-api.h b/include/ua-api.h index 4e12ec0..6276bd7 100644 --- a/include/ua-api.h +++ b/include/ua-api.h @@ -486,7 +486,7 @@ typedef enum { typedef struct { char primary_key; /** Primary Key */ char device_icon; /** Device icon */ - char purpose; /** Purpose */ + char secondary_key; /** Purpose */ char duid[UAM_BLE_PAYLOAD_DUID_LEN + 1]; /** DUID */ char bt_mac[UAM_BT_MAC_ADDRESS_STRING_LEN]; /** BT MAC Address */ } uam_ble_payload_s; diff --git a/ua-daemon/include/ua-manager-core.h b/ua-daemon/include/ua-manager-core.h index a05ada7..ccaa431 100644 --- a/ua-daemon/include/ua-manager-core.h +++ b/ua-daemon/include/ua-manager-core.h @@ -70,7 +70,7 @@ typedef struct { typedef struct { char primary_key; /** Primary key */ char device_icon; /** Device icon */ - char purpose; /** Purpose */ + char secondary_key; /** Purpose */ char *duid; /** DUID */ char *bt_mac; /** BT MAC Address */ } uam_db_ble_payload_t; diff --git a/ua-daemon/src/pm/ua-pm-util.c b/ua-daemon/src/pm/ua-pm-util.c index 2e1d9d8..fb00281 100644 --- a/ua-daemon/src/pm/ua-pm-util.c +++ b/ua-daemon/src/pm/ua-pm-util.c @@ -199,7 +199,7 @@ void _pm_util_uam_db_dev_to_uas_dev(unsigned int tech_type, } (*device)->payload = g_new0(uas_ble_payload_t, 1); (*device)->payload->primary_key = tech->payload->primary_key; - (*device)->payload->purpose = tech->payload->purpose; + (*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->bt_mac = g_memdup(tech->payload->bt_mac, UAM_BT_MAC_ADDRESS_STRING_LEN); @@ -261,7 +261,7 @@ uas_device_info_t *_pm_util_uam_dev_info_to_uas_dev_info(const uam_device_info_s device->payload = g_new0(uas_ble_payload_t, 1); device->payload->primary_key = dev->payload.primary_key; - device->payload->purpose = dev->payload.purpose; + 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->bt_mac = g_memdup(&(dev->payload.bt_mac), UAM_BT_MAC_ADDRESS_STRING_LEN); @@ -302,7 +302,7 @@ uam_device_info_s *_pm_util_uas_dev_info_to_uam_dev_info(const uas_device_info_t if (dev->payload) { device->payload.primary_key = dev->payload->primary_key; device->payload.device_icon = dev->payload->device_icon; - device->payload.purpose = dev->payload->purpose; + 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->bt_mac) diff --git a/ua-daemon/src/ua-manager-core.c b/ua-daemon/src/ua-manager-core.c index 3f96239..dc9d942 100644 --- a/ua-daemon/src/ua-manager-core.c +++ b/ua-daemon/src/ua-manager-core.c @@ -277,7 +277,7 @@ static void __uam_copy_payload_info(uam_ble_payload_s *dev_payload, uam_db_ble_p if (payload) { dev_payload->primary_key = payload->primary_key; dev_payload->device_icon = payload->device_icon; - dev_payload->purpose = payload->purpose; + dev_payload->secondary_key = payload->secondary_key; if (payload->duid) memcpy(dev_payload->duid, payload->duid, UAM_BLE_PAYLOAD_DUID_LEN); @@ -701,7 +701,7 @@ static void __uam_core_add_dev_to_list( tech->payload = g_new0(uam_db_ble_payload_t, 1); tech->payload->primary_key = dev_info->payload.primary_key; - tech->payload->purpose = dev_info->payload.purpose; + 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->bt_mac = g_memdup(&(dev_info->payload.bt_mac), UAM_BT_MAC_ADDRESS_STRING_LEN); @@ -1196,7 +1196,7 @@ int _uam_core_update_device(const uam_device_info_s *a_device) /* Update Payload for device-tech */ tech->payload->primary_key = a_device->payload.primary_key; - tech->payload->purpose = a_device->payload.purpose; + 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->bt_mac = g_memdup(&(a_device->payload.bt_mac), UAM_BT_MAC_ADDRESS_STRING_LEN); diff --git a/ua-daemon/src/ua-manager-db.c b/ua-daemon/src/ua-manager-db.c index a852097..c1f3032 100644 --- a/ua-daemon/src/ua-manager-db.c +++ b/ua-daemon/src/ua-manager-db.c @@ -50,7 +50,7 @@ "os_type INTEGER, " \ "discriminant INTEGER, " \ "primary_key TEXT, " \ - "purpose TEXT, " \ + "secondary_key TEXT, " \ "duid TEXT, " \ "device_icon TEXT, " \ "FOREIGN KEY(user_id) REFERENCES userdata(user_id), " \ diff --git a/ua-daemon/src/ua-manager-device-db.c b/ua-daemon/src/ua-manager-device-db.c index f8b2781..632b268 100644 --- a/ua-daemon/src/ua-manager-device-db.c +++ b/ua-daemon/src/ua-manager-device-db.c @@ -26,11 +26,11 @@ #define SELECT_ALL_DEVICES "SELECT device_id, tech_type, address, " \ "ip_address, last_seen, presence_state, os_type, " \ - "user_id, discriminant, primary_key, purpose, duid, device_icon FROM devices" + "user_id, discriminant, primary_key, secondary_key, duid, 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, purpose, duid, device_icon FROM devices " \ + "user_id, discriminant, primary_key, secondary_key, duid, 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, " \ - "purpose, duid, device_icon)" \ + "secondary_key, duid, 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, " \ - "purpose, duid, device_icon) = (?, ?, ?, ?, ?, ?, ?) " \ + "secondary_key, duid, device_icon) = (?, ?, ?, ?, ?, ?, ?) " \ "WHERE device_id = ? AND tech_type = ? AND address = ?" #define DELETE_ALL_DEVICES "delete from devices " @@ -433,7 +433,7 @@ int _uam_device_db_update_device_device(char *device_id, int tech_type, error_code, handle_error); DB_ACTION(sqlite3_bind_text(stmt, 4, &(payload.primary_key), 1, SQLITE_TRANSIENT), error_code, handle_error); - DB_ACTION(sqlite3_bind_text(stmt, 5, &(payload.purpose), 1, SQLITE_TRANSIENT), + 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), error_code, handle_error); @@ -497,7 +497,7 @@ int _uam_device_db_insert_device_info(int user_id, error_code, handle_error); DB_ACTION(sqlite3_bind_text(stmt, 10, &(dev_info->payload.primary_key), 1, SQLITE_TRANSIENT), error_code, handle_error); - DB_ACTION(sqlite3_bind_text(stmt, 11, &(dev_info->payload.purpose), 1, SQLITE_TRANSIENT), + 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), error_code, handle_error); @@ -607,7 +607,7 @@ int _uam_device_db_get_device(char *device_id, int tech_type, char *address, 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.purpose = buf ? *buf : 1; + 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); @@ -710,7 +710,7 @@ GSList *_uam_device_db_get_all_devices(void) 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.purpose = buf ? *buf : 1; + 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); diff --git a/ua-daemon/src/ua-manager-request-handler.c b/ua-daemon/src/ua-manager-request-handler.c index a10a088..c2965aa 100644 --- a/ua-daemon/src/ua-manager-request-handler.c +++ b/ua-daemon/src/ua-manager-request-handler.c @@ -811,7 +811,7 @@ static int __uam_manager_async_request_handler( 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.purpose, + dev_info.payload.primary_key, dev_info.payload.secondary_key, dev_info.payload.duid, dev_info.payload.device_icon, dev_info.payload.bt_mac); diff --git a/ua-plugins/include/ua-plugin.h b/ua-plugins/include/ua-plugin.h index bd40701..f0b73dd 100644 --- a/ua-plugins/include/ua-plugin.h +++ b/ua-plugins/include/ua-plugin.h @@ -103,7 +103,7 @@ typedef struct { typedef struct { char primary_key; /** Primary Key */ char device_icon; /** Device icon */ - char purpose; /** Purpose */ + char secondary_key; /** Purpose */ char *duid; /** DUID */ char *bt_mac; /** BT MAC Address */ } uas_ble_payload_t;