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

/*
 * Copyright (C) 2010-2011 Simon Busch <morphis@gravedo.de>
 *                         Lukas Märdian <lukasmaerdian@gmail.com>
 *
 * 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 <stdlib.h>
#include <string.h>
#include <gee.h>
#include <fsobasics.h>
#include <fsotransport.h>
#include <msmcomm-specs.h>


#define TYPE_MSM_SMS_RETRIEVE_TEXT_MESSAGES (msm_sms_retrieve_text_messages_get_type ())
#define MSM_SMS_RETRIEVE_TEXT_MESSAGES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_SMS_RETRIEVE_TEXT_MESSAGES, MsmSmsRetrieveTextMessages))
#define MSM_SMS_RETRIEVE_TEXT_MESSAGES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_SMS_RETRIEVE_TEXT_MESSAGES, MsmSmsRetrieveTextMessagesClass))
#define IS_MSM_SMS_RETRIEVE_TEXT_MESSAGES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_SMS_RETRIEVE_TEXT_MESSAGES))
#define IS_MSM_SMS_RETRIEVE_TEXT_MESSAGES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_SMS_RETRIEVE_TEXT_MESSAGES))
#define MSM_SMS_RETRIEVE_TEXT_MESSAGES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_SMS_RETRIEVE_TEXT_MESSAGES, MsmSmsRetrieveTextMessagesClass))

typedef struct _MsmSmsRetrieveTextMessages MsmSmsRetrieveTextMessages;
typedef struct _MsmSmsRetrieveTextMessagesClass MsmSmsRetrieveTextMessagesClass;
typedef struct _MsmSmsRetrieveTextMessagesPrivate MsmSmsRetrieveTextMessagesPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _MsmSmsRetrieveTextMessagesRunData MsmSmsRetrieveTextMessagesRunData;

#define TYPE_MSM_SMS_SEND_TEXT_MESSAGE (msm_sms_send_text_message_get_type ())
#define MSM_SMS_SEND_TEXT_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_SMS_SEND_TEXT_MESSAGE, MsmSmsSendTextMessage))
#define MSM_SMS_SEND_TEXT_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_SMS_SEND_TEXT_MESSAGE, MsmSmsSendTextMessageClass))
#define IS_MSM_SMS_SEND_TEXT_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_SMS_SEND_TEXT_MESSAGE))
#define IS_MSM_SMS_SEND_TEXT_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_SMS_SEND_TEXT_MESSAGE))
#define MSM_SMS_SEND_TEXT_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_SMS_SEND_TEXT_MESSAGE, MsmSmsSendTextMessageClass))

typedef struct _MsmSmsSendTextMessage MsmSmsSendTextMessage;
typedef struct _MsmSmsSendTextMessageClass MsmSmsSendTextMessageClass;
typedef struct _MsmSmsSendTextMessagePrivate MsmSmsSendTextMessagePrivate;
#define _g_free0(var) (var = (g_free (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_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _wrap_hex_pdu_unref0(var) ((var == NULL) ? NULL : (var = (wrap_hex_pdu_unref (var), NULL)))
typedef struct _MsmSmsSendTextMessageRunData MsmSmsSendTextMessageRunData;

struct _MsmSmsRetrieveTextMessages {
	FsoGsmSmsRetrieveTextMessages parent_instance;
	MsmSmsRetrieveTextMessagesPrivate * priv;
};

struct _MsmSmsRetrieveTextMessagesClass {
	FsoGsmSmsRetrieveTextMessagesClass parent_class;
};

struct _MsmSmsRetrieveTextMessagesRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmSmsRetrieveTextMessages* self;
	GError* _tmp0_;
	GError * _inner_error_;
};

struct _MsmSmsSendTextMessage {
	FsoGsmSmsSendTextMessage parent_instance;
	MsmSmsSendTextMessagePrivate * priv;
};

struct _MsmSmsSendTextMessageClass {
	FsoGsmSmsSendTextMessageClass 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 _MsmSmsSendTextMessageRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmSmsSendTextMessage* self;
	gchar* recipient_number;
	gchar* contents;
	gboolean want_report;
	FsoGsmModem* _tmp0_;
	FsoGsmChannel* _tmp1_;
	MsmChannel* channel;
	gchar* _tmp2_;
	gchar* smsc;
	guint8* byte_pdu;
	gint byte_pdu_length1;
	gint _byte_pdu_size_;
	const gchar* _tmp3_;
	FsoGsmModem* _tmp4_;
	FsoGsmSmsHandler* _tmp5_;
	FsoGsmSmsHandler* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gboolean _tmp9_;
	GeeArrayList* _tmp10_;
	GeeArrayList* hexpdus;
	MsmChannel* _tmp11_;
	MsmcommSms* _tmp12_;
	MsmcommSmsTemplateInfo _tmp13_;
	MsmcommSmsTemplateInfo template_info;
	MsmcommSmsTemplateInfo _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	GError* err;
	GError* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* msg;
	const gchar* _tmp21_;
	GError* _tmp22_;
	GeeArrayList* _tmp23_;
	GeeArrayList* _tmp24_;
	GeeArrayList* _pdu_list;
	GeeArrayList* _tmp25_;
	gint _tmp26_;
	gint _tmp27_;
	gint _pdu_size;
	gint _pdu_index;
	gint _tmp28_;
	gint _tmp29_;
	gint _tmp30_;
	GeeArrayList* _tmp31_;
	gint _tmp32_;
	gpointer _tmp33_;
	WrapHexPdu* pdu;
	WrapHexPdu* _tmp34_;
	const gchar* _tmp35_;
	gint _tmp36_;
	gint _tmp37_;
	gint len;
	WrapHexPdu* _tmp38_;
	const gchar* _tmp39_;
	gint _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	gint _tmp43_;
	guint8* _tmp44_;
	MsmChannel* _tmp45_;
	MsmcommSms* _tmp46_;
	const gchar* _tmp47_;
	guint8* _tmp48_;
	gint _tmp48__length1;
	GError* err1;
	GError* _tmp49_;
	const gchar* _tmp50_;
	const gchar* _tmp51_;
	gchar* _tmp52_;
	gchar* msg1;
	const gchar* _tmp53_;
	GError* _tmp54_;
	FsoGsmModem* _tmp55_;
	FsoGsmSmsHandler* _tmp56_;
	FsoGsmSmsHandler* _tmp57_;
	guint16 _tmp58_;
	gboolean _tmp59_;
	GError * _inner_error_;
};


static gpointer msm_sms_retrieve_text_messages_parent_class = NULL;
static GType msm_sms_retrieve_text_messages_type_id = 0;
static gpointer msm_sms_send_text_message_parent_class = NULL;
static GType msm_sms_send_text_message_type_id = 0;

GType msm_sms_retrieve_text_messages_get_type (void) G_GNUC_CONST;
GType msm_sms_retrieve_text_messages_register_type (GTypeModule * module);
enum  {
	MSM_SMS_RETRIEVE_TEXT_MESSAGES_DUMMY_PROPERTY
};
static void msm_sms_retrieve_text_messages_real_run_data_free (gpointer _data);
static void msm_sms_retrieve_text_messages_real_run (FsoGsmSmsRetrieveTextMessages* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_sms_retrieve_text_messages_real_run_co (MsmSmsRetrieveTextMessagesRunData* _data_);
MsmSmsRetrieveTextMessages* msm_sms_retrieve_text_messages_new (void);
MsmSmsRetrieveTextMessages* msm_sms_retrieve_text_messages_construct (GType object_type);
GType msm_sms_send_text_message_get_type (void) G_GNUC_CONST;
GType msm_sms_send_text_message_register_type (GTypeModule * module);
enum  {
	MSM_SMS_SEND_TEXT_MESSAGE_DUMMY_PROPERTY
};
static guint8* msm_sms_send_text_message_stringToByteArray (MsmSmsSendTextMessage* self, const gchar* s, int* result_length1);
static void msm_sms_send_text_message_real_run_data_free (gpointer _data);
static void msm_sms_send_text_message_real_run (FsoGsmSmsSendTextMessage* base, const gchar* recipient_number, const gchar* contents, gboolean want_report, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_sms_send_text_message_real_run_co (MsmSmsSendTextMessageRunData* _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_sms_send_text_message_run_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
MsmSmsSendTextMessage* msm_sms_send_text_message_new (void);
MsmSmsSendTextMessage* msm_sms_send_text_message_construct (GType object_type);


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


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


static void msm_sms_retrieve_text_messages_real_run (FsoGsmSmsRetrieveTextMessages* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmSmsRetrieveTextMessages * self;
	MsmSmsRetrieveTextMessagesRunData* _data_;
	MsmSmsRetrieveTextMessages* _tmp0_;
	self = (MsmSmsRetrieveTextMessages*) base;
	_data_ = g_slice_new0 (MsmSmsRetrieveTextMessagesRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_sms_retrieve_text_messages_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_sms_retrieve_text_messages_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	msm_sms_retrieve_text_messages_real_run_co (_data_);
}


static void msm_sms_retrieve_text_messages_real_run_finish (FsoGsmSmsRetrieveTextMessages* base, GAsyncResult* _res_, GError** error) {
	MsmSmsRetrieveTextMessagesRunData* _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_sms_retrieve_text_messages_real_run_co (MsmSmsRetrieveTextMessagesRunData* _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;
}


MsmSmsRetrieveTextMessages* msm_sms_retrieve_text_messages_construct (GType object_type) {
	MsmSmsRetrieveTextMessages * self = NULL;
	self = (MsmSmsRetrieveTextMessages*) fso_gsm_sms_retrieve_text_messages_construct (object_type);
	return self;
}


MsmSmsRetrieveTextMessages* msm_sms_retrieve_text_messages_new (void) {
	return msm_sms_retrieve_text_messages_construct (TYPE_MSM_SMS_RETRIEVE_TEXT_MESSAGES);
}


static void msm_sms_retrieve_text_messages_class_init (MsmSmsRetrieveTextMessagesClass * klass) {
	msm_sms_retrieve_text_messages_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_SMS_RETRIEVE_TEXT_MESSAGES_CLASS (klass)->run = msm_sms_retrieve_text_messages_real_run;
	FSO_GSM_SMS_RETRIEVE_TEXT_MESSAGES_CLASS (klass)->run_finish = msm_sms_retrieve_text_messages_real_run_finish;
}


static void msm_sms_retrieve_text_messages_instance_init (MsmSmsRetrieveTextMessages * self) {
}


/**
 * SMS Mediators
 **/
