/* mediators_debug.c generated by valac 0.14.2, the Vala compiler
 * generated from mediators_debug.vala, do not modify */

/*
 * Copyright (C) 2010-2011 Simon Busch <morphis@gravedo.de>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <fsogsm.h>
#include <gio/gio.h>
#include <freesmartphone.h>
#include <fsobasics.h>
#include <fsotransport.h>
#include <stdlib.h>
#include <string.h>
#include <msmcomm-specs.h>


#define TYPE_MSM_DEBUG_PING (msm_debug_ping_get_type ())
#define MSM_DEBUG_PING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_DEBUG_PING, MsmDebugPing))
#define MSM_DEBUG_PING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_DEBUG_PING, MsmDebugPingClass))
#define IS_MSM_DEBUG_PING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_DEBUG_PING))
#define IS_MSM_DEBUG_PING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_DEBUG_PING))
#define MSM_DEBUG_PING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_DEBUG_PING, MsmDebugPingClass))

typedef struct _MsmDebugPing MsmDebugPing;
typedef struct _MsmDebugPingClass MsmDebugPingClass;
typedef struct _MsmDebugPingPrivate MsmDebugPingPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_MSM_CHANNEL (msm_channel_get_type ())
#define MSM_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_CHANNEL, MsmChannel))
#define MSM_CHANNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_CHANNEL, MsmChannelClass))
#define IS_MSM_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_CHANNEL))
#define IS_MSM_CHANNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_CHANNEL))
#define MSM_CHANNEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_CHANNEL, MsmChannelClass))

typedef struct _MsmChannel MsmChannel;
typedef struct _MsmChannelClass MsmChannelClass;
typedef struct _MsmChannelPrivate MsmChannelPrivate;

#define TYPE_MSM_UNSOLICITED_RESPONSE_HANDLER (msm_unsolicited_response_handler_get_type ())
#define MSM_UNSOLICITED_RESPONSE_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_UNSOLICITED_RESPONSE_HANDLER, MsmUnsolicitedResponseHandler))
#define MSM_UNSOLICITED_RESPONSE_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_UNSOLICITED_RESPONSE_HANDLER, MsmUnsolicitedResponseHandlerClass))
#define IS_MSM_UNSOLICITED_RESPONSE_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_UNSOLICITED_RESPONSE_HANDLER))
#define IS_MSM_UNSOLICITED_RESPONSE_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_UNSOLICITED_RESPONSE_HANDLER))
#define MSM_UNSOLICITED_RESPONSE_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_UNSOLICITED_RESPONSE_HANDLER, MsmUnsolicitedResponseHandlerClass))

typedef struct _MsmUnsolicitedResponseHandler MsmUnsolicitedResponseHandler;
typedef struct _MsmUnsolicitedResponseHandlerClass MsmUnsolicitedResponseHandlerClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _MsmDebugPingRunData MsmDebugPingRunData;

#define TYPE_MSM_DEBUG_COMMAND (msm_debug_command_get_type ())
#define MSM_DEBUG_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_DEBUG_COMMAND, MsmDebugCommand))
#define MSM_DEBUG_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_DEBUG_COMMAND, MsmDebugCommandClass))
#define IS_MSM_DEBUG_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_DEBUG_COMMAND))
#define IS_MSM_DEBUG_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_DEBUG_COMMAND))
#define MSM_DEBUG_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_DEBUG_COMMAND, MsmDebugCommandClass))

typedef struct _MsmDebugCommand MsmDebugCommand;
typedef struct _MsmDebugCommandClass MsmDebugCommandClass;
typedef struct _MsmDebugCommandPrivate MsmDebugCommandPrivate;
typedef struct _MsmDebugCommandRunData MsmDebugCommandRunData;

#define TYPE_MSM_DEBUG_INJECT_RESPONSE (msm_debug_inject_response_get_type ())
#define MSM_DEBUG_INJECT_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_DEBUG_INJECT_RESPONSE, MsmDebugInjectResponse))
#define MSM_DEBUG_INJECT_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_DEBUG_INJECT_RESPONSE, MsmDebugInjectResponseClass))
#define IS_MSM_DEBUG_INJECT_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_DEBUG_INJECT_RESPONSE))
#define IS_MSM_DEBUG_INJECT_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_DEBUG_INJECT_RESPONSE))
#define MSM_DEBUG_INJECT_RESPONSE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_DEBUG_INJECT_RESPONSE, MsmDebugInjectResponseClass))

typedef struct _MsmDebugInjectResponse MsmDebugInjectResponse;
typedef struct _MsmDebugInjectResponseClass MsmDebugInjectResponseClass;
typedef struct _MsmDebugInjectResponsePrivate MsmDebugInjectResponsePrivate;
typedef struct _MsmDebugInjectResponseRunData MsmDebugInjectResponseRunData;

struct _MsmDebugPing {
	FsoGsmDebugPing parent_instance;
	MsmDebugPingPrivate * priv;
};

struct _MsmDebugPingClass {
	FsoGsmDebugPingClass parent_class;
};

struct _MsmChannel {
	FsoFrameworkAbstractObject parent_instance;
	MsmChannelPrivate * priv;
	gchar* name;
	MsmUnsolicitedResponseHandler* urc_handler;
	MsmcommManagement* management_service;
	MsmcommState* state_service;
	MsmcommMisc* misc_service;
	MsmcommCall* call_service;
	MsmcommSim* sim_service;
	MsmcommPhonebook* phonebook_service;
	MsmcommNetwork* network_service;
	MsmcommSound* sound_service;
	MsmcommSms* sms_service;
};

struct _MsmChannelClass {
	FsoFrameworkAbstractObjectClass parent_class;
};

struct _MsmDebugPingRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmDebugPing* self;
	FsoGsmModem* _tmp0_;
	FsoGsmChannel* _tmp1_;
	MsmChannel* channel;
	MsmChannel* _tmp2_;
	MsmcommMisc* _tmp3_;
	GError* err0;
	GError* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* msg;
	const gchar* _tmp8_;
	GError* _tmp9_;
	GError* err1;
	GError * _inner_error_;
};

struct _MsmDebugCommand {
	FsoGsmDebugCommand parent_instance;
	MsmDebugCommandPrivate * priv;
};

struct _MsmDebugCommandClass {
	FsoGsmDebugCommandClass parent_class;
};

struct _MsmDebugCommandRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmDebugCommand* self;
	gchar* command;
	gchar* category;
	GError* _tmp0_;
	GError * _inner_error_;
};

struct _MsmDebugInjectResponse {
	FsoGsmDebugInjectResponse parent_instance;
	MsmDebugInjectResponsePrivate * priv;
};

struct _MsmDebugInjectResponseClass {
	FsoGsmDebugInjectResponseClass parent_class;
};

struct _MsmDebugInjectResponseRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmDebugInjectResponse* self;
	gchar* command;
	gchar* category;
	GError* _tmp0_;
	GError * _inner_error_;
};


static gpointer msm_debug_ping_parent_class = NULL;
static GType msm_debug_ping_type_id = 0;
static gpointer msm_debug_command_parent_class = NULL;
static GType msm_debug_command_type_id = 0;
static gpointer msm_debug_inject_response_parent_class = NULL;
static GType msm_debug_inject_response_type_id = 0;

GType msm_debug_ping_get_type (void) G_GNUC_CONST;
GType msm_debug_ping_register_type (GTypeModule * module);
enum  {
	MSM_DEBUG_PING_DUMMY_PROPERTY
};
static void msm_debug_ping_real_run_data_free (gpointer _data);
static void msm_debug_ping_real_run (FsoGsmDebugPing* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_debug_ping_real_run_co (MsmDebugPingRunData* _data_);
GType msm_channel_get_type (void) G_GNUC_CONST;
GType msm_channel_register_type (GTypeModule * module);
GType msm_unsolicited_response_handler_get_type (void) G_GNUC_CONST;
GType msm_unsolicited_response_handler_register_type (GTypeModule * module);
static void msm_debug_ping_run_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
MsmDebugPing* msm_debug_ping_new (void);
MsmDebugPing* msm_debug_ping_construct (GType object_type);
GType msm_debug_command_get_type (void) G_GNUC_CONST;
GType msm_debug_command_register_type (GTypeModule * module);
enum  {
	MSM_DEBUG_COMMAND_DUMMY_PROPERTY
};
static void msm_debug_command_real_run_data_free (gpointer _data);
static void msm_debug_command_real_run (FsoGsmDebugCommand* base, const gchar* command, const gchar* category, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_debug_command_real_run_co (MsmDebugCommandRunData* _data_);
MsmDebugCommand* msm_debug_command_new (void);
MsmDebugCommand* msm_debug_command_construct (GType object_type);
GType msm_debug_inject_response_get_type (void) G_GNUC_CONST;
GType msm_debug_inject_response_register_type (GTypeModule * module);
enum  {
	MSM_DEBUG_INJECT_RESPONSE_DUMMY_PROPERTY
};
static void msm_debug_inject_response_real_run_data_free (gpointer _data);
static void msm_debug_inject_response_real_run (FsoGsmDebugInjectResponse* base, const gchar* command, const gchar* category, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_debug_inject_response_real_run_co (MsmDebugInjectResponseRunData* _data_);
MsmDebugInjectResponse* msm_debug_inject_response_new (void);
MsmDebugInjectResponse* msm_debug_inject_response_construct (GType object_type);


static void msm_debug_ping_real_run_data_free (gpointer _data) {
	MsmDebugPingRunData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (MsmDebugPingRunData, _data_);
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static void msm_debug_ping_real_run (FsoGsmDebugPing* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmDebugPing * self;
	MsmDebugPingRunData* _data_;
	MsmDebugPing* _tmp0_;
	self = (MsmDebugPing*) base;
	_data_ = g_slice_new0 (MsmDebugPingRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_debug_ping_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_debug_ping_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	msm_debug_ping_real_run_co (_data_);
}


static void msm_debug_ping_real_run_finish (FsoGsmDebugPing* base, GAsyncResult* _res_, GError** error) {
	MsmDebugPingRunData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void msm_debug_ping_run_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	MsmDebugPingRunData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	msm_debug_ping_real_run_co (_data_);
}


static const gchar* string_to_string (const gchar* self) {
	const gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}


static gboolean msm_debug_ping_real_run_co (MsmDebugPingRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = fso_gsm_theModem;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = fso_gsm_modem_channel (_data_->_tmp0_, "main");
	_data_->channel = IS_MSM_CHANNEL (_data_->_tmp1_) ? ((MsmChannel*) _data_->_tmp1_) : NULL;
	{
		_data_->_tmp2_ = _data_->channel;
		_data_->_tmp3_ = _data_->_tmp2_->misc_service;
		_data_->_state_ = 1;
		msmcomm_misc_test_alive (_data_->_tmp3_, msm_debug_ping_run_ready, _data_);
		return FALSE;
		_state_1:
		msmcomm_misc_test_alive_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			if (_data_->_inner_error_->domain == MSMCOMM_ERROR) {
				goto __catch20_msmcomm_error;
			}
			goto __catch20_g_error;
		}
	}
	goto __finally20;
	__catch20_msmcomm_error:
	{
		_data_->err0 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp4_ = _data_->err0;
		_data_->_tmp5_ = _data_->_tmp4_->message;
		_data_->_tmp6_ = NULL;
		_data_->_tmp6_ = string_to_string (_data_->_tmp5_);
		_data_->_tmp7_ = NULL;
		_data_->_tmp7_ = g_strconcat ("Could not process test_alive command, got: ", _data_->_tmp6_, NULL);
		_data_->msg = _data_->_tmp7_;
		_data_->_tmp8_ = _data_->msg;
		_data_->_tmp9_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INTERNAL_ERROR, _data_->_tmp8_);
		_data_->_inner_error_ = _data_->_tmp9_;
		_g_free0 (_data_->msg);
		_g_error_free0 (_data_->err0);
		goto __finally20;
	}
	goto __finally20;
	__catch20_g_error:
	{
		_data_->err1 = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_g_error_free0 (_data_->err1);
	}
	__finally20:
	if (_data_->_inner_error_ != NULL) {
		if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->channel);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->channel);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
			g_clear_error (&_data_->_inner_error_);
			return FALSE;
		}
	}
	_g_object_unref0 (_data_->channel);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


MsmDebugPing* msm_debug_ping_construct (GType object_type) {
	MsmDebugPing * self = NULL;
	self = (MsmDebugPing*) fso_gsm_debug_ping_construct (object_type);
	return self;
}


MsmDebugPing* msm_debug_ping_new (void) {
	return msm_debug_ping_construct (TYPE_MSM_DEBUG_PING);
}


static void msm_debug_ping_class_init (MsmDebugPingClass * klass) {
	msm_debug_ping_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_DEBUG_PING_CLASS (klass)->run = msm_debug_ping_real_run;
	FSO_GSM_DEBUG_PING_CLASS (klass)->run_finish = msm_debug_ping_real_run_finish;
}


static void msm_debug_ping_instance_init (MsmDebugPing * self) {
}


GType msm_debug_ping_get_type (void) {
	return msm_debug_ping_type_id;
}


GType msm_debug_ping_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmDebugPingClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_debug_ping_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmDebugPing), 0, (GInstanceInitFunc) msm_debug_ping_instance_init, NULL };
	msm_debug_ping_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_DEBUG_PING, "MsmDebugPing", &g_define_type_info, 0);
	return msm_debug_ping_type_id;
}


static void msm_debug_command_real_run_data_free (gpointer _data) {
	MsmDebugCommandRunData* _data_;
	_data_ = _data;
	_g_free0 (_data_->command);
	_g_free0 (_data_->category);
	_g_object_unref0 (_data_->self);
	g_slice_free (MsmDebugCommandRunData, _data_);
}


static void msm_debug_command_real_run (FsoGsmDebugCommand* base, const gchar* command, const gchar* category, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmDebugCommand * self;
	MsmDebugCommandRunData* _data_;
	MsmDebugCommand* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	self = (MsmDebugCommand*) base;
	_data_ = g_slice_new0 (MsmDebugCommandRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_debug_command_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_debug_command_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = command;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->command = _tmp2_;
	_tmp3_ = category;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->category = _tmp4_;
	msm_debug_command_real_run_co (_data_);
}


static void msm_debug_command_real_run_finish (FsoGsmDebugCommand* base, GAsyncResult* _res_, GError** error) {
	MsmDebugCommandRunData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean msm_debug_command_real_run_co (MsmDebugCommandRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_UNSUPPORTED, "Not yet implemented!");
	_data_->_inner_error_ = _data_->_tmp0_;
	if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


MsmDebugCommand* msm_debug_command_construct (GType object_type) {
	MsmDebugCommand * self = NULL;
	self = (MsmDebugCommand*) fso_gsm_debug_command_construct (object_type);
	return self;
}


MsmDebugCommand* msm_debug_command_new (void) {
	return msm_debug_command_construct (TYPE_MSM_DEBUG_COMMAND);
}


static void msm_debug_command_class_init (MsmDebugCommandClass * klass) {
	msm_debug_command_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_DEBUG_COMMAND_CLASS (klass)->run = msm_debug_command_real_run;
	FSO_GSM_DEBUG_COMMAND_CLASS (klass)->run_finish = msm_debug_command_real_run_finish;
}


static void msm_debug_command_instance_init (MsmDebugCommand * self) {
}


GType msm_debug_command_get_type (void) {
	return msm_debug_command_type_id;
}


GType msm_debug_command_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmDebugCommandClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_debug_command_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmDebugCommand), 0, (GInstanceInitFunc) msm_debug_command_instance_init, NULL };
	msm_debug_command_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_DEBUG_COMMAND, "MsmDebugCommand", &g_define_type_info, 0);
	return msm_debug_command_type_id;
}


static void msm_debug_inject_response_real_run_data_free (gpointer _data) {
	MsmDebugInjectResponseRunData* _data_;
	_data_ = _data;
	_g_free0 (_data_->command);
	_g_free0 (_data_->category);
	_g_object_unref0 (_data_->self);
	g_slice_free (MsmDebugInjectResponseRunData, _data_);
}


static void msm_debug_inject_response_real_run (FsoGsmDebugInjectResponse* base, const gchar* command, const gchar* category, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmDebugInjectResponse * self;
	MsmDebugInjectResponseRunData* _data_;
	MsmDebugInjectResponse* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	self = (MsmDebugInjectResponse*) base;
	_data_ = g_slice_new0 (MsmDebugInjectResponseRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_debug_inject_response_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_debug_inject_response_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = command;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->command = _tmp2_;
	_tmp3_ = category;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->category = _tmp4_;
	msm_debug_inject_response_real_run_co (_data_);
}


static void msm_debug_inject_response_real_run_finish (FsoGsmDebugInjectResponse* base, GAsyncResult* _res_, GError** error) {
	MsmDebugInjectResponseRunData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean msm_debug_inject_response_real_run_co (MsmDebugInjectResponseRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_UNSUPPORTED, "Not yet implemented!");
	_data_->_inner_error_ = _data_->_tmp0_;
	if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


MsmDebugInjectResponse* msm_debug_inject_response_construct (GType object_type) {
	MsmDebugInjectResponse * self = NULL;
	self = (MsmDebugInjectResponse*) fso_gsm_debug_inject_response_construct (object_type);
	return self;
}


MsmDebugInjectResponse* msm_debug_inject_response_new (void) {
	return msm_debug_inject_response_construct (TYPE_MSM_DEBUG_INJECT_RESPONSE);
}


static void msm_debug_inject_response_class_init (MsmDebugInjectResponseClass * klass) {
	msm_debug_inject_response_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_DEBUG_INJECT_RESPONSE_CLASS (klass)->run = msm_debug_inject_response_real_run;
	FSO_GSM_DEBUG_INJECT_RESPONSE_CLASS (klass)->run_finish = msm_debug_inject_response_real_run_finish;
}


static void msm_debug_inject_response_instance_init (MsmDebugInjectResponse * self) {
}


GType msm_debug_inject_response_get_type (void) {
	return msm_debug_inject_response_type_id;
}


GType msm_debug_inject_response_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmDebugInjectResponseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_debug_inject_response_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmDebugInjectResponse), 0, (GInstanceInitFunc) msm_debug_inject_response_instance_init, NULL };
	msm_debug_inject_response_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_DEBUG_INJECT_RESPONSE, "MsmDebugInjectResponse", &g_define_type_info, 0);
	return msm_debug_inject_response_type_id;
}



