-void __bt_map_property_changed_event(GVariant *msg,
- const char *path)
-{
- BT_DBG("Entered");
- GVariantIter value_iter;
- char *property = NULL;
- GVariant *val = NULL;
- GVariant *child = NULL;
-
- g_variant_iter_init(&value_iter, msg);
- while ((child = g_variant_iter_next_value(&value_iter))) {
- g_variant_get(child, "{sv}", &property, &val);
- ret_if(property == NULL);
-
- if (strcasecmp(property, "Status") == 0) {
- char *status = NULL;
- g_variant_get(val, "s", &status);
- BT_DBG("Status is %s", status);
-
- if (strcasecmp(status, "active") == 0) {
- BT_DBG("EVENT : STARTED");
- // currently doing nothing
- } else if (strcasecmp(status, "complete") == 0) {
- BT_DBG("EVENT : COMPLETED");
- _bt_map_on_transfer_finished(path, BLUETOOTH_ERROR_NONE);
- } else if (strcasecmp(status, "error") == 0) {
- BT_DBG("EVENT : FAILED");
- _bt_map_on_transfer_finished(path, BLUETOOTH_ERROR_INTERNAL);
- }
- g_free(status);
- } else if (strcasecmp(property, "Transferred") == 0) {
- guint64 transferred = 0;
- g_variant_get(val, "t", &transferred);
-
- BT_DBG("EVENT : PROGRESS CALLBACK");
- // currently doing nothing - progress callback type is not used
- } else {
- BT_DBG("OTHER EVENT : property : [%s]", property);
- }
- g_free(property);
- g_variant_unref(child);
- g_variant_unref(val);
- }
-}
-
-void _bt_map_property_changed_event(GVariant *msg, const char *path)
-{
- BT_DBG("Entered _bt_map_property_changed_event");
- char *interface_name = NULL;
- GVariant *value = NULL;
- g_variant_get(msg, "(&s@a{sv}@as)", &interface_name, &value, NULL);
- BT_INFO("interface_name = %s", interface_name);
- if (strcasecmp(interface_name, BT_OBEX_TRANSFER_INTERFACE) == 0) {
- __bt_map_property_changed_event(value,
- path);
- } else {
- BT_DBG("interface_name : [%s]", interface_name);
- }
- g_variant_unref(value);
-}
-
-