GType msm_sms_retrieve_text_messages_get_type (void) {
	return msm_sms_retrieve_text_messages_type_id;
}


GType msm_sms_retrieve_text_messages_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmSmsRetrieveTextMessagesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_sms_retrieve_text_messages_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmSmsRetrieveTextMessages), 0, (GInstanceInitFunc) msm_sms_retrieve_text_messages_instance_init, NULL };
	msm_sms_retrieve_text_messages_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_SMS_RETRIEVE_TEXT_MESSAGES, "MsmSmsRetrieveTextMessages", &g_define_type_info, 0);
	return msm_sms_retrieve_text_messages_type_id;
}


/**
     * Helper function to parse a string containing hex bytes.
     * (e.g. "AA18FF94")
     * @return an array of those hex bytes as uint8 numbers.
     **/
static gchar string_get (const gchar* self, glong index) {
	gchar result = '\0';
	glong _tmp0_;
	gchar _tmp1_;
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = index;
	_tmp1_ = ((gchar*) self)[_tmp0_];
	result = _tmp1_;
	return result;
}


static guint8* msm_sms_send_text_message_stringToByteArray (MsmSmsSendTextMessage* self, const gchar* s, int* result_length1) {
	guint8* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* str;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	const gchar* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	guint8* _tmp10_ = NULL;
	guint8* arr;
	gint arr_length1;
	gint _arr_size_;
	GeeHashMap* _tmp11_;
	GeeHashMap* h;
	GeeHashMap* _tmp12_;
	GeeHashMap* _tmp13_;
	GeeHashMap* _tmp14_;
	GeeHashMap* _tmp15_;
	GeeHashMap* _tmp16_;
	GeeHashMap* _tmp17_;
	GeeHashMap* _tmp18_;
	GeeHashMap* _tmp19_;
	GeeHashMap* _tmp20_;
	GeeHashMap* _tmp21_;
	GeeHashMap* _tmp22_;
	GeeHashMap* _tmp23_;
	GeeHashMap* _tmp24_;
	GeeHashMap* _tmp25_;
	GeeHashMap* _tmp26_;
	GeeHashMap* _tmp27_;
	GeeHashMap* _tmp28_;
	GeeHashMap* _tmp29_;
	GeeHashMap* _tmp30_;
	GeeHashMap* _tmp31_;
	GeeHashMap* _tmp32_;
	GeeHashMap* _tmp33_;
	guint8* _tmp58_;
	gint _tmp58__length1;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (s != NULL, NULL);
	_tmp0_ = s;
	_tmp1_ = g_strdup (_tmp0_);
	str = _tmp1_;
	_tmp2_ = str;
	_tmp3_ = strlen (_tmp2_);
	_tmp4_ = _tmp3_;
	if ((_tmp4_ % 2) != 0) {
		const gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp5_ = str;
		_tmp6_ = g_strconcat ("0", _tmp5_, NULL);
		_g_free0 (str);
		str = _tmp6_;
	}
	_tmp7_ = str;
	_tmp8_ = strlen (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_new0 (guint8, _tmp9_ / 2);
	arr = _tmp10_;
	arr_length1 = _tmp9_ / 2;
	_arr_size_ = arr_length1;
	_tmp11_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_UCHAR, NULL, NULL, NULL, NULL, NULL);
	h = _tmp11_;
	_tmp12_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp12_, "0", GUINT_TO_POINTER ((guint8) 0));
	_tmp13_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp13_, "1", GUINT_TO_POINTER ((guint8) 1));
	_tmp14_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp14_, "2", GUINT_TO_POINTER ((guint8) 2));
	_tmp15_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp15_, "3", GUINT_TO_POINTER ((guint8) 3));
	_tmp16_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp16_, "4", GUINT_TO_POINTER ((guint8) 4));
	_tmp17_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp17_, "5", GUINT_TO_POINTER ((guint8) 5));
	_tmp18_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp18_, "6", GUINT_TO_POINTER ((guint8) 6));
	_tmp19_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp19_, "7", GUINT_TO_POINTER ((guint8) 7));
	_tmp20_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp20_, "8", GUINT_TO_POINTER ((guint8) 8));
	_tmp21_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp21_, "9", GUINT_TO_POINTER ((guint8) 9));
	_tmp22_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp22_, "A", GUINT_TO_POINTER ((guint8) 10));
	_tmp23_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp23_, "B", GUINT_TO_POINTER ((guint8) 11));
	_tmp24_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp24_, "C", GUINT_TO_POINTER ((guint8) 12));
	_tmp25_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp25_, "D", GUINT_TO_POINTER ((guint8) 13));
	_tmp26_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp26_, "E", GUINT_TO_POINTER ((guint8) 14));
	_tmp27_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp27_, "F", GUINT_TO_POINTER ((guint8) 15));
	_tmp28_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp28_, "a", GUINT_TO_POINTER ((guint8) 10));
	_tmp29_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp29_, "b", GUINT_TO_POINTER ((guint8) 11));
	_tmp30_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp30_, "c", GUINT_TO_POINTER ((guint8) 12));
	_tmp31_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp31_, "d", GUINT_TO_POINTER ((guint8) 13));
	_tmp32_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp32_, "e", GUINT_TO_POINTER ((guint8) 14));
	_tmp33_ = h;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp33_, "f", GUINT_TO_POINTER ((guint8) 15));
	{
		gint i;
		i = 0;
		{
			gboolean _tmp34_;
			_tmp34_ = TRUE;
			while (TRUE) {
				gboolean _tmp35_;
				gint _tmp37_;
				const gchar* _tmp38_;
				gint _tmp39_;
				gint _tmp40_;
				guint8* _tmp41_;
				gint _tmp41__length1;
				gint _tmp42_;
				GeeHashMap* _tmp43_;
				const gchar* _tmp44_;
				gint _tmp45_;
				gchar _tmp46_ = '\0';
				gchar* _tmp47_ = NULL;
				gchar* _tmp48_;
				gpointer _tmp49_ = NULL;
				GeeHashMap* _tmp50_;
				const gchar* _tmp51_;
				gint _tmp52_;
				gchar _tmp53_ = '\0';
				gchar* _tmp54_ = NULL;
				gchar* _tmp55_;
				gpointer _tmp56_ = NULL;
				guint8 _tmp57_;
				_tmp35_ = _tmp34_;
				if (!_tmp35_) {
					gint _tmp36_;
					_tmp36_ = i;
					i = _tmp36_ + 2;
				}
				_tmp34_ = FALSE;
				_tmp37_ = i;
				_tmp38_ = str;
				_tmp39_ = strlen (_tmp38_);
				_tmp40_ = _tmp39_;
				if (!(_tmp37_ < _tmp40_)) {
					break;
				}
				_tmp41_ = arr;
				_tmp41__length1 = arr_length1;
				_tmp42_ = i;
				_tmp43_ = h;
				_tmp44_ = str;
				_tmp45_ = i;
				_tmp46_ = string_get (_tmp44_, (glong) _tmp45_);
				_tmp47_ = g_strdup_printf ("%c", _tmp46_);
				_tmp48_ = _tmp47_;
				_tmp49_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp43_, _tmp48_);
				_tmp50_ = h;
				_tmp51_ = str;
				_tmp52_ = i;
				_tmp53_ = string_get (_tmp51_, (glong) (_tmp52_ + 1));
				_tmp54_ = g_strdup_printf ("%c", _tmp53_);
				_tmp55_ = _tmp54_;
				_tmp56_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp50_, _tmp55_);
				_tmp41_[_tmp42_ / 2] = (guint8) ((GPOINTER_TO_UINT (_tmp49_) * 16) + GPOINTER_TO_UINT (_tmp56_));
				_tmp57_ = _tmp41_[_tmp42_ / 2];
				_g_free0 (_tmp55_);
				_g_free0 (_tmp48_);
			}
		}
	}
	_tmp58_ = arr;
	_tmp58__length1 = arr_length1;
	if (result_length1) {
		*result_length1 = _tmp58__length1;
	}
	result = _tmp58_;
	_g_object_unref0 (h);
	_g_free0 (str);
	return result;
}


