Exemple #1
0
static void ussd_cancel_callback(const struct ofono_error *error, void *data)
{
	struct ofono_ussd *ussd = data;
	DBusMessage *reply;

	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
		DBG("ussd cancel failed with error: %s",
				telephony_error_to_str(error));

		reply = __ofono_error_failed(ussd->cancel);
		__ofono_dbus_pending_reply(&ussd->cancel, reply);

		return;
	}

	if (ussd->pending) {
		reply = __ofono_error_canceled(ussd->pending);
		__ofono_dbus_pending_reply(&ussd->pending, reply);
	}

	reply = dbus_message_new_method_return(ussd->cancel);
	__ofono_dbus_pending_reply(&ussd->cancel, reply);

	if (ussd->req)
		ussd_request_finish(ussd, -ECANCELED, 0, NULL, 0);

	ussd_change_state(ussd, USSD_STATE_IDLE);
}
Exemple #2
0
static void ussd_response_callback(const struct ofono_error *error, void *data)
{
	struct ofono_ussd *ussd = data;
	DBusMessage *reply;

	if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
		DBG("ussd response failed with error: %s",
				telephony_error_to_str(error));

	if (error->type == OFONO_ERROR_TYPE_NO_ERROR) {
		ussd_change_state(ussd, USSD_STATE_RESPONSE_SENT);
		return;
	}

	if (ussd->pending == NULL)
		return;

	reply = __ofono_error_failed(ussd->pending);
	__ofono_dbus_pending_reply(&ussd->pending, reply);
}
Exemple #3
0
static void request_phone_number_cb(const struct ofono_error *error,
					const struct ofono_phone_number *number,
					void *data)
{
	struct ofono_handsfree *hf = data;
	DBusMessage *reply;
	const char *phone_number;

	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
		DBG("Phone number request callback returned error: %s",
			telephony_error_to_str(error));

		reply = __ofono_error_failed(hf->pending);
		__ofono_dbus_pending_reply(&hf->pending, reply);
		return;
	}

	phone_number = phone_number_to_string(number);
	reply = dbus_message_new_method_return(hf->pending);
	dbus_message_append_args(reply, DBUS_TYPE_STRING, &phone_number,
					DBUS_TYPE_INVALID);
	__ofono_dbus_pending_reply(&hf->pending, reply);
}