dst_payload->primary_key = src_payload->primary_key;
dst_payload->device_icon = src_payload->device_icon;
dst_payload->secondary_key = src_payload->secondary_key;
- dst_payload->device_uid = g_memdup(&(src_payload->device_uid),
+ dst_payload->device_uid = g_memdup((src_payload->device_uid),
UAM_BLE_PAYLOAD_DEVICE_UID_LEN);
- dst_payload->bt_mac = g_memdup(&(src_payload->bt_mac),
+ dst_payload->bt_mac = g_memdup((src_payload->bt_mac),
UAM_BT_MAC_ADDRESS_STRING_LEN);
}
UAM_DBG("payload primary key: [%d]", dst_payload->primary_key);
if (!payload)
continue;
- _pm_util_uam_db_payload_to_uas_payload(&(*device)->payload[i], payload);
+ _pm_util_uam_db_payload_to_uas_payload(&((*device)->payload[i]), payload);
i++;
}
}
FUNC_EXIT;
}
+void __print_payload(uam_ble_payload_s *payload)
+{
+ ret_if(NULL == payload);
+ UAM_DBG("Payload primary key: [%d], secondary_key: [%d], device_icon: [%d]",
+ payload->primary_key, payload->secondary_key, payload->device_icon);
+ for (int i = 0; i < UAM_BLE_PAYLOAD_DEVICE_UID_LEN; i++)
+ UAM_DBG("Device uid [0x%2.2x]", payload->device_uid[i]);
+}
+
static void __add_service_to_dev_tech_mapping(
uam_db_tech_info_t *tech, uam_db_service_info_t *service)
{
dst_payload->primary_key = src_payload->primary_key;
dst_payload->device_icon = src_payload->device_icon;
dst_payload->secondary_key = src_payload->secondary_key;
+ memset(dst_payload->device_uid, 0, UAM_BLE_PAYLOAD_DEVICE_UID_LEN + 1);
+ memset(dst_payload->bt_mac, 0, UAM_BT_MAC_ADDRESS_STRING_LEN);
if (src_payload->device_uid)
memcpy(dst_payload->device_uid,
src_payload->device_uid, UAM_BLE_PAYLOAD_DEVICE_UID_LEN);
retv_if(UAM_TECH_TYPE_MAX <= tech_type, UAM_ERROR_INVALID_PARAMETER);
// <TO-DO> check if payload already exist
+ __print_payload(payload);
tech_info = __uam_core_get_dev_tech_info(device_id, tech_type);
retv_if(NULL == tech_info, UAM_ERROR_INVALID_PARAMETER);