static void msm_sms_send_text_message_real_run_data_free (gpointer _data) {
	MsmSmsSendTextMessageRunData* _data_;
	_data_ = _data;
	_g_free0 (_data_->recipient_number);
	_g_free0 (_data_->contents);
	_g_object_unref0 (_data_->self);
	g_slice_free (MsmSmsSendTextMessageRunData, _data_);
}


static void msm_sms_send_text_message_real_run (FsoGsmSmsSendTextMessage* base, const gchar* recipient_number, const gchar* contents, gboolean want_report, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmSmsSendTextMessage * self;
	MsmSmsSendTextMessageRunData* _data_;
	MsmSmsSendTextMessage* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gboolean _tmp5_;
	self = (MsmSmsSendTextMessage*) base;
	_data_ = g_slice_new0 (MsmSmsSendTextMessageRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_sms_send_text_message_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_sms_send_text_message_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = recipient_number;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->recipient_number = _tmp2_;
	_tmp3_ = contents;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->contents = _tmp4_;
	_tmp5_ = want_report;
	_data_->want_report = _tmp5_;
	msm_sms_send_text_message_real_run_co (_data_);
}


static void msm_sms_send_text_message_real_run_finish (FsoGsmSmsSendTextMessage* base, GAsyncResult* _res_, GError** error) {
	MsmSmsSendTextMessageRunData* _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_sms_send_text_message_run_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	MsmSmsSendTextMessageRunData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	msm_sms_send_text_message_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 gchar* string_slice (const gchar* self, glong start, glong end) {
	gchar* result = NULL;
	gint _tmp0_;
	gint _tmp1_;
	glong string_length;
	glong _tmp2_;
	glong _tmp5_;
	gboolean _tmp8_ = FALSE;
	glong _tmp9_;
	gboolean _tmp12_;
	gboolean _tmp13_ = FALSE;
	glong _tmp14_;
	gboolean _tmp17_;
	glong _tmp18_;
	glong _tmp19_;
	glong _tmp20_;
	glong _tmp21_;
	glong _tmp22_;
	gchar* _tmp23_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	_tmp2_ = start;
	if (_tmp2_ < ((glong) 0)) {
		glong _tmp3_;
		glong _tmp4_;
		_tmp3_ = string_length;
		_tmp4_ = start;
		start = _tmp3_ + _tmp4_;
	}
	_tmp5_ = end;
	if (_tmp5_ < ((glong) 0)) {
		glong _tmp6_;
		glong _tmp7_;
		_tmp6_ = string_length;
		_tmp7_ = end;
		end = _tmp6_ + _tmp7_;
	}
	_tmp9_ = start;
	if (_tmp9_ >= ((glong) 0)) {
		glong _tmp10_;
		glong _tmp11_;
		_tmp10_ = start;
		_tmp11_ = string_length;
		_tmp8_ = _tmp10_ <= _tmp11_;
	} else {
		_tmp8_ = FALSE;
	}
	_tmp12_ = _tmp8_;
	g_return_val_if_fail (_tmp12_, NULL);
	_tmp14_ = end;
	if (_tmp14_ >= ((glong) 0)) {
		glong _tmp15_;
		glong _tmp16_;
		_tmp15_ = end;
		_tmp16_ = string_length;
		_tmp13_ = _tmp15_ <= _tmp16_;
	} else {
		_tmp13_ = FALSE;
	}
	_tmp17_ = _tmp13_;
	g_return_val_if_fail (_tmp17_, NULL);
	_tmp18_ = start;
	_tmp19_ = end;
	g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL);
	_tmp20_ = start;
	_tmp21_ = end;
	_tmp22_ = start;
	_tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_));
	result = _tmp23_;
	return result;
}


