g_variant_iter_free(iter);
}
+
void mdg_get_data_from_variant(GVariant *va, char **device_id, char **channel_id,
unsigned char **data, int *data_len)
{
g_variant_iter_free(iter);
}
+void mdg_get_progress_from_variant(GVariant *va, char **file_path,
+ long *send_size, long *total_size, int *percent)
+{
+ GVariantIter *iter = NULL;
+ const gchar *key;
+ GVariant *key_value = NULL;
+
+ g_variant_get(va, "a{sv}", &iter);
+ while (g_variant_iter_loop(iter, "{sv}", &key, &key_value)) {
+ if (g_strcmp0(key, "FilePath") == 0)
+ *file_path = (char *)g_variant_get_string(key_value, NULL);
+ if (g_strcmp0(key, "SendSize") == 0)
+ *send_size = g_variant_get_int64(key_value);
+ if (g_strcmp0(key, "TotalSize") == 0)
+ *total_size = g_variant_get_int64(key_value);
+ if (g_strcmp0(key, "Percent") == 0)
+ *percent = g_variant_get_int32(key_value);
+ }
+
+ g_variant_iter_free(iter);
+}
+
GVariant *mdg_create_variant_device(mdg_device_s *device)
{
GVariant *va;