static gboolean msm_sms_send_text_message_real_run_co (MsmSmsSendTextMessageRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		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_ = g_strdup ("");
	_data_->smsc = _data_->_tmp2_;
	_data_->byte_pdu_length1 = 0;
	_data_->_byte_pdu_size_ = 0;
	_data_->_tmp3_ = _data_->recipient_number;
	fso_gsm_validatePhoneNumber (_data_->_tmp3_, &_data_->_inner_error_);
	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_);
			_data_->byte_pdu = (g_free (_data_->byte_pdu), NULL);
			_g_free0 (_data_->smsc);
			_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 {
			_data_->byte_pdu = (g_free (_data_->byte_pdu), NULL);
			_g_free0 (_data_->smsc);
			_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;
		}
	}
	_data_->_tmp4_ = fso_gsm_theModem;
	_data_->_tmp5_ = fso_gsm_modem_get_smshandler (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->recipient_number;
	_data_->_tmp8_ = _data_->contents;
	_data_->_tmp9_ = _data_->want_report;
	_data_->_tmp10_ = NULL;
	_data_->_tmp10_ = fso_gsm_sms_handler_formatTextMessage (_data_->_tmp6_, _data_->_tmp7_, _data_->_tmp8_, _data_->_tmp9_);
	_data_->hexpdus = _data_->_tmp10_;
	{
		_data_->_tmp11_ = _data_->channel;
		_data_->_tmp12_ = _data_->_tmp11_->sms_service;
		memset (&_data_->_tmp13_, 0, sizeof (MsmcommSmsTemplateInfo));
		_data_->_state_ = 1;
		msmcomm_sms_message_read_template (_data_->_tmp12_, MSMCOMM_SMS_TEMPLATE_TYPE_SMSC_NUMBER, msm_sms_send_text_message_run_ready, _data_);
		return FALSE;
		_state_1:
		msmcomm_sms_message_read_template_finish (_data_->_tmp12_, _data_->_res_, &_data_->_tmp13_, &_data_->_inner_error_);
		_data_->template_info = _data_->_tmp13_;
		if (_data_->_inner_error_ != NULL) {
			goto __catch29_g_error;
		}
		_data_->_tmp14_ = _data_->template_info;
		_data_->_tmp15_ = _data_->_tmp14_.smsc_number;
		_data_->_tmp16_ = g_strdup (_data_->_tmp15_);
		_g_free0 (_data_->smsc);
		_data_->smsc = _data_->_tmp16_;
		msmcomm_sms_template_info_destroy (&_data_->template_info);
	}
	goto __finally29;
	__catch29_g_error:
	{
		_data_->err = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp17_ = _data_->err;
		_data_->_tmp18_ = _data_->_tmp17_->message;
		_data_->_tmp19_ = NULL;
		_data_->_tmp19_ = string_to_string (_data_->_tmp18_);
		_data_->_tmp20_ = NULL;
		_data_->_tmp20_ = g_strconcat ("Could not gather SMSC number, got: ", _data_->_tmp19_, NULL);
		_data_->msg = _data_->_tmp20_;
		_data_->_tmp21_ = _data_->msg;
		_data_->_tmp22_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INTERNAL_ERROR, _data_->_tmp21_);
		_data_->_inner_error_ = _data_->_tmp22_;
		_g_free0 (_data_->msg);
		_g_error_free0 (_data_->err);
		goto __finally29;
	}
	__finally29:
	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_->hexpdus);
			_data_->byte_pdu = (g_free (_data_->byte_pdu), NULL);
			_g_free0 (_data_->smsc);
			_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_->hexpdus);
			_data_->byte_pdu = (g_free (_data_->byte_pdu), NULL);
			_g_free0 (_data_->smsc);
			_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;
		}
	}
	{
		_data_->_tmp23_ = _data_->hexpdus;
		_data_->_tmp24_ = _g_object_ref0 (_data_->_tmp23_);
		_data_->_pdu_list = _data_->_tmp24_;
		_data_->_tmp25_ = _data_->_pdu_list;
		_data_->_tmp26_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp25_);
		_data_->_tmp27_ = _data_->_tmp26_;
		_data_->_pdu_size = _data_->_tmp27_;
		_data_->_pdu_index = -1;
		while (TRUE) {
			_data_->_tmp28_ = _data_->_pdu_index;
			_data_->_pdu_index = _data_->_tmp28_ + 1;
			_data_->_tmp29_ = _data_->_pdu_index;
			_data_->_tmp30_ = _data_->_pdu_size;
			if (!(_data_->_tmp29_ < _data_->_tmp30_)) {
				break;
			}
			_data_->_tmp31_ = _data_->_pdu_list;
			_data_->_tmp32_ = _data_->_pdu_index;
			_data_->_tmp33_ = NULL;
			_data_->_tmp33_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp31_, _data_->_tmp32_);
			_data_->pdu = (WrapHexPdu*) _data_->_tmp33_;
			_data_->_tmp34_ = _data_->pdu;
			_data_->_tmp35_ = _data_->_tmp34_->hexpdu;
			_data_->_tmp36_ = strlen (_data_->_tmp35_);
			_data_->_tmp37_ = _data_->_tmp36_;
			_data_->len = _data_->_tmp37_;
			_data_->_tmp38_ = _data_->pdu;
			_data_->_tmp39_ = _data_->_tmp38_->hexpdu;
			_data_->_tmp40_ = _data_->len;
			_data_->_tmp41_ = NULL;
			_data_->_tmp41_ = string_slice (_data_->_tmp39_, (glong) 2, (glong) _data_->_tmp40_);
			_data_->_tmp42_ = _data_->_tmp41_;
			_data_->_tmp43_ = 0;
			_data_->_tmp44_ = NULL;
			_data_->_tmp44_ = msm_sms_send_text_message_stringToByteArray (_data_->self, _data_->_tmp42_, &_data_->_tmp43_);
			_data_->byte_pdu = (g_free (_data_->byte_pdu), NULL);
			_data_->byte_pdu = _data_->_tmp44_;
			_data_->byte_pdu_length1 = _data_->_tmp43_;
			_data_->_byte_pdu_size_ = _data_->byte_pdu_length1;
			_g_free0 (_data_->_tmp42_);
			{
				_data_->_tmp45_ = _data_->channel;
				_data_->_tmp46_ = _data_->_tmp45_->sms_service;
				_data_->_tmp47_ = _data_->smsc;
				_data_->_tmp48_ = _data_->byte_pdu;
				_data_->_tmp48__length1 = _data_->byte_pdu_length1;
				_data_->_state_ = 2;
				msmcomm_sms_send_message (_data_->_tmp46_, _data_->_tmp47_, _data_->_tmp48_, _data_->_tmp48__length1, msm_sms_send_text_message_run_ready, _data_);
				return FALSE;
				_state_2:
				msmcomm_sms_send_message_finish (_data_->_tmp46_, _data_->_res_, &_data_->_inner_error_);
				if (_data_->_inner_error_ != NULL) {
					goto __catch30_g_error;
				}
			}
			goto __finally30;
			__catch30_g_error:
			{
				_data_->err1 = _data_->_inner_error_;
				_data_->_inner_error_ = NULL;
				_data_->_tmp49_ = _data_->err1;
				_data_->_tmp50_ = _data_->_tmp49_->message;
				_data_->_tmp51_ = NULL;
				_data_->_tmp51_ = string_to_string (_data_->_tmp50_);
				_data_->_tmp52_ = NULL;
				_data_->_tmp52_ = g_strconcat ("Could not process send_message, got: ", _data_->_tmp51_, NULL);
				_data_->msg1 = _data_->_tmp52_;
				_data_->_tmp53_ = _data_->msg1;
				_data_->_tmp54_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_INTERNAL_ERROR, _data_->_tmp53_);
				_data_->_inner_error_ = _data_->_tmp54_;
				_g_free0 (_data_->msg1);
				_g_error_free0 (_data_->err1);
				goto __finally30;
			}
			__finally30:
			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_);
					_wrap_hex_pdu_unref0 (_data_->pdu);
					_g_object_unref0 (_data_->_pdu_list);
					_g_object_unref0 (_data_->hexpdus);
					_data_->byte_pdu = (g_free (_data_->byte_pdu), NULL);
					_g_free0 (_data_->smsc);
					_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 {
					_wrap_hex_pdu_unref0 (_data_->pdu);
					_g_object_unref0 (_data_->_pdu_list);
					_g_object_unref0 (_data_->hexpdus);
					_data_->byte_pdu = (g_free (_data_->byte_pdu), NULL);
					_g_free0 (_data_->smsc);
					_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;
				}
			}
			_wrap_hex_pdu_unref0 (_data_->pdu);
		}
		_g_object_unref0 (_data_->_pdu_list);
	}
	_data_->_tmp55_ = fso_gsm_theModem;
	_data_->_tmp56_ = fso_gsm_modem_get_smshandler (_data_->_tmp55_);
	_data_->_tmp57_ = _data_->_tmp56_;
	_data_->_tmp58_ = 0U;
	_data_->_tmp58_ = fso_gsm_sms_handler_lastReferenceNumber (_data_->_tmp57_);
	fso_gsm_sms_send_text_message_set_transaction_index ((FsoGsmSmsSendTextMessage*) _data_->self, (gint) _data_->_tmp58_);
	fso_gsm_sms_send_text_message_set_timestamp ((FsoGsmSmsSendTextMessage*) _data_->self, "now");
	_data_->_tmp59_ = _data_->want_report;
	if (_data_->_tmp59_) {
	}
	_g_object_unref0 (_data_->hexpdus);
	_data_->byte_pdu = (g_free (_data_->byte_pdu), NULL);
	_g_free0 (_data_->smsc);
	_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;
}


MsmSmsSendTextMessage* msm_sms_send_text_message_construct (GType object_type) {
	MsmSmsSendTextMessage * self = NULL;
	self = (MsmSmsSendTextMessage*) fso_gsm_sms_send_text_message_construct (object_type);
	return self;
}


MsmSmsSendTextMessage* msm_sms_send_text_message_new (void) {
	return msm_sms_send_text_message_construct (TYPE_MSM_SMS_SEND_TEXT_MESSAGE);
}


static void msm_sms_send_text_message_class_init (MsmSmsSendTextMessageClass * klass) {
	msm_sms_send_text_message_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_SMS_SEND_TEXT_MESSAGE_CLASS (klass)->run = msm_sms_send_text_message_real_run;
	FSO_GSM_SMS_SEND_TEXT_MESSAGE_CLASS (klass)->run_finish = msm_sms_send_text_message_real_run_finish;
}


static void msm_sms_send_text_message_instance_init (MsmSmsSendTextMessage * self) {
}


GType msm_sms_send_text_message_get_type (void) {
	return msm_sms_send_text_message_type_id;
}


GType msm_sms_send_text_message_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmSmsSendTextMessageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_sms_send_text_message_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmSmsSendTextMessage), 0, (GInstanceInitFunc) msm_sms_send_text_message_instance_init, NULL };
	msm_sms_send_text_message_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_SMS_SEND_TEXT_MESSAGE, "MsmSmsSendTextMessage", &g_define_type_info, 0);
	return msm_sms_send_text_message_type_id;
}



