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

/*
 * Copyright (C) 2009-2011 Michael 'Mickey' Lauer <mlauer@vanille-media.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 <smsutil.h>
#include <conversions.h>
#include <fsobasics.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <gee.h>
#include <freesmartphone.h>
#include <fsotransport.h>
#include <util.h>
#include <gobject/gvaluecollector.h>


#define TYPE_WRAP_SMS (wrap_sms_get_type ())
#define WRAP_SMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WRAP_SMS, WrapSms))
#define WRAP_SMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WRAP_SMS, WrapSmsClass))
#define IS_WRAP_SMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WRAP_SMS))
#define IS_WRAP_SMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WRAP_SMS))
#define WRAP_SMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WRAP_SMS, WrapSmsClass))

typedef struct _WrapSms WrapSms;
typedef struct _WrapSmsClass WrapSmsClass;
typedef struct _WrapSmsPrivate WrapSmsPrivate;
#define _sms_free0(var) ((var == NULL) ? NULL : (var = (sms_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ParamSpecWrapSms ParamSpecWrapSms;

#define TYPE_WRAP_HEX_PDU (wrap_hex_pdu_get_type ())
#define WRAP_HEX_PDU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WRAP_HEX_PDU, WrapHexPdu))
#define WRAP_HEX_PDU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WRAP_HEX_PDU, WrapHexPduClass))
#define IS_WRAP_HEX_PDU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WRAP_HEX_PDU))
#define IS_WRAP_HEX_PDU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WRAP_HEX_PDU))
#define WRAP_HEX_PDU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WRAP_HEX_PDU, WrapHexPduClass))

typedef struct _WrapHexPdu WrapHexPdu;
typedef struct _WrapHexPduClass WrapHexPduClass;
typedef struct _WrapHexPduPrivate WrapHexPduPrivate;
typedef struct _ParamSpecWrapHexPdu ParamSpecWrapHexPdu;

#define FSO_GSM_TYPE_SMS_HANDLER (fso_gsm_sms_handler_get_type ())
#define FSO_GSM_SMS_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_SMS_HANDLER, FsoGsmSmsHandler))
#define FSO_GSM_IS_SMS_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_SMS_HANDLER))
#define FSO_GSM_SMS_HANDLER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FSO_GSM_TYPE_SMS_HANDLER, FsoGsmSmsHandlerIface))

typedef struct _FsoGsmSmsHandler FsoGsmSmsHandler;
typedef struct _FsoGsmSmsHandlerIface FsoGsmSmsHandlerIface;

#define FSO_GSM_TYPE_ISMS_STORAGE (fso_gsm_isms_storage_get_type ())
#define FSO_GSM_ISMS_STORAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_ISMS_STORAGE, FsoGsmISmsStorage))
#define FSO_GSM_IS_ISMS_STORAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_ISMS_STORAGE))
#define FSO_GSM_ISMS_STORAGE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FSO_GSM_TYPE_ISMS_STORAGE, FsoGsmISmsStorageIface))

typedef struct _FsoGsmISmsStorage FsoGsmISmsStorage;
typedef struct _FsoGsmISmsStorageIface FsoGsmISmsStorageIface;

#define FSO_GSM_TYPE_NULL_SMS_HANDLER (fso_gsm_null_sms_handler_get_type ())
#define FSO_GSM_NULL_SMS_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_NULL_SMS_HANDLER, FsoGsmNullSmsHandler))
#define FSO_GSM_NULL_SMS_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FSO_GSM_TYPE_NULL_SMS_HANDLER, FsoGsmNullSmsHandlerClass))
#define FSO_GSM_IS_NULL_SMS_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_NULL_SMS_HANDLER))
#define FSO_GSM_IS_NULL_SMS_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FSO_GSM_TYPE_NULL_SMS_HANDLER))
#define FSO_GSM_NULL_SMS_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FSO_GSM_TYPE_NULL_SMS_HANDLER, FsoGsmNullSmsHandlerClass))

typedef struct _FsoGsmNullSmsHandler FsoGsmNullSmsHandler;
typedef struct _FsoGsmNullSmsHandlerClass FsoGsmNullSmsHandlerClass;
typedef struct _FsoGsmNullSmsHandlerPrivate FsoGsmNullSmsHandlerPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _fso_gsm_null_sms_handler_handleIncomingSmsOnSimData fso_gsm_null_sms_handler_handleIncomingSmsOnSimData;
typedef struct _fso_gsm_null_sms_handler_handleIncomingSmsData fso_gsm_null_sms_handler_handleIncomingSmsData;
typedef struct _fso_gsm_null_sms_handler_handleIncomingSmsReportData fso_gsm_null_sms_handler_handleIncomingSmsReportData;

#define FSO_GSM_TYPE_ABSTRACT_SMS_HANDLER (fso_gsm_abstract_sms_handler_get_type ())
#define FSO_GSM_ABSTRACT_SMS_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_ABSTRACT_SMS_HANDLER, FsoGsmAbstractSmsHandler))
#define FSO_GSM_ABSTRACT_SMS_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FSO_GSM_TYPE_ABSTRACT_SMS_HANDLER, FsoGsmAbstractSmsHandlerClass))
#define FSO_GSM_IS_ABSTRACT_SMS_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_ABSTRACT_SMS_HANDLER))
#define FSO_GSM_IS_ABSTRACT_SMS_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FSO_GSM_TYPE_ABSTRACT_SMS_HANDLER))
#define FSO_GSM_ABSTRACT_SMS_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FSO_GSM_TYPE_ABSTRACT_SMS_HANDLER, FsoGsmAbstractSmsHandlerClass))

typedef struct _FsoGsmAbstractSmsHandler FsoGsmAbstractSmsHandler;
typedef struct _FsoGsmAbstractSmsHandlerClass FsoGsmAbstractSmsHandlerClass;
typedef struct _FsoGsmAbstractSmsHandlerPrivate FsoGsmAbstractSmsHandlerPrivate;

#define FSO_GSM_TYPE_MODEM (fso_gsm_modem_get_type ())
#define FSO_GSM_MODEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_MODEM, FsoGsmModem))
#define FSO_GSM_IS_MODEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_MODEM))
#define FSO_GSM_MODEM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FSO_GSM_TYPE_MODEM, FsoGsmModemIface))

typedef struct _FsoGsmModem FsoGsmModem;
typedef struct _FsoGsmModemIface FsoGsmModemIface;

#define FSO_GSM_TYPE_CHANNEL (fso_gsm_channel_get_type ())
#define FSO_GSM_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_CHANNEL, FsoGsmChannel))
#define FSO_GSM_IS_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_CHANNEL))
#define FSO_GSM_CHANNEL_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FSO_GSM_TYPE_CHANNEL, FsoGsmChannelIface))

typedef struct _FsoGsmChannel FsoGsmChannel;
typedef struct _FsoGsmChannelIface FsoGsmChannelIface;

#define FSO_GSM_MODEM_TYPE_STATUS (fso_gsm_modem_status_get_type ())

#define FSO_GSM_MODEM_TYPE_NETWORK_STATUS (fso_gsm_modem_network_status_get_type ())

#define FSO_GSM_TYPE_AT_COMMAND_SEQUENCE (fso_gsm_at_command_sequence_get_type ())
#define FSO_GSM_AT_COMMAND_SEQUENCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_AT_COMMAND_SEQUENCE, FsoGsmAtCommandSequence))
#define FSO_GSM_AT_COMMAND_SEQUENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FSO_GSM_TYPE_AT_COMMAND_SEQUENCE, FsoGsmAtCommandSequenceClass))
#define FSO_GSM_IS_AT_COMMAND_SEQUENCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_AT_COMMAND_SEQUENCE))
#define FSO_GSM_IS_AT_COMMAND_SEQUENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FSO_GSM_TYPE_AT_COMMAND_SEQUENCE))
#define FSO_GSM_AT_COMMAND_SEQUENCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FSO_GSM_TYPE_AT_COMMAND_SEQUENCE, FsoGsmAtCommandSequenceClass))

typedef struct _FsoGsmAtCommandSequence FsoGsmAtCommandSequence;
typedef struct _FsoGsmAtCommandSequenceClass FsoGsmAtCommandSequenceClass;

#define FSO_GSM_TYPE_AT_COMMAND_QUEUE_COMMAND (fso_gsm_at_command_queue_command_get_type ())
#define FSO_GSM_AT_COMMAND_QUEUE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_AT_COMMAND_QUEUE_COMMAND, FsoGsmAtCommandQueueCommand))
#define FSO_GSM_IS_AT_COMMAND_QUEUE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_AT_COMMAND_QUEUE_COMMAND))
#define FSO_GSM_AT_COMMAND_QUEUE_COMMAND_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FSO_GSM_TYPE_AT_COMMAND_QUEUE_COMMAND, FsoGsmAtCommandQueueCommandIface))

typedef struct _FsoGsmAtCommandQueueCommand FsoGsmAtCommandQueueCommand;
typedef struct _FsoGsmAtCommandQueueCommandIface FsoGsmAtCommandQueueCommandIface;

#define FSO_GSM_TYPE_AT_COMMAND (fso_gsm_at_command_get_type ())
#define FSO_GSM_AT_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_AT_COMMAND, FsoGsmAtCommand))
#define FSO_GSM_IS_AT_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_AT_COMMAND))
#define FSO_GSM_AT_COMMAND_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FSO_GSM_TYPE_AT_COMMAND, FsoGsmAtCommandIface))

typedef struct _FsoGsmAtCommand FsoGsmAtCommand;
typedef struct _FsoGsmAtCommandIface FsoGsmAtCommandIface;

#define FSO_GSM_CONSTANTS_TYPE_AT_RESPONSE (fso_gsm_constants_at_response_get_type ())

#define FSO_GSM_MODEM_TYPE_DATA (fso_gsm_modem_data_get_type ())
#define FSO_GSM_MODEM_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_MODEM_TYPE_DATA, FsoGsmModemData))
#define FSO_GSM_MODEM_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FSO_GSM_MODEM_TYPE_DATA, FsoGsmModemDataClass))
#define FSO_GSM_MODEM_IS_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_MODEM_TYPE_DATA))
#define FSO_GSM_MODEM_IS_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FSO_GSM_MODEM_TYPE_DATA))
#define FSO_GSM_MODEM_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FSO_GSM_MODEM_TYPE_DATA, FsoGsmModemDataClass))

typedef struct _FsoGsmModemData FsoGsmModemData;
typedef struct _FsoGsmModemDataClass FsoGsmModemDataClass;

#define FSO_GSM_TYPE_CALL_HANDLER (fso_gsm_call_handler_get_type ())
#define FSO_GSM_CALL_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_CALL_HANDLER, FsoGsmCallHandler))
#define FSO_GSM_IS_CALL_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_CALL_HANDLER))
#define FSO_GSM_CALL_HANDLER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FSO_GSM_TYPE_CALL_HANDLER, FsoGsmCallHandlerIface))

typedef struct _FsoGsmCallHandler FsoGsmCallHandler;
typedef struct _FsoGsmCallHandlerIface FsoGsmCallHandlerIface;

#define FSO_GSM_TYPE_CALL_INFO (fso_gsm_call_info_get_type ())
#define FSO_GSM_CALL_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_CALL_INFO, FsoGsmCallInfo))
#define FSO_GSM_CALL_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FSO_GSM_TYPE_CALL_INFO, FsoGsmCallInfoClass))
#define FSO_GSM_IS_CALL_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_CALL_INFO))
#define FSO_GSM_IS_CALL_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FSO_GSM_TYPE_CALL_INFO))
#define FSO_GSM_CALL_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FSO_GSM_TYPE_CALL_INFO, FsoGsmCallInfoClass))

typedef struct _FsoGsmCallInfo FsoGsmCallInfo;
typedef struct _FsoGsmCallInfoClass FsoGsmCallInfoClass;

#define FSO_GSM_TYPE_PHONEBOOK_HANDLER (fso_gsm_phonebook_handler_get_type ())
#define FSO_GSM_PHONEBOOK_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_PHONEBOOK_HANDLER, FsoGsmPhonebookHandler))
#define FSO_GSM_IS_PHONEBOOK_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_PHONEBOOK_HANDLER))
#define FSO_GSM_PHONEBOOK_HANDLER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FSO_GSM_TYPE_PHONEBOOK_HANDLER, FsoGsmPhonebookHandlerIface))

typedef struct _FsoGsmPhonebookHandler FsoGsmPhonebookHandler;
typedef struct _FsoGsmPhonebookHandlerIface FsoGsmPhonebookHandlerIface;

#define FSO_GSM_TYPE_PHONEBOOK_STORAGE (fso_gsm_phonebook_storage_get_type ())
#define FSO_GSM_PHONEBOOK_STORAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_PHONEBOOK_STORAGE, FsoGsmPhonebookStorage))
#define FSO_GSM_PHONEBOOK_STORAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FSO_GSM_TYPE_PHONEBOOK_STORAGE, FsoGsmPhonebookStorageClass))
#define FSO_GSM_IS_PHONEBOOK_STORAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_PHONEBOOK_STORAGE))
#define FSO_GSM_IS_PHONEBOOK_STORAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FSO_GSM_TYPE_PHONEBOOK_STORAGE))
#define FSO_GSM_PHONEBOOK_STORAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FSO_GSM_TYPE_PHONEBOOK_STORAGE, FsoGsmPhonebookStorageClass))

typedef struct _FsoGsmPhonebookStorage FsoGsmPhonebookStorage;
typedef struct _FsoGsmPhonebookStorageClass FsoGsmPhonebookStorageClass;

#define FSO_GSM_TYPE_WATCH_DOG (fso_gsm_watch_dog_get_type ())
#define FSO_GSM_WATCH_DOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_WATCH_DOG, FsoGsmWatchDog))
#define FSO_GSM_IS_WATCH_DOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_WATCH_DOG))
#define FSO_GSM_WATCH_DOG_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FSO_GSM_TYPE_WATCH_DOG, FsoGsmWatchDogIface))

typedef struct _FsoGsmWatchDog FsoGsmWatchDog;
typedef struct _FsoGsmWatchDogIface FsoGsmWatchDogIface;

#define FSO_GSM_TYPE_IPDP_HANDLER (fso_gsm_ipdp_handler_get_type ())
#define FSO_GSM_IPDP_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_IPDP_HANDLER, FsoGsmIPdpHandler))
#define FSO_GSM_IS_IPDP_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_IPDP_HANDLER))
#define FSO_GSM_IPDP_HANDLER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), FSO_GSM_TYPE_IPDP_HANDLER, FsoGsmIPdpHandlerIface))

typedef struct _FsoGsmIPdpHandler FsoGsmIPdpHandler;
typedef struct _FsoGsmIPdpHandlerIface FsoGsmIPdpHandlerIface;

#define FSO_GSM_TYPE_ROUTE_INFO (fso_gsm_route_info_get_type ())
#define FSO_GSM_ROUTE_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FSO_GSM_TYPE_ROUTE_INFO, FsoGsmRouteInfo))
#define FSO_GSM_ROUTE_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FSO_GSM_TYPE_ROUTE_INFO, FsoGsmRouteInfoClass))
#define FSO_GSM_IS_ROUTE_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FSO_GSM_TYPE_ROUTE_INFO))
#define FSO_GSM_IS_ROUTE_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FSO_GSM_TYPE_ROUTE_INFO))
#define FSO_GSM_ROUTE_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FSO_GSM_TYPE_ROUTE_INFO, FsoGsmRouteInfoClass))

typedef struct _FsoGsmRouteInfo FsoGsmRouteInfo;
typedef struct _FsoGsmRouteInfoClass FsoGsmRouteInfoClass;
typedef struct _fso_gsm_abstract_sms_handler_simIsReadyData fso_gsm_abstract_sms_handler_simIsReadyData;
typedef struct _fso_gsm_abstract_sms_handler_syncWithSimData fso_gsm_abstract_sms_handler_syncWithSimData;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct __fso_gsm_abstract_sms_handler_handleIncomingSmsData _fso_gsm_abstract_sms_handler_handleIncomingSmsData;
#define _g_slist_free0(var) ((var == NULL) ? NULL : (var = (g_slist_free (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _wrap_hex_pdu_unref0(var) ((var == NULL) ? NULL : (var = (wrap_hex_pdu_unref (var), NULL)))
typedef struct _fso_gsm_abstract_sms_handler_handleIncomingSmsOnSimData fso_gsm_abstract_sms_handler_handleIncomingSmsOnSimData;
typedef struct _fso_gsm_abstract_sms_handler_handleIncomingSmsData fso_gsm_abstract_sms_handler_handleIncomingSmsData;
typedef struct _fso_gsm_abstract_sms_handler_handleIncomingSmsReportData fso_gsm_abstract_sms_handler_handleIncomingSmsReportData;

struct _WrapSms {
	GTypeInstance parent_instance;
	volatile int ref_count;
	WrapSmsPrivate * priv;
	struct sms* message;
	gint index;
};

struct _WrapSmsClass {
	GTypeClass parent_class;
	void (*finalize) (WrapSms *self);
};

struct _ParamSpecWrapSms {
	GParamSpec parent_instance;
};

struct _WrapHexPdu {
	GTypeInstance parent_instance;
	volatile int ref_count;
	WrapHexPduPrivate * priv;
	gchar* hexpdu;
	guint tpdulen;
	gint transaction_index;
};

struct _WrapHexPduClass {
	GTypeClass parent_class;
	void (*finalize) (WrapHexPdu *self);
};

struct _ParamSpecWrapHexPdu {
	GParamSpec parent_instance;
};

struct _FsoGsmISmsStorageIface {
	GTypeInterface parent_iface;
	void (*clean) (FsoGsmISmsStorage* self);
	gint (*addSms) (FsoGsmISmsStorage* self, struct sms* message);
	GeeArrayList* (*keys) (FsoGsmISmsStorage* self);
	void (*message) (FsoGsmISmsStorage* self, const gchar* key, gint index, FreeSmartphoneGSMSIMMessage* result);
	FreeSmartphoneGSMSIMMessage* (*messagebook) (FsoGsmISmsStorage* self, int* result_length1);
	guint16 (*lastReferenceNumber) (FsoGsmISmsStorage* self);
	guint16 (*increasingReferenceNumber) (FsoGsmISmsStorage* self);
	void (*storeTransactionIndizesForSentMessage) (FsoGsmISmsStorage* self, GeeArrayList* hexpdus);
	gint (*confirmReceivedMessage) (FsoGsmISmsStorage* self, gint netreference);
};

struct _FsoGsmSmsHandlerIface {
	GTypeInterface parent_iface;
	void (*handleIncomingSmsOnSim) (FsoGsmSmsHandler* self, guint index, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*handleIncomingSmsOnSim_finish) (FsoGsmSmsHandler* self, GAsyncResult* _res_);
	void (*handleIncomingSms) (FsoGsmSmsHandler* self, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*handleIncomingSms_finish) (FsoGsmSmsHandler* self, GAsyncResult* _res_);
	void (*handleIncomingSmsReport) (FsoGsmSmsHandler* self, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*handleIncomingSmsReport_finish) (FsoGsmSmsHandler* self, GAsyncResult* _res_);
	guint16 (*lastReferenceNumber) (FsoGsmSmsHandler* self);
	guint16 (*nextReferenceNumber) (FsoGsmSmsHandler* self);
	GeeArrayList* (*formatTextMessage) (FsoGsmSmsHandler* self, const gchar* number, const gchar* contents, gboolean requestReport);
	void (*storeTransactionIndizesForSentMessage) (FsoGsmSmsHandler* self, GeeArrayList* hexpdus);
	FsoGsmISmsStorage* (*get_storage) (FsoGsmSmsHandler* self);
	void (*set_storage) (FsoGsmSmsHandler* self, FsoGsmISmsStorage* value);
};

struct _FsoGsmNullSmsHandler {
	FsoFrameworkAbstractObject parent_instance;
	FsoGsmNullSmsHandlerPrivate * priv;
};

struct _FsoGsmNullSmsHandlerClass {
	FsoFrameworkAbstractObjectClass parent_class;
};

struct _FsoGsmNullSmsHandlerPrivate {
	FsoGsmISmsStorage* _storage;
};

struct _fso_gsm_null_sms_handler_handleIncomingSmsOnSimData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmNullSmsHandler* self;
	guint index;
};

struct _fso_gsm_null_sms_handler_handleIncomingSmsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmNullSmsHandler* self;
	gchar* hexpdu;
	gint tpdulen;
};

struct _fso_gsm_null_sms_handler_handleIncomingSmsReportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmNullSmsHandler* self;
	gchar* hexpdu;
	gint tpdulen;
};

struct _FsoGsmAbstractSmsHandler {
	FsoFrameworkAbstractObject parent_instance;
	FsoGsmAbstractSmsHandlerPrivate * priv;
};

struct _FsoGsmAbstractSmsHandlerClass {
	FsoFrameworkAbstractObjectClass parent_class;
	void (*retrieveImsiFromSIM) (FsoGsmAbstractSmsHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gchar* (*retrieveImsiFromSIM_finish) (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_);
	void (*fillStorageWithMessageFromSIM) (FsoGsmAbstractSmsHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*fillStorageWithMessageFromSIM_finish) (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_);
	void (*readSmsMessageFromSIM) (FsoGsmAbstractSmsHandler* self, guint index, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*readSmsMessageFromSIM_finish) (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_, gchar** hexpdu, gint* tpdulen);
	void (*acknowledgeSmsMessage) (FsoGsmAbstractSmsHandler* self, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*acknowledgeSmsMessage_finish) (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_);
};

struct _FsoGsmAbstractSmsHandlerPrivate {
	FsoGsmISmsStorage* _storage;
};

struct _FsoGsmChannelIface {
	GTypeInterface parent_iface;
	void (*injectResponse) (FsoGsmChannel* self, const gchar* response);
	void (*suspend) (FsoGsmChannel* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*suspend_finish) (FsoGsmChannel* self, GAsyncResult* _res_);
	void (*resume) (FsoGsmChannel* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*resume_finish) (FsoGsmChannel* self, GAsyncResult* _res_);
};

typedef enum  {
	FSO_GSM_MODEM_STATUS_UNKNOWN,
	FSO_GSM_MODEM_STATUS_CLOSED,
	FSO_GSM_MODEM_STATUS_INITIALIZING,
	FSO_GSM_MODEM_STATUS_ALIVE_NO_SIM,
	FSO_GSM_MODEM_STATUS_ALIVE_SIM_LOCKED,
	FSO_GSM_MODEM_STATUS_ALIVE_SIM_UNLOCKED,
	FSO_GSM_MODEM_STATUS_ALIVE_SIM_READY,
	FSO_GSM_MODEM_STATUS_ALIVE_REGISTERED,
	FSO_GSM_MODEM_STATUS_SUSPENDING,
	FSO_GSM_MODEM_STATUS_SUSPENDED,
	FSO_GSM_MODEM_STATUS_RESUMING,
	FSO_GSM_MODEM_STATUS_CLOSING
} FsoGsmModemStatus;

typedef enum  {
	FSO_GSM_MODEM_NETWORK_STATUS_UNKNOWN,
	FSO_GSM_MODEM_NETWORK_STATUS_UNREGISTERED,
	FSO_GSM_MODEM_NETWORK_STATUS_SEARCHING,
	FSO_GSM_MODEM_NETWORK_STATUS_REGISTERED
} FsoGsmModemNetworkStatus;

struct _FsoGsmAtCommandQueueCommandIface {
	GTypeInterface parent_iface;
	guint (*get_retry) (FsoGsmAtCommandQueueCommand* self);
	guint (*get_timeout) (FsoGsmAtCommandQueueCommand* self);
	gchar* (*get_prefix) (FsoGsmAtCommandQueueCommand* self);
	gchar* (*get_postfix) (FsoGsmAtCommandQueueCommand* self);
	gboolean (*is_valid_prefix) (FsoGsmAtCommandQueueCommand* self, const gchar* line);
};

typedef enum  {
	FSO_GSM_AT_COMMAND_ERROR_UNABLE_TO_PARSE
} FsoGsmAtCommandError;
#define FSO_GSM_AT_COMMAND_ERROR fso_gsm_at_command_error_quark ()
typedef enum  {
	FSO_GSM_CONSTANTS_AT_RESPONSE_VALID = 0,
	FSO_GSM_CONSTANTS_AT_RESPONSE_OK = 1,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CONNECT = 2,
	FSO_GSM_CONSTANTS_AT_RESPONSE_UNEXPECTED_LENGTH = 501,
	FSO_GSM_CONSTANTS_AT_RESPONSE_UNABLE_TO_PARSE = 502,
	FSO_GSM_CONSTANTS_AT_RESPONSE_ERROR = 503,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_START = 1000,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_000_PHONE_FAILURE = 1000,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_001_NO_CONNECTION_TO_PHONE = 1001,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_002_PHONE_ADAPTER_LINK_RESERVED = 1002,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_003_OPERATION_NOT_ALLOWED = 1003,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_004_OPERATION_NOT_SUPPORTED = 1004,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_005_PH_SIM_PIN_REQUIRED = 1005,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_006_PH_FSIM_PIN_REQUIRED = 1006,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_007_PH_FSIM_PUK_REQUIRED = 1007,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_010_SIM_NOT_INSERTED = 1010,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_011_SIM_PIN_REQUIRED = 1011,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_012_SIM_PUK_REQUIRED = 1012,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_013_SIM_FAILURE = 1013,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_014_SIM_BUSY = 1014,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_015_SIM_WRONG = 1015,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_016_INCORRECT_PASSWORD = 1016,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_017_SIM_PIN2_REQUIRED = 1017,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_018_SIM_PUK2_REQUIRED = 1018,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_020_MEMORY_FULL = 1020,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_021_INVALID_INDEX = 1021,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_022_NOT_FOUND = 1022,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_023_MEMORY_FAILURE = 1023,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_024_TEXT_STRING_TOO_LONG = 1024,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_025_INVALID_CHARACTERS_IN_TEXT_STRING = 1025,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_026_DIAL_STRING_TOO_LONG = 1026,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_027_INVALID_CHARACTERS_IN_DIAL_STRING = 1027,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_030_NO_NETWORK_SERVICE = 1030,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_031_NETWORK_TIMEOUT = 1031,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_032_NETWORK_NOT_ALLOWED_EMERGENCY_CALLS_ONLY = 1032,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_040_NETWORK_PERSONALIZATION_PIN_REQUIRED = 1040,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_041_NETWORK_PERSONALIZATION_PUK_REQUIRED = 1041,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_042_NETWORK_SUBSET_PERSONALIZATION_PIN_REQUIRED = 1042,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_043_NETWORK_SUBSET_PERSONALIZATION_PUK_REQUIRED = 1043,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_044_SERVICE_PROVIDER_PERSONALIZATION_PIN_REQUIRED = 1044,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_045_SERVICE_PROVIDER_PERSONALIZATION_PUK_REQUIRED = 1045,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_046_CORPORATE_PERSONALIZATION_PIN_REQUIRED = 1046,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_047_CORPORATE_PERSONALIZATION_PUK_REQUIRED = 1047,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_048_PH_SIM_PUK_REQUIRED = 1048,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_100_UNKNOWN_ERROR = 1100,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_103_GPRS_ILLEGAL_MS = 1103,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_106_GPRS_ILLEGAL_ME = 1106,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_107_GPRS_SERVICES_NOT_ALLOWED = 1107,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_111_GPRS_PLMN_NOT_ALLOWED = 1111,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_112_GPRS_LOCATION_AREA_NOT_ALLOWED = 1112,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_113_GPRS_ROAMING_NOT_ALLOWED_IN_THIS_LOCATION_AREA = 1113,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_126_GPRS_OPERATION_TEMPORARY_NOT_ALLOWED = 1126,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_132_GPRS_SERVICE_OPERATION_NOT_SUPPORTED = 1132,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_133_GPRS_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED = 1133,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_134_GPRS_SERVICE_OPTION_TEMPORARY_OUT_OF_ORDER = 1134,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_148_GPRS_UNSPECIFIED_ERROR = 1148,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_149_GPRS_PDP_AUTHENTICATION_FAILURE = 1149,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_150_GPRS_INVALID_MOBILE_CLASS = 1150,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_256_OPERATION_TEMPORARILY_NOT_ALLOWED = 1256,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_257_CALL_BARRED = 1257,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_258_PHONE_IS_BUSY = 1258,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_259_USER_ABORT = 1259,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_260_INVALID_DIAL_STRING = 1260,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_261_SS_NOT_EXECUTED = 1261,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_262_SIM_BLOCKED = 1262,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_263_INVALID_BLOCK = 1263,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_265_BUSY_TRY_AGAIN = 1265,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_512_FAILED_TO_ABORT_COMMAND = 1512,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_513_ACM_RESET_NEEDED = 1513,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_514_SIM_APPLICATION_TOOLKIT_BUSY = 1514,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CME_ERROR_772_SIM_POWERED_DOWN = 1772,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_START = 2000,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_001_UNASSIGNED_NUMBER = 2001,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_008_OPERATOR_DETERMINED_BARRING = 2008,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_010_CALL_BARED = 2010,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_021_SHORT_MESSAGE_TRANSFER_REJECTED = 2021,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_027_DESTINATION_OUT_OF_SERVICE = 2027,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_028_UNIDENTIFIED_SUBSCRIBER = 2028,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_029_FACILITY_REJECTED = 2029,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_030_UNKNOWN_SUBSCRIBER = 2030,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_038_NETWORK_OUT_OF_ORDER = 2038,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_041_TEMPORARY_FAILURE = 2041,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_042_CONGESTION = 2042,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_047_RECOURCES_UNAVAILABLE = 2047,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_050_REQUESTED_FACILITY_NOT_SUBSCRIBED = 2050,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_069_REQUESTED_FACILITY_NOT_IMPLEMENTED = 2069,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_081_INVALID_SHORT_MESSAGE_TRANSFER_REFERENCE_VALUE = 2081,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_095_INVALID_MESSAGE_UNSPECIFIED = 2095,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_096_INVALID_MANDATORY_INFORMATION = 2096,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_097_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 2097,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_098_MESSAGE_NOT_COMPATIBLE_WITH_SHORT_MESSAGE_PROTOCOL = 2098,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_099_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 2099,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_111_PROTOCOL_ERROR_UNSPECIFIED = 2111,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_127_INTERNETWORKING_UNSPECIFIED = 2127,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_128_TELEMATIC_INTERNETWORKING_NOT_SUPPORTED = 2128,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_129_SHORT_MESSAGE_TYPE_0_NOT_SUPPORTED = 2129,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_130_CANNOT_REPLACE_SHORT_MESSAGE = 2130,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_143_UNSPECIFIED_TP_PID_ERROR = 2143,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_144_DATA_CODE_SCHEME_NOT_SUPPORTED = 2144,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_145_MESSAGE_CLASS_NOT_SUPPORTED = 2145,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_159_UNSPECIFIED_TP_DCS_ERROR = 2159,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_160_COMMAND_CANNOT_BE_ACTIONED = 2160,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_161_COMMAND_UNSUPPORTED = 2161,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_175_UNSPECIFIED_TP_COMMAND_ERROR = 2175,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_176_TPDU_NOT_SUPPORTED = 2176,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_192_SC_BUSY = 2192,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_193_NO_SC_SUBSCRIPTION = 2193,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_194_SC_SYSTEM_FAILURE = 2194,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_195_INVALID_SME_ADDRESS = 2195,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_196_DESTINATION_SME_BARRED = 2196,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_197_SM_REJECTED_DUPLICATE_SM = 2197,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_198_TP_VPF_NOT_SUPPORTED = 2198,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_199_TP_VP_NOT_SUPPORTED = 2199,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_208_D0_SIM_SMS_STORAGE_FULL = 2208,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_209_NO_SMS_STORAGE_CAPABILITY_IN_SIM = 2209,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_210_ERROR_IN_MS = 2210,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_211_MEMORY_CAPACITY_EXCEEDED = 2211,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_212_SIM_APPLICATION_TOOLKIT_BUSY = 2212,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_213_SIM_DATA_DOWNLOAD_ERROR = 2213,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_255_UNSPECIFIED_ERROR_CAUSE = 2255,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_300_ME_FAILURE = 2300,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_301_SMS_SERVICE_OF_ME_RESERVED = 2301,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_302_OPERATION_NOT_ALLOWED = 2302,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_303_OPERATION_NOT_SUPPORTED = 2303,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_304_INVALID_PDU_MODE_PARAMETER = 2304,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_305_INVALID_TEXT_MODE_PARAMETER = 2305,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_310_SIM_NOT_INSERTED = 2310,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_311_SIM_PIN_REQUIRED = 2311,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_312_PH_SIM_PIN_REQUIRED = 2312,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_313_SIM_FAILURE = 2313,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_314_SIM_BUSY = 2314,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_315_SIM_WRONG = 2315,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_316_SIM_PUK_REQUIRED = 2316,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_317_SIM_PIN2_REQUIRED = 2317,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_318_SIM_PUK2_REQUIRED = 2318,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_320_MEMORY_FAILURE = 2320,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_321_INVALID_MEMORY_INDEX = 2321,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_322_MEMORY_FULL = 2322,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_330_SMSC_ADDRESS_UNKNOWN = 2330,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_331_NO_NETWORK_SERVICE = 2331,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_332_NETWORK_TIMEOUT = 2332,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_340_NO_CNMA_EXPECTED = 2340,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_500_UNKNOWN_ERROR = 2500,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_512_FAILED_TO_ABORT_COMMAND = 2512,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_513_ACM_RESET_NEEDED = 2513,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_514_INVALID_STATUS = 2514,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_515_DEVICE_BUSY_OR_INVALID_CHARACTER_IN_STRING = 2515,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_516_INVALID_LENGTH = 2516,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_517_INVALID_CHARACTER_IN_PDU = 2517,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_518_INVALID_PARAMETER = 2518,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_519_INVALID_LENGTH_OR_CHARACTER = 2519,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_520_INVALID_CHARACTER_IN_TEXT = 2520,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_521_TIMER_EXPIRED = 2521,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_522_OPERATION_TEMPORARY_NOT_ALLOWED = 2522,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_532_SIM_NOT_READY = 2532,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_534_CELL_BROADCAST_ERROR_UNKNOWN = 2534,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_535_PROTOCOL_STACK_BUSY = 2535,
	FSO_GSM_CONSTANTS_AT_RESPONSE_CMS_ERROR_538_INVALID_PARAMETER = 2538,
	FSO_GSM_CONSTANTS_AT_RESPONSE_EXT_ERROR_START = 3000,
	FSO_GSM_CONSTANTS_AT_RESPONSE_EXT_ERROR_0_INVALID_PARAMETERR = 3000
} FsoGsmConstantsAtResponse;

struct _FsoGsmAtCommandIface {
	GTypeInterface parent_iface;
	guint (*get_timeout) (FsoGsmAtCommand* self);
	guint (*get_retry) (FsoGsmAtCommand* self);
	gchar* (*get_prefix) (FsoGsmAtCommand* self);
	gchar* (*get_postfix) (FsoGsmAtCommand* self);
	gboolean (*is_valid_prefix) (FsoGsmAtCommand* self, const gchar* line);
	void (*parse) (FsoGsmAtCommand* self, const gchar* response, GError** error);
	void (*parseMulti) (FsoGsmAtCommand* self, gchar** response, int response_length1, GError** error);
	void (*parseTest) (FsoGsmAtCommand* self, const gchar* response, GError** error);
	gchar* (*encodeString) (FsoGsmAtCommand* self, const gchar* str);
	gchar* (*decodeString) (FsoGsmAtCommand* self, const gchar* str);
	FsoGsmConstantsAtResponse (*validate) (FsoGsmAtCommand* self, gchar** response, int response_length1);
	FsoGsmConstantsAtResponse (*validateTest) (FsoGsmAtCommand* self, gchar** response, int response_length1);
	FsoGsmConstantsAtResponse (*validateUrc) (FsoGsmAtCommand* self, const gchar* response);
	FsoGsmConstantsAtResponse (*validateUrcPdu) (FsoGsmAtCommand* self, gchar** response, int response_length1);
	FsoGsmConstantsAtResponse (*validateOk) (FsoGsmAtCommand* self, gchar** response, int response_length1);
	FsoGsmConstantsAtResponse (*validateMulti) (FsoGsmAtCommand* self, gchar** response, int response_length1);
};

struct _FsoGsmCallHandlerIface {
	GTypeInterface parent_iface;
	void (*handleIncomingCall) (FsoGsmCallHandler* self, FsoGsmCallInfo* call_info);
	void (*handleConnectingCall) (FsoGsmCallHandler* self, FsoGsmCallInfo* call_info);
	void (*handleEndingCall) (FsoGsmCallHandler* self, FsoGsmCallInfo* call_info);
	void (*addSupplementaryInformation) (FsoGsmCallHandler* self, const gchar* direction, const gchar* info);
	void (*activate) (FsoGsmCallHandler* self, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*activate_finish) (FsoGsmCallHandler* self, GAsyncResult* _res_, GError** error);
	void (*initiate) (FsoGsmCallHandler* self, const gchar* number, const gchar* ctype, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gint (*initiate_finish) (FsoGsmCallHandler* self, GAsyncResult* _res_, GError** error);
	void (*hold) (FsoGsmCallHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*hold_finish) (FsoGsmCallHandler* self, GAsyncResult* _res_, GError** error);
	void (*release) (FsoGsmCallHandler* self, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*release_finish) (FsoGsmCallHandler* self, GAsyncResult* _res_, GError** error);
	void (*releaseAll) (FsoGsmCallHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*releaseAll_finish) (FsoGsmCallHandler* self, GAsyncResult* _res_, GError** error);
};

struct _FsoGsmPhonebookHandlerIface {
	GTypeInterface parent_iface;
	void (*syncWithSim) (FsoGsmPhonebookHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*syncWithSim_finish) (FsoGsmPhonebookHandler* self, GAsyncResult* _res_);
	FsoGsmPhonebookStorage* (*get_storage) (FsoGsmPhonebookHandler* self);
	void (*set_storage) (FsoGsmPhonebookHandler* self, FsoGsmPhonebookStorage* value);
};

struct _FsoGsmWatchDogIface {
	GTypeInterface parent_iface;
	void (*check) (FsoGsmWatchDog* self);
	void (*resetUnlockMarker) (FsoGsmWatchDog* self);
};

struct _FsoGsmIPdpHandlerIface {
	GTypeInterface parent_iface;
	void (*activate) (FsoGsmIPdpHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*activate_finish) (FsoGsmIPdpHandler* self, GAsyncResult* _res_, GError** error);
	void (*deactivate) (FsoGsmIPdpHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*deactivate_finish) (FsoGsmIPdpHandler* self, GAsyncResult* _res_, GError** error);
	void (*statusUpdate) (FsoGsmIPdpHandler* self, const gchar* status, GHashTable* properties, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*statusUpdate_finish) (FsoGsmIPdpHandler* self, GAsyncResult* _res_);
	void (*connectedWithNewDefaultRoute) (FsoGsmIPdpHandler* self, FsoGsmRouteInfo* route, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*connectedWithNewDefaultRoute_finish) (FsoGsmIPdpHandler* self, GAsyncResult* _res_);
	void (*disconnected) (FsoGsmIPdpHandler* self);
	void (*syncStatus) (FsoGsmIPdpHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*syncStatus_finish) (FsoGsmIPdpHandler* self, GAsyncResult* _res_);
	FreeSmartphoneGSMContextStatus (*get_status) (FsoGsmIPdpHandler* self);
	void (*set_status) (FsoGsmIPdpHandler* self, FreeSmartphoneGSMContextStatus value);
	GHashTable* (*get_properties) (FsoGsmIPdpHandler* self);
	void (*set_properties) (FsoGsmIPdpHandler* self, GHashTable* value);
};

struct _FsoGsmModemIface {
	GTypeInterface parent_iface;
	void (*open) (FsoGsmModem* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*open_finish) (FsoGsmModem* self, GAsyncResult* _res_);
	void (*close) (FsoGsmModem* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*close_finish) (FsoGsmModem* self, GAsyncResult* _res_);
	void (*suspend) (FsoGsmModem* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*suspend_finish) (FsoGsmModem* self, GAsyncResult* _res_);
	void (*resume) (FsoGsmModem* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*resume_finish) (FsoGsmModem* self, GAsyncResult* _res_);
	void (*injectResponse) (FsoGsmModem* self, const gchar* command, const gchar* channel, GError** error);
	void (*setFunctionality) (FsoGsmModem* self, const gchar* level, gboolean autoregister, const gchar* pin, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*setFunctionality_finish) (FsoGsmModem* self, GAsyncResult* _res_, GError** error);
	void (*registerChannel) (FsoGsmModem* self, const gchar* name, FsoGsmChannel* channel);
	void (*advanceToState) (FsoGsmModem* self, FsoGsmModemStatus status, gboolean force);
	void (*advanceNetworkState) (FsoGsmModem* self, FsoGsmModemNetworkStatus status);
	FsoGsmAtCommandSequence* (*atCommandSequence) (FsoGsmModem* self, const gchar* channel, const gchar* purpose);
	gpointer (*createMediator) (FsoGsmModem* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, GError** error);
	gpointer (*createAtCommand) (FsoGsmModem* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, const gchar* command);
	gpointer (*theDevice) (FsoGsmModem* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func);
	gchar* (*allocateDataPort) (FsoGsmModem* self);
	void (*releaseDataPort) (FsoGsmModem* self);
	void (*processAtCommandAsync) (FsoGsmModem* self, FsoGsmAtCommand* command, const gchar* request, gint retries, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gchar** (*processAtCommandAsync_finish) (FsoGsmModem* self, GAsyncResult* _res_, int* result_length1);
	void (*processAtPduCommandAsync) (FsoGsmModem* self, FsoGsmAtCommand* command, const gchar* request, gint retries, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gchar** (*processAtPduCommandAsync_finish) (FsoGsmModem* self, GAsyncResult* _res_, int* result_length1);
	void (*sendAtCommand) (FsoGsmModem* self, FsoGsmAtCommand* command, const gchar* request, gint retries);
	FsoGsmChannel* (*channel) (FsoGsmModem* self, const gchar* category);
	FsoGsmModemStatus (*status) (FsoGsmModem* self);
	FsoGsmModemNetworkStatus (*network_status) (FsoGsmModem* self);
	FreeSmartphoneGSMDeviceStatus (*externalStatus) (FsoGsmModem* self);
	FsoGsmModemData* (*data) (FsoGsmModem* self);
	void (*registerAtCommandSequence) (FsoGsmModem* self, const gchar* channel, const gchar* purpose, FsoGsmAtCommandSequence* sequence);
	gboolean (*isAlive) (FsoGsmModem* self);
	GObject* (*get_parent) (FsoGsmModem* self);
	void (*set_parent) (FsoGsmModem* self, GObject* value);
	FsoGsmCallHandler* (*get_callhandler) (FsoGsmModem* self);
	void (*set_callhandler) (FsoGsmModem* self, FsoGsmCallHandler* value);
	FsoGsmSmsHandler* (*get_smshandler) (FsoGsmModem* self);
	void (*set_smshandler) (FsoGsmModem* self, FsoGsmSmsHandler* value);
	FsoGsmPhonebookHandler* (*get_pbhandler) (FsoGsmModem* self);
	void (*set_pbhandler) (FsoGsmModem* self, FsoGsmPhonebookHandler* value);
	FsoGsmWatchDog* (*get_watchdog) (FsoGsmModem* self);
	void (*set_watchdog) (FsoGsmModem* self, FsoGsmWatchDog* value);
	FsoGsmIPdpHandler* (*get_pdphandler) (FsoGsmModem* self);
	void (*set_pdphandler) (FsoGsmModem* self, FsoGsmIPdpHandler* value);
};

struct _fso_gsm_abstract_sms_handler_simIsReadyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmAbstractSmsHandler* self;
};

struct _fso_gsm_abstract_sms_handler_syncWithSimData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmAbstractSmsHandler* self;
	FsoGsmISmsStorage* _tmp0_;
	FsoGsmISmsStorage* _tmp1_;
	FsoFrameworkLogger* _tmp2_;
	gboolean _tmp3_;
	gchar* _tmp4_;
	gchar* imsi;
	gboolean _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gboolean _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	FsoGsmISmsStorage* _tmp11_;
	FsoGsmISmsStorage* _tmp12_;
};

struct __fso_gsm_abstract_sms_handler_handleIncomingSmsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmAbstractSmsHandler* self;
	gchar* hexpdu;
	gint tpdulen;
	const gchar* _tmp0_;
	gint _tmp1_;
	struct sms* _tmp2_;
	struct sms* sms;
	struct sms* _tmp3_;
	FsoFrameworkLogger* _tmp4_;
	FsoGsmISmsStorage* _tmp5_;
	FsoGsmISmsStorage* _tmp6_;
	struct sms* _tmp7_;
	gint _tmp8_;
	gint _result_;
	gint _tmp9_;
	FsoFrameworkLogger* _tmp10_;
	gint _tmp11_;
	FsoFrameworkLogger* _tmp12_;
	FsoFrameworkLogger* _tmp13_;
	struct sms* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	FsoGsmISmsStorage* _tmp20_;
	FsoGsmISmsStorage* _tmp21_;
	struct sms* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	FreeSmartphoneGSMSIMMessage _tmp25_;
	FreeSmartphoneGSMSIMMessage _tmp26_;
	FreeSmartphoneGSMSIMMessage msg;
	FsoGsmModem* _tmp27_;
	gpointer _tmp28_;
	FreeSmartphoneGSMSMS* obj;
	FreeSmartphoneGSMSMS* _tmp29_;
	FreeSmartphoneGSMSIMMessage _tmp30_;
	const gchar* _tmp31_;
	FreeSmartphoneGSMSIMMessage _tmp32_;
	const gchar* _tmp33_;
	FreeSmartphoneGSMSIMMessage _tmp34_;
	const gchar* _tmp35_;
};

struct _Block1Data {
	int _ref_count_;
	FsoGsmAbstractSmsHandler * self;
	GeeArrayList* hexpdus;
	gchar* number;
	gboolean requestReport;
};

struct _fso_gsm_abstract_sms_handler_handleIncomingSmsOnSimData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmAbstractSmsHandler* self;
	guint index;
	gchar* _tmp0_;
	gchar* hexpdu;
	gint tpdulen;
	guint _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	gboolean _tmp4_;
	gboolean _result_;
	gboolean _tmp5_;
	FsoFrameworkLogger* _tmp6_;
	guint _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	gint _tmp13_;
};

struct _fso_gsm_abstract_sms_handler_handleIncomingSmsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmAbstractSmsHandler* self;
	gchar* hexpdu;
	gint tpdulen;
	gboolean _tmp0_;
	gboolean _result_;
	gboolean _tmp1_;
	FsoFrameworkLogger* _tmp2_;
	const gchar* _tmp3_;
	gint _tmp4_;
};

struct _fso_gsm_abstract_sms_handler_handleIncomingSmsReportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	FsoGsmAbstractSmsHandler* self;
	gchar* hexpdu;
	gint tpdulen;
	const gchar* _tmp0_;
	gint _tmp1_;
	struct sms* _tmp2_;
	struct sms* sms;
	struct sms* _tmp3_;
	FsoFrameworkLogger* _tmp4_;
	struct sms* _tmp5_;
	struct sms* _tmp6_;
};


static gpointer wrap_sms_parent_class = NULL;
static gpointer wrap_hex_pdu_parent_class = NULL;
static gpointer fso_gsm_null_sms_handler_parent_class = NULL;
static FsoGsmSmsHandlerIface* fso_gsm_null_sms_handler_fso_gsm_sms_handler_parent_iface = NULL;
static gpointer fso_gsm_abstract_sms_handler_parent_class = NULL;
extern FsoGsmModem* fso_gsm_theModem;
static FsoGsmSmsHandlerIface* fso_gsm_abstract_sms_handler_fso_gsm_sms_handler_parent_iface = NULL;

gpointer wrap_sms_ref (gpointer instance);
void wrap_sms_unref (gpointer instance);
GParamSpec* param_spec_wrap_sms (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_wrap_sms (GValue* value, gpointer v_object);
void value_take_wrap_sms (GValue* value, gpointer v_object);
gpointer value_get_wrap_sms (const GValue* value);
GType wrap_sms_get_type (void) G_GNUC_CONST;
enum  {
	WRAP_SMS_DUMMY_PROPERTY
};
WrapSms* wrap_sms_new (struct sms* message, gint index);
WrapSms* wrap_sms_construct (GType object_type, struct sms* message, gint index);
static void wrap_sms_finalize (WrapSms* obj);
gpointer wrap_hex_pdu_ref (gpointer instance);
void wrap_hex_pdu_unref (gpointer instance);
GParamSpec* param_spec_wrap_hex_pdu (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_wrap_hex_pdu (GValue* value, gpointer v_object);
void value_take_wrap_hex_pdu (GValue* value, gpointer v_object);
gpointer value_get_wrap_hex_pdu (const GValue* value);
GType wrap_hex_pdu_get_type (void) G_GNUC_CONST;
enum  {
	WRAP_HEX_PDU_DUMMY_PROPERTY
};
WrapHexPdu* wrap_hex_pdu_new (const gchar* hexpdu, guint tpdulen);
WrapHexPdu* wrap_hex_pdu_construct (GType object_type, const gchar* hexpdu, guint tpdulen);
static void wrap_hex_pdu_finalize (WrapHexPdu* obj);
GType fso_gsm_isms_storage_get_type (void) G_GNUC_CONST;
GType fso_gsm_sms_handler_get_type (void) G_GNUC_CONST;
void fso_gsm_sms_handler_handleIncomingSmsOnSim (FsoGsmSmsHandler* self, guint index, GAsyncReadyCallback _callback_, gpointer _user_data_);
void fso_gsm_sms_handler_handleIncomingSmsOnSim_finish (FsoGsmSmsHandler* self, GAsyncResult* _res_);
void fso_gsm_sms_handler_handleIncomingSms (FsoGsmSmsHandler* self, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_);
void fso_gsm_sms_handler_handleIncomingSms_finish (FsoGsmSmsHandler* self, GAsyncResult* _res_);
void fso_gsm_sms_handler_handleIncomingSmsReport (FsoGsmSmsHandler* self, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_);
void fso_gsm_sms_handler_handleIncomingSmsReport_finish (FsoGsmSmsHandler* self, GAsyncResult* _res_);
guint16 fso_gsm_sms_handler_lastReferenceNumber (FsoGsmSmsHandler* self);
guint16 fso_gsm_sms_handler_nextReferenceNumber (FsoGsmSmsHandler* self);
GeeArrayList* fso_gsm_sms_handler_formatTextMessage (FsoGsmSmsHandler* self, const gchar* number, const gchar* contents, gboolean requestReport);
void fso_gsm_sms_handler_storeTransactionIndizesForSentMessage (FsoGsmSmsHandler* self, GeeArrayList* hexpdus);
FsoGsmISmsStorage* fso_gsm_sms_handler_get_storage (FsoGsmSmsHandler* self);
void fso_gsm_sms_handler_set_storage (FsoGsmSmsHandler* self, FsoGsmISmsStorage* value);
GType fso_gsm_null_sms_handler_get_type (void) G_GNUC_CONST;
#define FSO_GSM_NULL_SMS_HANDLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), FSO_GSM_TYPE_NULL_SMS_HANDLER, FsoGsmNullSmsHandlerPrivate))
enum  {
	FSO_GSM_NULL_SMS_HANDLER_DUMMY_PROPERTY,
	FSO_GSM_NULL_SMS_HANDLER_STORAGE
};
FsoGsmNullSmsHandler* fso_gsm_null_sms_handler_new (void);
FsoGsmNullSmsHandler* fso_gsm_null_sms_handler_construct (GType object_type);
FsoGsmISmsStorage* fso_gsm_sms_storage_factory_create (const gchar* type, const gchar* imsi);
static void fso_gsm_null_sms_handler_real_handleIncomingSmsOnSim_data_free (gpointer _data);
static void fso_gsm_null_sms_handler_real_handleIncomingSmsOnSim (FsoGsmSmsHandler* base, guint index, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_null_sms_handler_real_handleIncomingSmsOnSim_co (fso_gsm_null_sms_handler_handleIncomingSmsOnSimData* _data_);
static void fso_gsm_null_sms_handler_real_handleIncomingSms_data_free (gpointer _data);
static void fso_gsm_null_sms_handler_real_handleIncomingSms (FsoGsmSmsHandler* base, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_null_sms_handler_real_handleIncomingSms_co (fso_gsm_null_sms_handler_handleIncomingSmsData* _data_);
static void fso_gsm_null_sms_handler_real_handleIncomingSmsReport_data_free (gpointer _data);
static void fso_gsm_null_sms_handler_real_handleIncomingSmsReport (FsoGsmSmsHandler* base, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_null_sms_handler_real_handleIncomingSmsReport_co (fso_gsm_null_sms_handler_handleIncomingSmsReportData* _data_);
static guint16 fso_gsm_null_sms_handler_real_lastReferenceNumber (FsoGsmSmsHandler* base);
guint16 fso_gsm_isms_storage_lastReferenceNumber (FsoGsmISmsStorage* self);
static guint16 fso_gsm_null_sms_handler_real_nextReferenceNumber (FsoGsmSmsHandler* base);
guint16 fso_gsm_isms_storage_increasingReferenceNumber (FsoGsmISmsStorage* self);
static GeeArrayList* fso_gsm_null_sms_handler_real_formatTextMessage (FsoGsmSmsHandler* base, const gchar* number, const gchar* contents, gboolean requestReport);
static void fso_gsm_null_sms_handler_real_storeTransactionIndizesForSentMessage (FsoGsmSmsHandler* base, GeeArrayList* hexpdus);
static gchar* fso_gsm_null_sms_handler_real_repr (FsoFrameworkAbstractObject* base);
static void fso_gsm_null_sms_handler_finalize (GObject* obj);
static void _vala_fso_gsm_null_sms_handler_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_fso_gsm_null_sms_handler_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType fso_gsm_abstract_sms_handler_get_type (void) G_GNUC_CONST;
#define FSO_GSM_ABSTRACT_SMS_HANDLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), FSO_GSM_TYPE_ABSTRACT_SMS_HANDLER, FsoGsmAbstractSmsHandlerPrivate))
enum  {
	FSO_GSM_ABSTRACT_SMS_HANDLER_DUMMY_PROPERTY,
	FSO_GSM_ABSTRACT_SMS_HANDLER_STORAGE
};
void fso_gsm_abstract_sms_handler_retrieveImsiFromSIM (FsoGsmAbstractSmsHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
gchar* fso_gsm_abstract_sms_handler_retrieveImsiFromSIM_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_);
void fso_gsm_abstract_sms_handler_fillStorageWithMessageFromSIM (FsoGsmAbstractSmsHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void fso_gsm_abstract_sms_handler_fillStorageWithMessageFromSIM_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_);
void fso_gsm_abstract_sms_handler_readSmsMessageFromSIM (FsoGsmAbstractSmsHandler* self, guint index, GAsyncReadyCallback _callback_, gpointer _user_data_);
gboolean fso_gsm_abstract_sms_handler_readSmsMessageFromSIM_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_, gchar** hexpdu, gint* tpdulen);
void fso_gsm_abstract_sms_handler_acknowledgeSmsMessage (FsoGsmAbstractSmsHandler* self, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_);
gboolean fso_gsm_abstract_sms_handler_acknowledgeSmsMessage_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_);
GType fso_gsm_channel_get_type (void) G_GNUC_CONST;
GType fso_gsm_modem_status_get_type (void) G_GNUC_CONST;
GType fso_gsm_modem_network_status_get_type (void) G_GNUC_CONST;
gpointer fso_gsm_at_command_sequence_ref (gpointer instance);
void fso_gsm_at_command_sequence_unref (gpointer instance);
GParamSpec* fso_gsm_param_spec_at_command_sequence (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void fso_gsm_value_set_at_command_sequence (GValue* value, gpointer v_object);
void fso_gsm_value_take_at_command_sequence (GValue* value, gpointer v_object);
gpointer fso_gsm_value_get_at_command_sequence (const GValue* value);
GType fso_gsm_at_command_sequence_get_type (void) G_GNUC_CONST;
GType fso_gsm_at_command_queue_command_get_type (void) G_GNUC_CONST;
GQuark fso_gsm_at_command_error_quark (void);
GType fso_gsm_constants_at_response_get_type (void) G_GNUC_CONST;
GType fso_gsm_at_command_get_type (void) G_GNUC_CONST;
GType fso_gsm_modem_data_get_type (void) G_GNUC_CONST;
GType fso_gsm_call_info_get_type (void) G_GNUC_CONST;
GType fso_gsm_call_handler_get_type (void) G_GNUC_CONST;
GType fso_gsm_phonebook_storage_get_type (void) G_GNUC_CONST;
GType fso_gsm_phonebook_handler_get_type (void) G_GNUC_CONST;
GType fso_gsm_watch_dog_get_type (void) G_GNUC_CONST;
gpointer fso_gsm_route_info_ref (gpointer instance);
void fso_gsm_route_info_unref (gpointer instance);
GParamSpec* fso_gsm_param_spec_route_info (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void fso_gsm_value_set_route_info (GValue* value, gpointer v_object);
void fso_gsm_value_take_route_info (GValue* value, gpointer v_object);
gpointer fso_gsm_value_get_route_info (const GValue* value);
GType fso_gsm_route_info_get_type (void) G_GNUC_CONST;
GType fso_gsm_ipdp_handler_get_type (void) G_GNUC_CONST;
GType fso_gsm_modem_get_type (void) G_GNUC_CONST;
static void fso_gsm_abstract_sms_handler_onModemStatusChanged (FsoGsmAbstractSmsHandler* self, FsoGsmModem* modem, FsoGsmModemStatus status);
static void fso_gsm_abstract_sms_handler_simIsReady (FsoGsmAbstractSmsHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void fso_gsm_abstract_sms_handler_simIsReady_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_);
static void fso_gsm_abstract_sms_handler_simIsReady_data_free (gpointer _data);
static gboolean fso_gsm_abstract_sms_handler_simIsReady_co (fso_gsm_abstract_sms_handler_simIsReadyData* _data_);
void fso_gsm_abstract_sms_handler_syncWithSim (FsoGsmAbstractSmsHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void fso_gsm_abstract_sms_handler_syncWithSim_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_);
static void fso_gsm_abstract_sms_handler_simIsReady_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void fso_gsm_abstract_sms_handler_syncWithSim_data_free (gpointer _data);
static gboolean fso_gsm_abstract_sms_handler_syncWithSim_co (fso_gsm_abstract_sms_handler_syncWithSimData* _data_);
static void fso_gsm_abstract_sms_handler_syncWithSim_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _fso_gsm_abstract_sms_handler_handleIncomingSms_data_free (gpointer _data);
static void _fso_gsm_abstract_sms_handler_handleIncomingSms (FsoGsmAbstractSmsHandler* self, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void _fso_gsm_abstract_sms_handler_handleIncomingSms_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_);
static gboolean _fso_gsm_abstract_sms_handler_handleIncomingSms_co (_fso_gsm_abstract_sms_handler_handleIncomingSmsData* _data_);
gint fso_gsm_isms_storage_addSms (FsoGsmISmsStorage* self, struct sms* message);
#define FSO_GSM_SMS_STORAGE_SMS_ALREADY_SEEN (-1)
#define FSO_GSM_SMS_STORAGE_SMS_MULTI_INCOMPLETE 0
void fso_gsm_isms_storage_message (FsoGsmISmsStorage* self, const gchar* key, gint index, FreeSmartphoneGSMSIMMessage* result);
gpointer fso_gsm_modem_theDevice (FsoGsmModem* self, GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func);
static void _fso_gsm_abstract_sms_handler_handleIncomingSmsReport (FsoGsmAbstractSmsHandler* self, struct sms* sms);
gint fso_gsm_isms_storage_confirmReceivedMessage (FsoGsmISmsStorage* self, gint netreference);
const gchar* sms_status_to_string (int self);
static const char* _sms_status_to_string (int value);
FsoGsmAbstractSmsHandler* fso_gsm_abstract_sms_handler_construct (GType object_type);
static void _fso_gsm_abstract_sms_handler_onModemStatusChanged_fso_gsm_modem_signal_status_changed (FsoGsmModem* _sender, FsoGsmModemStatus status, gpointer self);
static guint16 fso_gsm_abstract_sms_handler_real_lastReferenceNumber (FsoGsmSmsHandler* base);
static guint16 fso_gsm_abstract_sms_handler_real_nextReferenceNumber (FsoGsmSmsHandler* base);
static GeeArrayList* fso_gsm_abstract_sms_handler_real_formatTextMessage (FsoGsmSmsHandler* base, const gchar* number, const gchar* contents, gboolean requestReport);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (Block1Data* _data1_);
static void __lambda3_ (Block1Data* _data1_, struct sms* element);
static void ___lambda3__gfunc (gconstpointer data, gpointer self);
static void fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim_data_free (gpointer _data);
static void fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim (FsoGsmSmsHandler* base, guint index, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim_co (fso_gsm_abstract_sms_handler_handleIncomingSmsOnSimData* _data_);
static void fso_gsm_abstract_sms_handler_handleIncomingSmsOnSim_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void fso_gsm_abstract_sms_handler_real_handleIncomingSms_data_free (gpointer _data);
static void fso_gsm_abstract_sms_handler_real_handleIncomingSms (FsoGsmSmsHandler* base, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_abstract_sms_handler_real_handleIncomingSms_co (fso_gsm_abstract_sms_handler_handleIncomingSmsData* _data_);
static void fso_gsm_abstract_sms_handler_handleIncomingSms_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport_data_free (gpointer _data);
static void fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport (FsoGsmSmsHandler* base, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport_co (fso_gsm_abstract_sms_handler_handleIncomingSmsReportData* _data_);
static void fso_gsm_abstract_sms_handler_real_storeTransactionIndizesForSentMessage (FsoGsmSmsHandler* base, GeeArrayList* hexpdus);
void fso_gsm_isms_storage_storeTransactionIndizesForSentMessage (FsoGsmISmsStorage* self, GeeArrayList* hexpdus);
static void fso_gsm_abstract_sms_handler_finalize (GObject* obj);
static void _vala_fso_gsm_abstract_sms_handler_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_fso_gsm_abstract_sms_handler_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


WrapSms* wrap_sms_construct (GType object_type, struct sms* message, gint index) {
	WrapSms* self = NULL;
	gint _tmp0_;
	struct sms* _tmp1_;
	struct sms* _tmp2_;
	enum sms_type _tmp3_;
	g_return_val_if_fail (message != NULL, NULL);
	self = (WrapSms*) g_type_create_instance (object_type);
	_tmp0_ = index;
	self->index = _tmp0_;
	_tmp1_ = message;
	message = NULL;
	_sms_free0 (self->message);
	self->message = _tmp1_;
	_tmp2_ = self->message;
	_tmp3_ = _tmp2_->type;
	if (_tmp3_ == SMS_TYPE_DELIVER) {
	} else {
		FsoFrameworkLogger* _tmp4_;
		struct sms* _tmp5_;
		enum sms_type _tmp6_;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_;
		_tmp4_ = fso_framework_theLogger;
		_tmp5_ = self->message;
		_tmp6_ = _tmp5_->type;
		_tmp7_ = g_strdup_printf ("SMS type %d not yet supported", (gint) _tmp6_);
		_tmp8_ = _tmp7_;
		fso_framework_logger_warning (_tmp4_, _tmp8_);
		_g_free0 (_tmp8_);
	}
	_sms_free0 (message);
	return self;
}


WrapSms* wrap_sms_new (struct sms* message, gint index) {
	return wrap_sms_construct (TYPE_WRAP_SMS, message, index);
}


static void value_wrap_sms_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void value_wrap_sms_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		wrap_sms_unref (value->data[0].v_pointer);
	}
}


static void value_wrap_sms_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = wrap_sms_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer value_wrap_sms_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* value_wrap_sms_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		WrapSms* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = wrap_sms_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* value_wrap_sms_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	WrapSms** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = wrap_sms_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* param_spec_wrap_sms (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecWrapSms* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_WRAP_SMS), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer value_get_wrap_sms (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_WRAP_SMS), NULL);
	return value->data[0].v_pointer;
}


void value_set_wrap_sms (GValue* value, gpointer v_object) {
	WrapSms* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_WRAP_SMS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_WRAP_SMS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		wrap_sms_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		wrap_sms_unref (old);
	}
}


void value_take_wrap_sms (GValue* value, gpointer v_object) {
	WrapSms* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_WRAP_SMS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_WRAP_SMS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		wrap_sms_unref (old);
	}
}


static void wrap_sms_class_init (WrapSmsClass * klass) {
	wrap_sms_parent_class = g_type_class_peek_parent (klass);
	WRAP_SMS_CLASS (klass)->finalize = wrap_sms_finalize;
}


static void wrap_sms_instance_init (WrapSms * self) {
	self->ref_count = 1;
}


static void wrap_sms_finalize (WrapSms* obj) {
	WrapSms * self;
	struct sms* _tmp0_;
	enum sms_type _tmp1_;
	self = WRAP_SMS (obj);
	_tmp0_ = self->message;
	_tmp1_ = _tmp0_->type;
	if (_tmp1_ == SMS_TYPE_DELIVER) {
	}
	_sms_free0 (self->message);
}


/**
 * @class WrapSms
 *
 * A helper class
 */
GType wrap_sms_get_type (void) {
	static volatile gsize wrap_sms_type_id__volatile = 0;
	if (g_once_init_enter (&wrap_sms_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_wrap_sms_init, value_wrap_sms_free_value, value_wrap_sms_copy_value, value_wrap_sms_peek_pointer, "p", value_wrap_sms_collect_value, "p", value_wrap_sms_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (WrapSmsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wrap_sms_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WrapSms), 0, (GInstanceInitFunc) wrap_sms_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType wrap_sms_type_id;
		wrap_sms_type_id = g_type_register_fundamental (g_type_fundamental_next (), "WrapSms", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&wrap_sms_type_id__volatile, wrap_sms_type_id);
	}
	return wrap_sms_type_id__volatile;
}


gpointer wrap_sms_ref (gpointer instance) {
	WrapSms* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void wrap_sms_unref (gpointer instance) {
	WrapSms* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		WRAP_SMS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


WrapHexPdu* wrap_hex_pdu_construct (GType object_type, const gchar* hexpdu, guint tpdulen) {
	WrapHexPdu* self = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	guint _tmp2_;
	g_return_val_if_fail (hexpdu != NULL, NULL);
	self = (WrapHexPdu*) g_type_create_instance (object_type);
	_tmp0_ = hexpdu;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->hexpdu);
	self->hexpdu = _tmp1_;
	_tmp2_ = tpdulen;
	self->tpdulen = _tmp2_;
	self->transaction_index = -1;
	return self;
}


WrapHexPdu* wrap_hex_pdu_new (const gchar* hexpdu, guint tpdulen) {
	return wrap_hex_pdu_construct (TYPE_WRAP_HEX_PDU, hexpdu, tpdulen);
}


static void value_wrap_hex_pdu_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void value_wrap_hex_pdu_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		wrap_hex_pdu_unref (value->data[0].v_pointer);
	}
}


static void value_wrap_hex_pdu_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = wrap_hex_pdu_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer value_wrap_hex_pdu_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* value_wrap_hex_pdu_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		WrapHexPdu* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = wrap_hex_pdu_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* value_wrap_hex_pdu_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	WrapHexPdu** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = wrap_hex_pdu_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* param_spec_wrap_hex_pdu (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecWrapHexPdu* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_WRAP_HEX_PDU), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer value_get_wrap_hex_pdu (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_WRAP_HEX_PDU), NULL);
	return value->data[0].v_pointer;
}


void value_set_wrap_hex_pdu (GValue* value, gpointer v_object) {
	WrapHexPdu* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_WRAP_HEX_PDU));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_WRAP_HEX_PDU));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		wrap_hex_pdu_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		wrap_hex_pdu_unref (old);
	}
}


void value_take_wrap_hex_pdu (GValue* value, gpointer v_object) {
	WrapHexPdu* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_WRAP_HEX_PDU));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_WRAP_HEX_PDU));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		wrap_hex_pdu_unref (old);
	}
}


static void wrap_hex_pdu_class_init (WrapHexPduClass * klass) {
	wrap_hex_pdu_parent_class = g_type_class_peek_parent (klass);
	WRAP_HEX_PDU_CLASS (klass)->finalize = wrap_hex_pdu_finalize;
}


static void wrap_hex_pdu_instance_init (WrapHexPdu * self) {
	self->ref_count = 1;
}


static void wrap_hex_pdu_finalize (WrapHexPdu* obj) {
	WrapHexPdu * self;
	self = WRAP_HEX_PDU (obj);
	_g_free0 (self->hexpdu);
}


/**
 * @class WrapHexPdu
 *
 * A helper class
 */
GType wrap_hex_pdu_get_type (void) {
	static volatile gsize wrap_hex_pdu_type_id__volatile = 0;
	if (g_once_init_enter (&wrap_hex_pdu_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_wrap_hex_pdu_init, value_wrap_hex_pdu_free_value, value_wrap_hex_pdu_copy_value, value_wrap_hex_pdu_peek_pointer, "p", value_wrap_hex_pdu_collect_value, "p", value_wrap_hex_pdu_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (WrapHexPduClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wrap_hex_pdu_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WrapHexPdu), 0, (GInstanceInitFunc) wrap_hex_pdu_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType wrap_hex_pdu_type_id;
		wrap_hex_pdu_type_id = g_type_register_fundamental (g_type_fundamental_next (), "WrapHexPdu", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&wrap_hex_pdu_type_id__volatile, wrap_hex_pdu_type_id);
	}
	return wrap_hex_pdu_type_id__volatile;
}


gpointer wrap_hex_pdu_ref (gpointer instance) {
	WrapHexPdu* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void wrap_hex_pdu_unref (gpointer instance) {
	WrapHexPdu* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		WRAP_HEX_PDU_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


void fso_gsm_sms_handler_handleIncomingSmsOnSim (FsoGsmSmsHandler* self, guint index, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->handleIncomingSmsOnSim (self, index, _callback_, _user_data_);
}


void fso_gsm_sms_handler_handleIncomingSmsOnSim_finish (FsoGsmSmsHandler* self, GAsyncResult* _res_) {
	FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->handleIncomingSmsOnSim_finish (self, _res_);
}


void fso_gsm_sms_handler_handleIncomingSms (FsoGsmSmsHandler* self, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->handleIncomingSms (self, hexpdu, tpdulen, _callback_, _user_data_);
}


void fso_gsm_sms_handler_handleIncomingSms_finish (FsoGsmSmsHandler* self, GAsyncResult* _res_) {
	FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->handleIncomingSms_finish (self, _res_);
}


void fso_gsm_sms_handler_handleIncomingSmsReport (FsoGsmSmsHandler* self, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->handleIncomingSmsReport (self, hexpdu, tpdulen, _callback_, _user_data_);
}


void fso_gsm_sms_handler_handleIncomingSmsReport_finish (FsoGsmSmsHandler* self, GAsyncResult* _res_) {
	FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->handleIncomingSmsReport_finish (self, _res_);
}


guint16 fso_gsm_sms_handler_lastReferenceNumber (FsoGsmSmsHandler* self) {
	g_return_val_if_fail (self != NULL, 0U);
	return FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->lastReferenceNumber (self);
}


guint16 fso_gsm_sms_handler_nextReferenceNumber (FsoGsmSmsHandler* self) {
	g_return_val_if_fail (self != NULL, 0U);
	return FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->nextReferenceNumber (self);
}


GeeArrayList* fso_gsm_sms_handler_formatTextMessage (FsoGsmSmsHandler* self, const gchar* number, const gchar* contents, gboolean requestReport) {
	g_return_val_if_fail (self != NULL, NULL);
	return FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->formatTextMessage (self, number, contents, requestReport);
}


void fso_gsm_sms_handler_storeTransactionIndizesForSentMessage (FsoGsmSmsHandler* self, GeeArrayList* hexpdus) {
	g_return_if_fail (self != NULL);
	FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->storeTransactionIndizesForSentMessage (self, hexpdus);
}


FsoGsmISmsStorage* fso_gsm_sms_handler_get_storage (FsoGsmSmsHandler* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->get_storage (self);
}


void fso_gsm_sms_handler_set_storage (FsoGsmSmsHandler* self, FsoGsmISmsStorage* value) {
	g_return_if_fail (self != NULL);
	FSO_GSM_SMS_HANDLER_GET_INTERFACE (self)->set_storage (self, value);
}


static void fso_gsm_sms_handler_base_init (FsoGsmSmsHandlerIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
		g_object_interface_install_property (iface, g_param_spec_object ("storage", "storage", "storage", FSO_GSM_TYPE_ISMS_STORAGE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	}
}


/**
 * @interface SmsHandler
 */
GType fso_gsm_sms_handler_get_type (void) {
	static volatile gsize fso_gsm_sms_handler_type_id__volatile = 0;
	if (g_once_init_enter (&fso_gsm_sms_handler_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FsoGsmSmsHandlerIface), (GBaseInitFunc) fso_gsm_sms_handler_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType fso_gsm_sms_handler_type_id;
		fso_gsm_sms_handler_type_id = g_type_register_static (G_TYPE_INTERFACE, "FsoGsmSmsHandler", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (fso_gsm_sms_handler_type_id, FSO_FRAMEWORK_TYPE_ABSTRACT_OBJECT);
		g_once_init_leave (&fso_gsm_sms_handler_type_id__volatile, fso_gsm_sms_handler_type_id);
	}
	return fso_gsm_sms_handler_type_id__volatile;
}


FsoGsmNullSmsHandler* fso_gsm_null_sms_handler_construct (GType object_type) {
	FsoGsmNullSmsHandler * self = NULL;
	FsoGsmISmsStorage* _tmp0_ = NULL;
	FsoGsmISmsStorage* _tmp1_;
	self = (FsoGsmNullSmsHandler*) fso_framework_abstract_object_construct (object_type);
	_tmp0_ = fso_gsm_sms_storage_factory_create ("null", "");
	_tmp1_ = _tmp0_;
	fso_gsm_sms_handler_set_storage ((FsoGsmSmsHandler*) self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	return self;
}


FsoGsmNullSmsHandler* fso_gsm_null_sms_handler_new (void) {
	return fso_gsm_null_sms_handler_construct (FSO_GSM_TYPE_NULL_SMS_HANDLER);
}


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


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


static void fso_gsm_null_sms_handler_real_handleIncomingSmsOnSim (FsoGsmSmsHandler* base, guint index, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmNullSmsHandler * self;
	fso_gsm_null_sms_handler_handleIncomingSmsOnSimData* _data_;
	FsoGsmNullSmsHandler* _tmp0_;
	guint _tmp1_;
	self = (FsoGsmNullSmsHandler*) base;
	_data_ = g_slice_new0 (fso_gsm_null_sms_handler_handleIncomingSmsOnSimData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_null_sms_handler_real_handleIncomingSmsOnSim);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_null_sms_handler_real_handleIncomingSmsOnSim_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = index;
	_data_->index = _tmp1_;
	fso_gsm_null_sms_handler_real_handleIncomingSmsOnSim_co (_data_);
}


static void fso_gsm_null_sms_handler_real_handleIncomingSmsOnSim_finish (FsoGsmSmsHandler* base, GAsyncResult* _res_) {
	fso_gsm_null_sms_handler_handleIncomingSmsOnSimData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean fso_gsm_null_sms_handler_real_handleIncomingSmsOnSim_co (fso_gsm_null_sms_handler_handleIncomingSmsOnSimData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	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;
}


static void fso_gsm_null_sms_handler_real_handleIncomingSms_data_free (gpointer _data) {
	fso_gsm_null_sms_handler_handleIncomingSmsData* _data_;
	_data_ = _data;
	_g_free0 (_data_->hexpdu);
	_g_object_unref0 (_data_->self);
	g_slice_free (fso_gsm_null_sms_handler_handleIncomingSmsData, _data_);
}


static void fso_gsm_null_sms_handler_real_handleIncomingSms (FsoGsmSmsHandler* base, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmNullSmsHandler * self;
	fso_gsm_null_sms_handler_handleIncomingSmsData* _data_;
	FsoGsmNullSmsHandler* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	self = (FsoGsmNullSmsHandler*) base;
	_data_ = g_slice_new0 (fso_gsm_null_sms_handler_handleIncomingSmsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_null_sms_handler_real_handleIncomingSms);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_null_sms_handler_real_handleIncomingSms_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = hexpdu;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->hexpdu = _tmp2_;
	_tmp3_ = tpdulen;
	_data_->tpdulen = _tmp3_;
	fso_gsm_null_sms_handler_real_handleIncomingSms_co (_data_);
}


static void fso_gsm_null_sms_handler_real_handleIncomingSms_finish (FsoGsmSmsHandler* base, GAsyncResult* _res_) {
	fso_gsm_null_sms_handler_handleIncomingSmsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean fso_gsm_null_sms_handler_real_handleIncomingSms_co (fso_gsm_null_sms_handler_handleIncomingSmsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	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;
}


static void fso_gsm_null_sms_handler_real_handleIncomingSmsReport_data_free (gpointer _data) {
	fso_gsm_null_sms_handler_handleIncomingSmsReportData* _data_;
	_data_ = _data;
	_g_free0 (_data_->hexpdu);
	_g_object_unref0 (_data_->self);
	g_slice_free (fso_gsm_null_sms_handler_handleIncomingSmsReportData, _data_);
}


static void fso_gsm_null_sms_handler_real_handleIncomingSmsReport (FsoGsmSmsHandler* base, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmNullSmsHandler * self;
	fso_gsm_null_sms_handler_handleIncomingSmsReportData* _data_;
	FsoGsmNullSmsHandler* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	self = (FsoGsmNullSmsHandler*) base;
	_data_ = g_slice_new0 (fso_gsm_null_sms_handler_handleIncomingSmsReportData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_null_sms_handler_real_handleIncomingSmsReport);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_null_sms_handler_real_handleIncomingSmsReport_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = hexpdu;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->hexpdu = _tmp2_;
	_tmp3_ = tpdulen;
	_data_->tpdulen = _tmp3_;
	fso_gsm_null_sms_handler_real_handleIncomingSmsReport_co (_data_);
}


static void fso_gsm_null_sms_handler_real_handleIncomingSmsReport_finish (FsoGsmSmsHandler* base, GAsyncResult* _res_) {
	fso_gsm_null_sms_handler_handleIncomingSmsReportData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean fso_gsm_null_sms_handler_real_handleIncomingSmsReport_co (fso_gsm_null_sms_handler_handleIncomingSmsReportData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	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;
}


static guint16 fso_gsm_null_sms_handler_real_lastReferenceNumber (FsoGsmSmsHandler* base) {
	FsoGsmNullSmsHandler * self;
	guint16 result = 0U;
	FsoGsmISmsStorage* _tmp0_;
	FsoGsmISmsStorage* _tmp1_;
	guint16 _tmp2_ = 0U;
	self = (FsoGsmNullSmsHandler*) base;
	_tmp0_ = fso_gsm_sms_handler_get_storage ((FsoGsmSmsHandler*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = fso_gsm_isms_storage_lastReferenceNumber (_tmp1_);
	result = _tmp2_;
	return result;
}


static guint16 fso_gsm_null_sms_handler_real_nextReferenceNumber (FsoGsmSmsHandler* base) {
	FsoGsmNullSmsHandler * self;
	guint16 result = 0U;
	FsoGsmISmsStorage* _tmp0_;
	FsoGsmISmsStorage* _tmp1_;
	guint16 _tmp2_ = 0U;
	self = (FsoGsmNullSmsHandler*) base;
	_tmp0_ = fso_gsm_sms_handler_get_storage ((FsoGsmSmsHandler*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = fso_gsm_isms_storage_increasingReferenceNumber (_tmp1_);
	result = _tmp2_;
	return result;
}


static GeeArrayList* fso_gsm_null_sms_handler_real_formatTextMessage (FsoGsmSmsHandler* base, const gchar* number, const gchar* contents, gboolean requestReport) {
	FsoGsmNullSmsHandler * self;
	GeeArrayList* result = NULL;
	GeeArrayList* _tmp0_;
	self = (FsoGsmNullSmsHandler*) base;
	g_return_val_if_fail (number != NULL, NULL);
	g_return_val_if_fail (contents != NULL, NULL);
	_tmp0_ = gee_array_list_new (TYPE_WRAP_HEX_PDU, (GBoxedCopyFunc) wrap_hex_pdu_ref, wrap_hex_pdu_unref, NULL);
	result = _tmp0_;
	return result;
}


static void fso_gsm_null_sms_handler_real_storeTransactionIndizesForSentMessage (FsoGsmSmsHandler* base, GeeArrayList* hexpdus) {
	FsoGsmNullSmsHandler * self;
	self = (FsoGsmNullSmsHandler*) base;
	g_return_if_fail (hexpdus != NULL);
}


static gchar* fso_gsm_null_sms_handler_real_repr (FsoFrameworkAbstractObject* base) {
	FsoGsmNullSmsHandler * self;
	gchar* result = NULL;
	gchar* _tmp0_;
	self = (FsoGsmNullSmsHandler*) base;
	_tmp0_ = g_strdup ("<>");
	result = _tmp0_;
	return result;
}


static FsoGsmISmsStorage* fso_gsm_null_sms_handler_real_get_storage (FsoGsmSmsHandler* base) {
	FsoGsmISmsStorage* result;
	FsoGsmNullSmsHandler* self;
	FsoGsmISmsStorage* _tmp0_;
	self = (FsoGsmNullSmsHandler*) base;
	_tmp0_ = self->priv->_storage;
	result = _tmp0_;
	return result;
}


static void fso_gsm_null_sms_handler_real_set_storage (FsoGsmSmsHandler* base, FsoGsmISmsStorage* value) {
	FsoGsmNullSmsHandler* self;
	FsoGsmISmsStorage* _tmp0_;
	FsoGsmISmsStorage* _tmp1_;
	self = (FsoGsmNullSmsHandler*) base;
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_storage);
	self->priv->_storage = _tmp1_;
	g_object_notify ((GObject *) self, "storage");
}


static void fso_gsm_null_sms_handler_class_init (FsoGsmNullSmsHandlerClass * klass) {
	fso_gsm_null_sms_handler_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (FsoGsmNullSmsHandlerPrivate));
	FSO_FRAMEWORK_ABSTRACT_OBJECT_CLASS (klass)->repr = fso_gsm_null_sms_handler_real_repr;
	G_OBJECT_CLASS (klass)->get_property = _vala_fso_gsm_null_sms_handler_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_fso_gsm_null_sms_handler_set_property;
	G_OBJECT_CLASS (klass)->finalize = fso_gsm_null_sms_handler_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FSO_GSM_NULL_SMS_HANDLER_STORAGE, g_param_spec_object ("storage", "storage", "storage", FSO_GSM_TYPE_ISMS_STORAGE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void fso_gsm_null_sms_handler_fso_gsm_sms_handler_interface_init (FsoGsmSmsHandlerIface * iface) {
	fso_gsm_null_sms_handler_fso_gsm_sms_handler_parent_iface = g_type_interface_peek_parent (iface);
	iface->handleIncomingSmsOnSim = (void (*)(FsoGsmSmsHandler*, guint)) fso_gsm_null_sms_handler_real_handleIncomingSmsOnSim;
	iface->handleIncomingSmsOnSim_finish = fso_gsm_null_sms_handler_real_handleIncomingSmsOnSim_finish;
	iface->handleIncomingSms = (void (*)(FsoGsmSmsHandler*, const gchar*, gint)) fso_gsm_null_sms_handler_real_handleIncomingSms;
	iface->handleIncomingSms_finish = fso_gsm_null_sms_handler_real_handleIncomingSms_finish;
	iface->handleIncomingSmsReport = (void (*)(FsoGsmSmsHandler*, const gchar*, gint)) fso_gsm_null_sms_handler_real_handleIncomingSmsReport;
	iface->handleIncomingSmsReport_finish = fso_gsm_null_sms_handler_real_handleIncomingSmsReport_finish;
	iface->lastReferenceNumber = (guint16 (*)(FsoGsmSmsHandler*)) fso_gsm_null_sms_handler_real_lastReferenceNumber;
	iface->nextReferenceNumber = (guint16 (*)(FsoGsmSmsHandler*)) fso_gsm_null_sms_handler_real_nextReferenceNumber;
	iface->formatTextMessage = (GeeArrayList* (*)(FsoGsmSmsHandler*, const gchar*, const gchar*, gboolean)) fso_gsm_null_sms_handler_real_formatTextMessage;
	iface->storeTransactionIndizesForSentMessage = (void (*)(FsoGsmSmsHandler*, GeeArrayList*)) fso_gsm_null_sms_handler_real_storeTransactionIndizesForSentMessage;
	iface->get_storage = fso_gsm_null_sms_handler_real_get_storage;
	iface->set_storage = fso_gsm_null_sms_handler_real_set_storage;
}


static void fso_gsm_null_sms_handler_instance_init (FsoGsmNullSmsHandler * self) {
	self->priv = FSO_GSM_NULL_SMS_HANDLER_GET_PRIVATE (self);
}


static void fso_gsm_null_sms_handler_finalize (GObject* obj) {
	FsoGsmNullSmsHandler * self;
	self = FSO_GSM_NULL_SMS_HANDLER (obj);
	_g_object_unref0 (self->priv->_storage);
	G_OBJECT_CLASS (fso_gsm_null_sms_handler_parent_class)->finalize (obj);
}


/**
 * @class NullSmsHandler
 **/
GType fso_gsm_null_sms_handler_get_type (void) {
	static volatile gsize fso_gsm_null_sms_handler_type_id__volatile = 0;
	if (g_once_init_enter (&fso_gsm_null_sms_handler_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FsoGsmNullSmsHandlerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) fso_gsm_null_sms_handler_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FsoGsmNullSmsHandler), 0, (GInstanceInitFunc) fso_gsm_null_sms_handler_instance_init, NULL };
		static const GInterfaceInfo fso_gsm_sms_handler_info = { (GInterfaceInitFunc) fso_gsm_null_sms_handler_fso_gsm_sms_handler_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType fso_gsm_null_sms_handler_type_id;
		fso_gsm_null_sms_handler_type_id = g_type_register_static (FSO_FRAMEWORK_TYPE_ABSTRACT_OBJECT, "FsoGsmNullSmsHandler", &g_define_type_info, 0);
		g_type_add_interface_static (fso_gsm_null_sms_handler_type_id, FSO_GSM_TYPE_SMS_HANDLER, &fso_gsm_sms_handler_info);
		g_once_init_leave (&fso_gsm_null_sms_handler_type_id__volatile, fso_gsm_null_sms_handler_type_id);
	}
	return fso_gsm_null_sms_handler_type_id__volatile;
}


static void _vala_fso_gsm_null_sms_handler_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	FsoGsmNullSmsHandler * self;
	self = FSO_GSM_NULL_SMS_HANDLER (object);
	switch (property_id) {
		case FSO_GSM_NULL_SMS_HANDLER_STORAGE:
		g_value_set_object (value, fso_gsm_sms_handler_get_storage ((FsoGsmSmsHandler*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_fso_gsm_null_sms_handler_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	FsoGsmNullSmsHandler * self;
	self = FSO_GSM_NULL_SMS_HANDLER (object);
	switch (property_id) {
		case FSO_GSM_NULL_SMS_HANDLER_STORAGE:
		fso_gsm_sms_handler_set_storage ((FsoGsmSmsHandler*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


void fso_gsm_abstract_sms_handler_retrieveImsiFromSIM (FsoGsmAbstractSmsHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FSO_GSM_ABSTRACT_SMS_HANDLER_GET_CLASS (self)->retrieveImsiFromSIM (self, _callback_, _user_data_);
}


gchar* fso_gsm_abstract_sms_handler_retrieveImsiFromSIM_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_) {
	return FSO_GSM_ABSTRACT_SMS_HANDLER_GET_CLASS (self)->retrieveImsiFromSIM_finish (self, _res_);
}


void fso_gsm_abstract_sms_handler_fillStorageWithMessageFromSIM (FsoGsmAbstractSmsHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FSO_GSM_ABSTRACT_SMS_HANDLER_GET_CLASS (self)->fillStorageWithMessageFromSIM (self, _callback_, _user_data_);
}


void fso_gsm_abstract_sms_handler_fillStorageWithMessageFromSIM_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_) {
	FSO_GSM_ABSTRACT_SMS_HANDLER_GET_CLASS (self)->fillStorageWithMessageFromSIM_finish (self, _res_);
}


void fso_gsm_abstract_sms_handler_readSmsMessageFromSIM (FsoGsmAbstractSmsHandler* self, guint index, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FSO_GSM_ABSTRACT_SMS_HANDLER_GET_CLASS (self)->readSmsMessageFromSIM (self, index, _callback_, _user_data_);
}


gboolean fso_gsm_abstract_sms_handler_readSmsMessageFromSIM_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_, gchar** hexpdu, gint* tpdulen) {
	return FSO_GSM_ABSTRACT_SMS_HANDLER_GET_CLASS (self)->readSmsMessageFromSIM_finish (self, _res_, hexpdu, tpdulen);
}


void fso_gsm_abstract_sms_handler_acknowledgeSmsMessage (FsoGsmAbstractSmsHandler* self, gint id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FSO_GSM_ABSTRACT_SMS_HANDLER_GET_CLASS (self)->acknowledgeSmsMessage (self, id, _callback_, _user_data_);
}


gboolean fso_gsm_abstract_sms_handler_acknowledgeSmsMessage_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_) {
	return FSO_GSM_ABSTRACT_SMS_HANDLER_GET_CLASS (self)->acknowledgeSmsMessage_finish (self, _res_);
}


static void fso_gsm_abstract_sms_handler_onModemStatusChanged (FsoGsmAbstractSmsHandler* self, FsoGsmModem* modem, FsoGsmModemStatus status) {
	FsoGsmModemStatus _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (modem != NULL);
	_tmp0_ = status;
	if (_tmp0_ == FSO_GSM_MODEM_STATUS_ALIVE_SIM_READY) {
		fso_gsm_abstract_sms_handler_simIsReady (self, NULL, NULL);
	}
}


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


static void fso_gsm_abstract_sms_handler_simIsReady (FsoGsmAbstractSmsHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	fso_gsm_abstract_sms_handler_simIsReadyData* _data_;
	FsoGsmAbstractSmsHandler* _tmp0_;
	_data_ = g_slice_new0 (fso_gsm_abstract_sms_handler_simIsReadyData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_abstract_sms_handler_simIsReady);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_abstract_sms_handler_simIsReady_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	fso_gsm_abstract_sms_handler_simIsReady_co (_data_);
}


static void fso_gsm_abstract_sms_handler_simIsReady_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_) {
	fso_gsm_abstract_sms_handler_simIsReadyData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void fso_gsm_abstract_sms_handler_simIsReady_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	fso_gsm_abstract_sms_handler_simIsReadyData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	fso_gsm_abstract_sms_handler_simIsReady_co (_data_);
}


static gboolean fso_gsm_abstract_sms_handler_simIsReady_co (fso_gsm_abstract_sms_handler_simIsReadyData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	fso_gsm_abstract_sms_handler_syncWithSim (_data_->self, fso_gsm_abstract_sms_handler_simIsReady_ready, _data_);
	return FALSE;
	_state_1:
	fso_gsm_abstract_sms_handler_syncWithSim_finish (_data_->self, _data_->_res_);
	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;
}


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


void fso_gsm_abstract_sms_handler_syncWithSim (FsoGsmAbstractSmsHandler* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	fso_gsm_abstract_sms_handler_syncWithSimData* _data_;
	FsoGsmAbstractSmsHandler* _tmp0_;
	_data_ = g_slice_new0 (fso_gsm_abstract_sms_handler_syncWithSimData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_abstract_sms_handler_syncWithSim);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_abstract_sms_handler_syncWithSim_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	fso_gsm_abstract_sms_handler_syncWithSim_co (_data_);
}


void fso_gsm_abstract_sms_handler_syncWithSim_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_) {
	fso_gsm_abstract_sms_handler_syncWithSimData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void fso_gsm_abstract_sms_handler_syncWithSim_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	fso_gsm_abstract_sms_handler_syncWithSimData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	fso_gsm_abstract_sms_handler_syncWithSim_co (_data_);
}


static gboolean fso_gsm_abstract_sms_handler_syncWithSim_co (fso_gsm_abstract_sms_handler_syncWithSimData* _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_sms_handler_get_storage ((FsoGsmSmsHandler*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (_data_->_tmp1_ == NULL) {
		_data_->_tmp2_ = ((FsoFrameworkAbstractObject*) _data_->self)->logger;
		_data_->_tmp3_ = FALSE;
		_data_->_tmp3_ = fso_framework_logger_debug (_data_->_tmp2_, "Storage not yet available; create a new one ...");
		g_assert (_data_->_tmp3_);
		_data_->_state_ = 1;
		fso_gsm_abstract_sms_handler_retrieveImsiFromSIM (_data_->self, fso_gsm_abstract_sms_handler_syncWithSim_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = fso_gsm_abstract_sms_handler_retrieveImsiFromSIM_finish (_data_->self, _data_->_res_);
		_data_->imsi = _data_->_tmp4_;
		_data_->_tmp6_ = _data_->imsi;
		if (g_strcmp0 (_data_->_tmp6_, "") == 0) {
			_data_->_tmp5_ = TRUE;
		} else {
			_data_->_tmp7_ = _data_->imsi;
			_data_->_tmp5_ = _data_->_tmp7_ == NULL;
		}
		_data_->_tmp8_ = _data_->_tmp5_;
		if (_data_->_tmp8_) {
			_data_->_tmp9_ = g_strdup ("unknown");
			_g_free0 (_data_->imsi);
			_data_->imsi = _data_->_tmp9_;
		}
		_data_->_tmp10_ = _data_->imsi;
		_data_->_tmp11_ = NULL;
		_data_->_tmp11_ = fso_gsm_sms_storage_factory_create ("default", _data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		fso_gsm_sms_handler_set_storage ((FsoGsmSmsHandler*) _data_->self, _data_->_tmp12_);
		_g_object_unref0 (_data_->_tmp12_);
		_g_free0 (_data_->imsi);
	}
	_data_->_state_ = 2;
	fso_gsm_abstract_sms_handler_fillStorageWithMessageFromSIM (_data_->self, fso_gsm_abstract_sms_handler_syncWithSim_ready, _data_);
	return FALSE;
	_state_2:
	fso_gsm_abstract_sms_handler_fillStorageWithMessageFromSIM_finish (_data_->self, _data_->_res_);
	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;
}


static void _fso_gsm_abstract_sms_handler_handleIncomingSms_data_free (gpointer _data) {
	_fso_gsm_abstract_sms_handler_handleIncomingSmsData* _data_;
	_data_ = _data;
	_g_free0 (_data_->hexpdu);
	_g_object_unref0 (_data_->self);
	g_slice_free (_fso_gsm_abstract_sms_handler_handleIncomingSmsData, _data_);
}


static void _fso_gsm_abstract_sms_handler_handleIncomingSms (FsoGsmAbstractSmsHandler* self, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	_fso_gsm_abstract_sms_handler_handleIncomingSmsData* _data_;
	FsoGsmAbstractSmsHandler* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	_data_ = g_slice_new0 (_fso_gsm_abstract_sms_handler_handleIncomingSmsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, _fso_gsm_abstract_sms_handler_handleIncomingSms);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, _fso_gsm_abstract_sms_handler_handleIncomingSms_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = hexpdu;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->hexpdu = _tmp2_;
	_tmp3_ = tpdulen;
	_data_->tpdulen = _tmp3_;
	_fso_gsm_abstract_sms_handler_handleIncomingSms_co (_data_);
}


static void _fso_gsm_abstract_sms_handler_handleIncomingSms_finish (FsoGsmAbstractSmsHandler* self, GAsyncResult* _res_) {
	_fso_gsm_abstract_sms_handler_handleIncomingSmsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


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 struct sms* sms_newFromHexPdu (const gchar* hexpdu, gint tpdulen) {
	struct sms* result = NULL;
	glong items_written;
	gchar* _tmp0_ = NULL;
	gchar* binpdu;
	gint binpdu_length1;
	gint _binpdu_size_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gint _tmp2__length1;
	glong _tmp3_ = 0L;
	glong _tmp4_;
	struct sms* _tmp5_;
	struct sms* sms;
	gchar* _tmp6_;
	gint _tmp6__length1;
	gint _tmp7_;
	struct sms* _tmp8_;
	gboolean _tmp9_ = FALSE;
	gboolean res;
	gboolean _tmp10_;
	g_return_val_if_fail (hexpdu != NULL, NULL);
	items_written = (glong) (-1);
	_tmp0_ = g_new0 (gchar, 1024);
	binpdu = _tmp0_;
	binpdu_length1 = 1024;
	_binpdu_size_ = binpdu_length1;
	_tmp1_ = hexpdu;
	_tmp2_ = binpdu;
	_tmp2__length1 = binpdu_length1;
	decode_hex_own_buf (_tmp1_, (glong) (-1), &_tmp3_, (gchar) 0, _tmp2_);
	items_written = _tmp3_;
	_tmp4_ = items_written;
	g_assert (_tmp4_ != ((glong) (-1)));
	_tmp5_ = sms_new ();
	sms = _tmp5_;
	_tmp6_ = binpdu;
	_tmp6__length1 = binpdu_length1;
	_tmp7_ = tpdulen;
	_tmp8_ = sms;
	_tmp9_ = sms_decode (_tmp6_, _tmp6__length1, FALSE, _tmp7_, _tmp8_);
	res = _tmp9_;
	_tmp10_ = res;
	if (!_tmp10_) {
		gint _tmp11_;
		gchar* _tmp12_ = NULL;
		gchar* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_ = NULL;
		gchar* _tmp16_ = NULL;
		gchar* _tmp17_;
		_tmp11_ = tpdulen;
		_tmp12_ = g_strdup_printf ("%i", _tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = hexpdu;
		_tmp15_ = string_to_string (_tmp14_);
		_tmp16_ = g_strconcat ("Sms.Message::newFromHexPdu: could not decode message w/ tpdulen ", _tmp13_, " and hexpdu ", _tmp15_, NULL);
		_tmp17_ = _tmp16_;
		g_warning ("fsogsm3rdparty.vapi:602: %s", _tmp17_);
		_g_free0 (_tmp17_);
		_g_free0 (_tmp13_);
		result = NULL;
		_sms_free0 (sms);
		binpdu = (g_free (binpdu), NULL);
		return result;
	} else {
		result = sms;
		binpdu = (g_free (binpdu), NULL);
		return result;
	}
	_sms_free0 (sms);
	binpdu = (g_free (binpdu), NULL);
}


static gchar* sms_number (struct sms* self) {
	gchar* result = NULL;
	enum sms_type _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->type;
	switch (_tmp0_) {
		case SMS_TYPE_DELIVER:
		{
			const gchar* _tmp1_ = NULL;
			gchar* _tmp2_;
			_tmp1_ = sms_address_to_string (&self->deliver.oaddr);
			_tmp2_ = g_strdup (_tmp1_);
			result = _tmp2_;
			return result;
		}
		case SMS_TYPE_SUBMIT:
		{
			const gchar* _tmp3_ = NULL;
			gchar* _tmp4_;
			_tmp3_ = sms_address_to_string (&self->submit.daddr);
			_tmp4_ = g_strdup (_tmp3_);
			result = _tmp4_;
			return result;
		}
		case SMS_TYPE_COMMAND:
		{
			const gchar* _tmp5_ = NULL;
			gchar* _tmp6_;
			_tmp5_ = sms_address_to_string (&self->command.daddr);
			_tmp6_ = g_strdup (_tmp5_);
			result = _tmp6_;
			return result;
		}
		case SMS_TYPE_STATUS_REPORT:
		{
			const gchar* _tmp7_ = NULL;
			gchar* _tmp8_;
			_tmp7_ = sms_address_to_string (&self->status_report.raddr);
			_tmp8_ = g_strdup (_tmp7_);
			result = _tmp8_;
			return result;
		}
		default:
		{
			gchar* _tmp9_;
			_tmp9_ = g_strdup ("unknown");
			result = _tmp9_;
			return result;
		}
	}
}


/**
         * @returns a hashable string for the message that serves as a unique identifier
         * (considering the fragments of a concatenated message as being the same message)
         */
static gchar* sms_toHexPdu (struct sms* self, gint* tpdulen) {
	gint _vala_tpdulen = 0;
	gchar* result = NULL;
	gint binlen = 0;
	gchar* _tmp0_ = NULL;
	gchar* binpdu;
	gint binpdu_length1;
	gint _binpdu_size_;
	gchar* _tmp1_;
	gint _tmp1__length1;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	gboolean _tmp4_ = FALSE;
	gboolean res;
	gboolean _tmp5_;
	gchar* _tmp7_ = NULL;
	gchar* hexpdu;
	gint hexpdu_length1;
	gint _hexpdu_size_;
	gchar* _tmp8_;
	gint _tmp8__length1;
	gint _tmp9_;
	gchar* _tmp10_;
	gint _tmp10__length1;
	gchar* _tmp11_;
	gint _tmp11__length1;
	gchar* _tmp12_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (gchar, 176);
	binpdu = _tmp0_;
	binpdu_length1 = 176;
	_binpdu_size_ = binpdu_length1;
	_tmp1_ = binpdu;
	_tmp1__length1 = binpdu_length1;
	_tmp4_ = sms_encode (self, &_tmp2_, &_tmp3_, _tmp1_);
	binlen = _tmp2_;
	_vala_tpdulen = _tmp3_;
	res = _tmp4_;
	_tmp5_ = res;
	if (!_tmp5_) {
		gchar* _tmp6_;
		g_warning ("fsogsm3rdparty.vapi:619: %s", "Sms.Message::toHexPdu: could not encode message");
		_vala_tpdulen = -1;
		_tmp6_ = g_strdup ("");
		result = _tmp6_;
		binpdu = (g_free (binpdu), NULL);
		if (tpdulen) {
			*tpdulen = _vala_tpdulen;
		}
		return result;
	}
	_tmp7_ = g_new0 (gchar, 1024);
	hexpdu = _tmp7_;
	hexpdu_length1 = 1024;
	_hexpdu_size_ = hexpdu_length1;
	_tmp8_ = binpdu;
	_tmp8__length1 = binpdu_length1;
	_tmp9_ = binlen;
	_tmp10_ = hexpdu;
	_tmp10__length1 = hexpdu_length1;
	encode_hex_own_buf (_tmp8_, (glong) _tmp9_, (gchar) 0, _tmp10_);
	_tmp11_ = hexpdu;
	_tmp11__length1 = hexpdu_length1;
	_tmp12_ = g_strdup_printf ("%s", (const gchar*) _tmp11_);
	result = _tmp12_;
	hexpdu = (g_free (hexpdu), NULL);
	binpdu = (g_free (binpdu), NULL);
	if (tpdulen) {
		*tpdulen = _vala_tpdulen;
	}
	return result;
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	{
		const gchar* _tmp0_;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_;
		GRegex* _tmp3_;
		GRegex* _tmp4_;
		GRegex* regex;
		GRegex* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_;
		_tmp0_ = old;
		_tmp1_ = g_regex_escape_string (_tmp0_, -1);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		regex = _tmp4_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch56_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_tmp5_ = regex;
		_tmp6_ = replacement;
		_tmp7_ = g_regex_replace_literal (_tmp5_, self, (gssize) (-1), 0, _tmp6_, 0, &_inner_error_);
		_tmp8_ = _tmp7_;
		if (_inner_error_ != NULL) {
			_g_regex_unref0 (regex);
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch56_g_regex_error;
			}
			_g_regex_unref0 (regex);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		result = _tmp8_;
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally56;
	__catch56_g_regex_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally56:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
}


static gchar* sms_hash (struct sms* self) {
	gchar* result = NULL;
	enum sms_type _tmp0_;
	guint16 ref_num = 0U;
	guint8 max_msgs = 0U;
	guint8 seq_num = 0U;
	gint tpdulen = 0;
	gchar* _tmp1_;
	gchar* hash;
	gchar* _tmp2_ = NULL;
	gchar* oaddr;
	guint16 _tmp3_ = 0U;
	guint8 _tmp4_ = 0U;
	guint8 _tmp5_ = 0U;
	gboolean _tmp6_ = FALSE;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->type;
	g_assert (_tmp0_ == SMS_TYPE_DELIVER);
	_tmp1_ = g_strdup ("");
	hash = _tmp1_;
	_tmp2_ = sms_number (self);
	oaddr = _tmp2_;
	_tmp6_ = sms_extract_concatenation (self, &_tmp3_, &_tmp4_, &_tmp5_);
	ref_num = _tmp3_;
	max_msgs = _tmp4_;
	seq_num = _tmp5_;
	if (!_tmp6_) {
		gint _tmp7_ = 0;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_;
		gchar* _tmp10_ = NULL;
		gchar* _tmp11_;
		gchar* pdu_hash;
		const gchar* _tmp12_;
		const gchar* _tmp13_ = NULL;
		gchar* _tmp14_ = NULL;
		_tmp8_ = sms_toHexPdu (self, &_tmp7_);
		tpdulen = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _tmp9_, (gsize) (-1));
		_tmp11_ = _tmp10_;
		_g_free0 (_tmp9_);
		pdu_hash = _tmp11_;
		_tmp12_ = pdu_hash;
		_tmp13_ = string_to_string (_tmp12_);
		_tmp14_ = g_strconcat (_tmp13_, "_1", NULL);
		_g_free0 (hash);
		hash = _tmp14_;
		_g_free0 (pdu_hash);
	} else {
		const gchar* _tmp15_;
		const gchar* _tmp16_ = NULL;
		guint16 _tmp17_;
		gchar* _tmp18_ = NULL;
		gchar* _tmp19_;
		guint8 _tmp20_;
		gchar* _tmp21_ = NULL;
		gchar* _tmp22_;
		gchar* _tmp23_ = NULL;
		gchar* _tmp24_;
		gchar* _tmp25_ = NULL;
		_tmp15_ = oaddr;
		_tmp16_ = string_to_string (_tmp15_);
		_tmp17_ = ref_num;
		_tmp18_ = g_strdup_printf ("%hu", _tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = max_msgs;
		_tmp21_ = g_strdup_printf ("%hhu", _tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = g_strconcat (_tmp16_, "_", _tmp19_, "_", _tmp22_, NULL);
		_tmp24_ = _tmp23_;
		_tmp25_ = string_replace (_tmp24_, "+", "");
		_g_free0 (hash);
		hash = _tmp25_;
		_g_free0 (_tmp24_);
		_g_free0 (_tmp22_);
		_g_free0 (_tmp19_);
	}
	result = hash;
	_g_free0 (oaddr);
	return result;
}


static gboolean _fso_gsm_abstract_sms_handler_handleIncomingSms_co (_fso_gsm_abstract_sms_handler_handleIncomingSmsData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->hexpdu;
	_data_->_tmp1_ = _data_->tpdulen;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = sms_newFromHexPdu (_data_->_tmp0_, _data_->_tmp1_);
	_data_->sms = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->sms;
	if (_data_->_tmp3_ == NULL) {
		_data_->_tmp4_ = ((FsoFrameworkAbstractObject*) _data_->self)->logger;
		fso_framework_logger_warning (_data_->_tmp4_, "Can't parse incoming SMS");
		_sms_free0 (_data_->sms);
		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;
	}
	_data_->_tmp5_ = fso_gsm_sms_handler_get_storage ((FsoGsmSmsHandler*) _data_->self);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->sms;
	_data_->_tmp8_ = 0;
	_data_->_tmp8_ = fso_gsm_isms_storage_addSms (_data_->_tmp6_, _data_->_tmp7_);
	_data_->_result_ = _data_->_tmp8_;
	_data_->_tmp9_ = _data_->_result_;
	if (_data_->_tmp9_ == FSO_GSM_SMS_STORAGE_SMS_ALREADY_SEEN) {
		_data_->_tmp10_ = ((FsoFrameworkAbstractObject*) _data_->self)->logger;
		fso_framework_logger_warning (_data_->_tmp10_, "Ignoring already seen SMS");
		_sms_free0 (_data_->sms);
		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_->_tmp11_ = _data_->_result_;
		if (_data_->_tmp11_ == FSO_GSM_SMS_STORAGE_SMS_MULTI_INCOMPLETE) {
			_data_->_tmp12_ = ((FsoFrameworkAbstractObject*) _data_->self)->logger;
			fso_framework_logger_info (_data_->_tmp12_, "Got new fragment for still-incomplete concatenated SMS");
			_sms_free0 (_data_->sms);
			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_->_tmp13_ = ((FsoFrameworkAbstractObject*) _data_->self)->logger;
			_data_->_tmp14_ = _data_->sms;
			_data_->_tmp15_ = NULL;
			_data_->_tmp15_ = sms_number (_data_->_tmp14_);
			_data_->_tmp16_ = _data_->_tmp15_;
			_data_->_tmp17_ = NULL;
			_data_->_tmp17_ = string_to_string (_data_->_tmp16_);
			_data_->_tmp18_ = NULL;
			_data_->_tmp18_ = g_strconcat ("Got new SMS from ", _data_->_tmp17_, NULL);
			_data_->_tmp19_ = _data_->_tmp18_;
			fso_framework_logger_info (_data_->_tmp13_, _data_->_tmp19_);
			_g_free0 (_data_->_tmp19_);
			_g_free0 (_data_->_tmp16_);
			_data_->_tmp20_ = fso_gsm_sms_handler_get_storage ((FsoGsmSmsHandler*) _data_->self);
			_data_->_tmp21_ = _data_->_tmp20_;
			_data_->_tmp22_ = _data_->sms;
			_data_->_tmp23_ = NULL;
			_data_->_tmp23_ = sms_hash (_data_->_tmp22_);
			_data_->_tmp24_ = _data_->_tmp23_;
			memset (&_data_->_tmp25_, 0, sizeof (FreeSmartphoneGSMSIMMessage));
			fso_gsm_isms_storage_message (_data_->_tmp21_, _data_->_tmp24_, 0, &_data_->_tmp25_);
			_data_->_tmp26_ = _data_->_tmp25_;
			_g_free0 (_data_->_tmp24_);
			_data_->msg = _data_->_tmp26_;
			_data_->_tmp27_ = fso_gsm_theModem;
			_data_->_tmp28_ = NULL;
			_data_->_tmp28_ = fso_gsm_modem_theDevice (_data_->_tmp27_, FREE_SMARTPHONE_GSM_TYPE_SMS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
			_data_->obj = (FreeSmartphoneGSMSMS*) _data_->_tmp28_;
			_data_->_tmp29_ = _data_->obj;
			_data_->_tmp30_ = _data_->msg;
			_data_->_tmp31_ = _data_->_tmp30_.number;
			_data_->_tmp32_ = _data_->msg;
			_data_->_tmp33_ = _data_->_tmp32_.timestamp;
			_data_->_tmp34_ = _data_->msg;
			_data_->_tmp35_ = _data_->_tmp34_.contents;
			g_signal_emit_by_name (_data_->_tmp29_, "incoming-text-message", _data_->_tmp31_, _data_->_tmp33_, _data_->_tmp35_);
			_g_object_unref0 (_data_->obj);
			free_smartphone_gsm_sim_message_destroy (&_data_->msg);
		}
	}
	_sms_free0 (_data_->sms);
	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;
}


static gchar* sms_to_string (struct sms* self) {
	gchar* result = NULL;
	GSList* list;
	GSList* _tmp0_;
	gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	list = NULL;
	list = g_slist_append (list, self);
	_tmp0_ = list;
	_tmp1_ = sms_decode_text (_tmp0_);
	result = _tmp1_;
	_g_slist_free0 (list);
	return result;
}


static const char* _sms_status_to_string (int value) {
	switch (value) {
		case SMS_ST_COMPLETED_RECEIVED:
		return "SMS_ST_COMPLETED_RECEIVED";
		case SMS_ST_COMPLETED_UNABLE_TO_CONFIRM:
		return "SMS_ST_COMPLETED_UNABLE_TO_CONFIRM";
		case SMS_ST_COMPLETED_REPLACED:
		return "SMS_ST_COMPLETED_REPLACED";
		case SMS_ST_COMPLETED_LAST:
		return "SMS_ST_COMPLETED_LAST";
		case SMS_ST_TEMPORARY_CONGESTION:
		return "SMS_ST_TEMPORARY_CONGESTION";
		case SMS_ST_TEMPORARY_SME_BUSY:
		return "SMS_ST_TEMPORARY_SME_BUSY";
		case SMS_ST_TEMPORARY_NO_RESPONSE:
		return "SMS_ST_TEMPORARY_NO_RESPONSE";
		case SMS_ST_TEMPORARY_SERVICE_REJECTED:
		return "SMS_ST_TEMPORARY_SERVICE_REJECTED";
		case SMS_ST_TEMPORARY_QOS_UNAVAILABLE:
		return "SMS_ST_TEMPORARY_QOS_UNAVAILABLE";
		case SMS_ST_TEMPORARY_SME_ERROR:
		return "SMS_ST_TEMPORARY_SME_ERROR";
		case SMS_ST_TEMPORARY_LAST:
		return "SMS_ST_TEMPORARY_LAST";
		case SMS_ST_PERMANENT_RP_ERROR:
		return "SMS_ST_PERMANENT_RP_ERROR";
		case SMS_ST_PERMANENT_INVALID_DESTINATION:
		return "SMS_ST_PERMANENT_INVALID_DESTINATION";
		case SMS_ST_PERMANENT_CONNECTION_REJECTED:
		return "SMS_ST_PERMANENT_CONNECTION_REJECTED";
		case SMS_ST_PERMANENT_NOT_OBTAINABLE:
		return "SMS_ST_PERMANENT_NOT_OBTAINABLE";
		case SMS_ST_PERMANENT_QOS_UNAVAILABLE:
		return "SMS_ST_PERMANENT_QOS_UNAVAILABLE";
		case SMS_ST_PERMANENT_INTERWORKING_UNAVAILABLE:
		return "SMS_ST_PERMANENT_INTERWORKING_UNAVAILABLE";
		case SMS_ST_PERMANENT_VALIDITY_PERIOD_EXPIRED:
		return "SMS_ST_PERMANENT_VALIDITY_PERIOD_EXPIRED";
		case SMS_ST_PERMANENT_DELETED:
		return "SMS_ST_PERMANENT_DELETED";
		case SMS_ST_PERMANENT_SC_ADMIN_DELETED:
		return "SMS_ST_PERMANENT_SC_ADMIN_DELETED";
		case SMS_ST_PERMANENT_SM_DOES_NOT_EXIST:
		return "SMS_ST_PERMANENT_SM_DOES_NOT_EXIST";
		case SMS_ST_PERMANENT_LAST:
		return "SMS_ST_PERMANENT_LAST";
		case SMS_ST_TEMPFINAL_CONGESTION:
		return "SMS_ST_TEMPFINAL_CONGESTION";
		case SMS_ST_TEMPFINAL_SME_BUSY:
		return "SMS_ST_TEMPFINAL_SME_BUSY";
		case SMS_ST_TEMPFINAL_NO_RESPONSE:
		return "SMS_ST_TEMPFINAL_NO_RESPONSE";
		case SMS_ST_TEMPFINAL_SERVICE_REJECTED:
		return "SMS_ST_TEMPFINAL_SERVICE_REJECTED";
		case SMS_ST_TEMPFINAL_QOS_UNAVAILABLE:
		return "SMS_ST_TEMPFINAL_QOS_UNAVAILABLE";
		case SMS_ST_TEMPFINAL_SME_ERROR:
		return "SMS_ST_TEMPFINAL_SME_ERROR";
		case SMS_ST_TEMPFINAL_LAST:
		return "SMS_ST_TEMPFINAL_LAST";
	}
	return NULL;
}


static void _fso_gsm_abstract_sms_handler_handleIncomingSmsReport (FsoGsmAbstractSmsHandler* self, struct sms* sms) {
	struct sms* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* number;
	struct sms* _tmp2_;
	struct sms_status_report _tmp3_;
	guint8 _tmp4_;
	guint8 reference;
	struct sms* _tmp5_;
	struct sms_status_report _tmp6_;
	int _tmp7_;
	int status;
	struct sms* _tmp8_;
	gchar* _tmp9_ = NULL;
	gchar* text;
	FsoGsmISmsStorage* _tmp10_;
	FsoGsmISmsStorage* _tmp11_;
	guint8 _tmp12_;
	gint _tmp13_ = 0;
	gint transaction_index;
	gint _tmp14_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (sms != NULL);
	_tmp0_ = sms;
	_tmp1_ = sms_number (_tmp0_);
	number = _tmp1_;
	_tmp2_ = sms;
	_tmp3_ = _tmp2_->status_report;
	_tmp4_ = _tmp3_.mr;
	reference = _tmp4_;
	_tmp5_ = sms;
	_tmp6_ = _tmp5_->status_report;
	_tmp7_ = _tmp6_.st;
	status = _tmp7_;
	_tmp8_ = sms;
	_tmp9_ = sms_to_string (_tmp8_);
	text = _tmp9_;
	_tmp10_ = fso_gsm_sms_handler_get_storage ((FsoGsmSmsHandler*) self);
	_tmp11_ = _tmp10_;
	_tmp12_ = reference;
	_tmp13_ = fso_gsm_isms_storage_confirmReceivedMessage (_tmp11_, (gint) _tmp12_);
	transaction_index = _tmp13_;
	_tmp14_ = transaction_index;
	if (_tmp14_ >= 0) {
		FsoGsmModem* _tmp15_;
		gpointer _tmp16_ = NULL;
		FreeSmartphoneGSMSMS* obj;
		FreeSmartphoneGSMSMS* _tmp17_;
		gint _tmp18_;
		int _tmp19_;
		const gchar* _tmp20_ = NULL;
		const gchar* _tmp21_;
		const gchar* _tmp22_;
		_tmp15_ = fso_gsm_theModem;
		_tmp16_ = fso_gsm_modem_theDevice (_tmp15_, FREE_SMARTPHONE_GSM_TYPE_SMS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
		obj = (FreeSmartphoneGSMSMS*) _tmp16_;
		_tmp17_ = obj;
		_tmp18_ = transaction_index;
		_tmp19_ = status;
		_tmp20_ = _sms_status_to_string (_tmp19_);
		_tmp21_ = number;
		_tmp22_ = text;
		g_signal_emit_by_name (_tmp17_, "incoming-message-report", _tmp18_, _tmp20_, _tmp21_, _tmp22_);
		_g_object_unref0 (obj);
	}
	_g_free0 (text);
	_g_free0 (number);
}


static void _fso_gsm_abstract_sms_handler_onModemStatusChanged_fso_gsm_modem_signal_status_changed (FsoGsmModem* _sender, FsoGsmModemStatus status, gpointer self) {
	fso_gsm_abstract_sms_handler_onModemStatusChanged (self, _sender, status);
}


FsoGsmAbstractSmsHandler* fso_gsm_abstract_sms_handler_construct (GType object_type) {
	FsoGsmAbstractSmsHandler * self = NULL;
	FsoGsmModem* _tmp0_;
	self = (FsoGsmAbstractSmsHandler*) fso_framework_abstract_object_construct (object_type);
	_tmp0_ = fso_gsm_theModem;
	if (_tmp0_ == NULL) {
		FsoFrameworkLogger* _tmp1_;
		_tmp1_ = ((FsoFrameworkAbstractObject*) self)->logger;
		fso_framework_logger_warning (_tmp1_, "SMS Handler created before modem");
	} else {
		FsoGsmModem* _tmp2_;
		_tmp2_ = fso_gsm_theModem;
		g_signal_connect_object (_tmp2_, "signal-status-changed", (GCallback) _fso_gsm_abstract_sms_handler_onModemStatusChanged_fso_gsm_modem_signal_status_changed, self, 0);
	}
	return self;
}


static guint16 fso_gsm_abstract_sms_handler_real_lastReferenceNumber (FsoGsmSmsHandler* base) {
	FsoGsmAbstractSmsHandler * self;
	guint16 result = 0U;
	FsoGsmISmsStorage* _tmp0_;
	FsoGsmISmsStorage* _tmp1_;
	guint16 _tmp2_ = 0U;
	self = (FsoGsmAbstractSmsHandler*) base;
	_tmp0_ = fso_gsm_sms_handler_get_storage ((FsoGsmSmsHandler*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = fso_gsm_isms_storage_lastReferenceNumber (_tmp1_);
	result = _tmp2_;
	return result;
}


static guint16 fso_gsm_abstract_sms_handler_real_nextReferenceNumber (FsoGsmSmsHandler* base) {
	FsoGsmAbstractSmsHandler * self;
	guint16 result = 0U;
	FsoGsmISmsStorage* _tmp0_;
	FsoGsmISmsStorage* _tmp1_;
	guint16 _tmp2_ = 0U;
	self = (FsoGsmAbstractSmsHandler*) base;
	_tmp0_ = fso_gsm_sms_handler_get_storage ((FsoGsmSmsHandler*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = fso_gsm_isms_storage_increasingReferenceNumber (_tmp1_);
	result = _tmp2_;
	return result;
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (Block1Data* _data1_) {
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		_g_object_unref0 (_data1_->self);
		_g_object_unref0 (_data1_->hexpdus);
		_g_free0 (_data1_->number);
		g_slice_free (Block1Data, _data1_);
	}
}


static void __lambda3_ (Block1Data* _data1_, struct sms* element) {
	FsoGsmAbstractSmsHandler * self;
	struct sms* _tmp0_;
	struct sms* msgelement;
	const gchar* _tmp1_;
	gboolean _tmp2_;
	gint tpdulen;
	gint _tmp3_ = 0;
	gchar* _tmp4_ = NULL;
	gchar* hexpdu;
	gint _tmp5_;
	gint _tmp6_;
	WrapHexPdu* _tmp7_;
	WrapHexPdu* _tmp8_;
	self = _data1_->self;
	g_return_if_fail (element != NULL);
	_tmp0_ = element;
	msgelement = (struct sms*) _tmp0_;
	_tmp1_ = _data1_->number;
	sms_address_from_string (&msgelement->submit.daddr, _tmp1_);
	_tmp2_ = _data1_->requestReport;
	msgelement->submit.srr = _tmp2_;
	tpdulen = 0;
	_tmp4_ = sms_toHexPdu (msgelement, &_tmp3_);
	tpdulen = _tmp3_;
	hexpdu = _tmp4_;
	_tmp5_ = tpdulen;
	g_assert (_tmp5_ > 0);
	_tmp6_ = tpdulen;
	_tmp7_ = wrap_hex_pdu_new (hexpdu, (guint) _tmp6_);
	_tmp8_ = _tmp7_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _data1_->hexpdus, _tmp8_);
	_wrap_hex_pdu_unref0 (_tmp8_);
	_g_free0 (hexpdu);
}


static void ___lambda3__gfunc (gconstpointer data, gpointer self) {
	__lambda3_ (self, data);
}


static GeeArrayList* fso_gsm_abstract_sms_handler_real_formatTextMessage (FsoGsmSmsHandler* base, const gchar* number, const gchar* contents, gboolean requestReport) {
	FsoGsmAbstractSmsHandler * self;
	GeeArrayList* result = NULL;
	Block1Data* _data1_;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
	guint16 _tmp3_ = 0U;
	guint16 inref;
	gint byteOffsetForRefnum = 0;
	GeeArrayList* _tmp4_;
	const gchar* _tmp5_;
	gint _tmp6_ = 0;
	GSList* _tmp7_ = NULL;
	GSList* smslist;
	GeeArrayList* _tmp8_;
	self = (FsoGsmAbstractSmsHandler*) base;
	g_return_val_if_fail (number != NULL, NULL);
	g_return_val_if_fail (contents != NULL, NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = number;
	_tmp1_ = g_strdup (_tmp0_);
	_data1_->number = _tmp1_;
	_tmp2_ = requestReport;
	_data1_->requestReport = _tmp2_;
	_tmp3_ = fso_gsm_sms_handler_nextReferenceNumber ((FsoGsmSmsHandler*) self);
	inref = _tmp3_;
	_tmp4_ = gee_array_list_new (TYPE_WRAP_HEX_PDU, (GBoxedCopyFunc) wrap_hex_pdu_ref, wrap_hex_pdu_unref, NULL);
	_data1_->hexpdus = _tmp4_;
	_tmp5_ = contents;
	_tmp7_ = sms_text_prepare (_tmp5_, inref, TRUE, &_tmp6_);
	byteOffsetForRefnum = _tmp6_;
	smslist = _tmp7_;
	g_slist_foreach (smslist, ___lambda3__gfunc, _data1_);
	_tmp8_ = _g_object_ref0 (_data1_->hexpdus);
	result = _tmp8_;
	_g_slist_free0 (smslist);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return result;
}


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


static void fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim (FsoGsmSmsHandler* base, guint index, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmAbstractSmsHandler * self;
	fso_gsm_abstract_sms_handler_handleIncomingSmsOnSimData* _data_;
	FsoGsmAbstractSmsHandler* _tmp0_;
	guint _tmp1_;
	self = (FsoGsmAbstractSmsHandler*) base;
	_data_ = g_slice_new0 (fso_gsm_abstract_sms_handler_handleIncomingSmsOnSimData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = index;
	_data_->index = _tmp1_;
	fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim_co (_data_);
}


static void fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim_finish (FsoGsmSmsHandler* base, GAsyncResult* _res_) {
	fso_gsm_abstract_sms_handler_handleIncomingSmsOnSimData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void fso_gsm_abstract_sms_handler_handleIncomingSmsOnSim_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	fso_gsm_abstract_sms_handler_handleIncomingSmsOnSimData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim_co (_data_);
}


static gboolean fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim_co (fso_gsm_abstract_sms_handler_handleIncomingSmsOnSimData* _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_ = g_strdup ("");
	_data_->hexpdu = _data_->_tmp0_;
	_data_->tpdulen = 0;
	_data_->_tmp1_ = _data_->index;
	_data_->_tmp2_ = NULL;
	_data_->_tmp3_ = 0;
	_data_->_state_ = 1;
	fso_gsm_abstract_sms_handler_readSmsMessageFromSIM (_data_->self, _data_->_tmp1_, fso_gsm_abstract_sms_handler_handleIncomingSmsOnSim_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = FALSE;
	_data_->_tmp4_ = fso_gsm_abstract_sms_handler_readSmsMessageFromSIM_finish (_data_->self, _data_->_res_, &_data_->_tmp2_, &_data_->_tmp3_);
	_g_free0 (_data_->hexpdu);
	_data_->hexpdu = _data_->_tmp2_;
	_data_->tpdulen = _data_->_tmp3_;
	_data_->_result_ = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->_result_;
	if (!_data_->_tmp5_) {
		_data_->_tmp6_ = ((FsoFrameworkAbstractObject*) _data_->self)->logger;
		_data_->_tmp7_ = _data_->index;
		_data_->_tmp8_ = NULL;
		_data_->_tmp8_ = g_strdup_printf ("%u", _data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = NULL;
		_data_->_tmp10_ = g_strconcat ("Could not read SMS message with index ", _data_->_tmp9_, " from SIM", NULL);
		_data_->_tmp11_ = _data_->_tmp10_;
		fso_framework_logger_error (_data_->_tmp6_, _data_->_tmp11_);
		_g_free0 (_data_->_tmp11_);
		_g_free0 (_data_->_tmp9_);
		_g_free0 (_data_->hexpdu);
		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;
	}
	_data_->_tmp12_ = _data_->hexpdu;
	_data_->_tmp13_ = _data_->tpdulen;
	_data_->_state_ = 2;
	_fso_gsm_abstract_sms_handler_handleIncomingSms (_data_->self, _data_->_tmp12_, _data_->_tmp13_, fso_gsm_abstract_sms_handler_handleIncomingSmsOnSim_ready, _data_);
	return FALSE;
	_state_2:
	_fso_gsm_abstract_sms_handler_handleIncomingSms_finish (_data_->self, _data_->_res_);
	_g_free0 (_data_->hexpdu);
	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;
}


static void fso_gsm_abstract_sms_handler_real_handleIncomingSms_data_free (gpointer _data) {
	fso_gsm_abstract_sms_handler_handleIncomingSmsData* _data_;
	_data_ = _data;
	_g_free0 (_data_->hexpdu);
	_g_object_unref0 (_data_->self);
	g_slice_free (fso_gsm_abstract_sms_handler_handleIncomingSmsData, _data_);
}


static void fso_gsm_abstract_sms_handler_real_handleIncomingSms (FsoGsmSmsHandler* base, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmAbstractSmsHandler * self;
	fso_gsm_abstract_sms_handler_handleIncomingSmsData* _data_;
	FsoGsmAbstractSmsHandler* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	self = (FsoGsmAbstractSmsHandler*) base;
	_data_ = g_slice_new0 (fso_gsm_abstract_sms_handler_handleIncomingSmsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_abstract_sms_handler_real_handleIncomingSms);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_abstract_sms_handler_real_handleIncomingSms_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = hexpdu;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->hexpdu = _tmp2_;
	_tmp3_ = tpdulen;
	_data_->tpdulen = _tmp3_;
	fso_gsm_abstract_sms_handler_real_handleIncomingSms_co (_data_);
}


static void fso_gsm_abstract_sms_handler_real_handleIncomingSms_finish (FsoGsmSmsHandler* base, GAsyncResult* _res_) {
	fso_gsm_abstract_sms_handler_handleIncomingSmsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void fso_gsm_abstract_sms_handler_handleIncomingSms_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	fso_gsm_abstract_sms_handler_handleIncomingSmsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	fso_gsm_abstract_sms_handler_real_handleIncomingSms_co (_data_);
}


static gboolean fso_gsm_abstract_sms_handler_real_handleIncomingSms_co (fso_gsm_abstract_sms_handler_handleIncomingSmsData* _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_->_state_ = 1;
	fso_gsm_abstract_sms_handler_acknowledgeSmsMessage (_data_->self, 0, fso_gsm_abstract_sms_handler_handleIncomingSms_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = FALSE;
	_data_->_tmp0_ = fso_gsm_abstract_sms_handler_acknowledgeSmsMessage_finish (_data_->self, _data_->_res_);
	_data_->_result_ = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->_result_;
	if (!_data_->_tmp1_) {
		_data_->_tmp2_ = ((FsoFrameworkAbstractObject*) _data_->self)->logger;
		fso_framework_logger_warning (_data_->_tmp2_, "Could not acknowledge incoming message");
	}
	_data_->_tmp3_ = _data_->hexpdu;
	_data_->_tmp4_ = _data_->tpdulen;
	_data_->_state_ = 2;
	_fso_gsm_abstract_sms_handler_handleIncomingSms (_data_->self, _data_->_tmp3_, _data_->_tmp4_, fso_gsm_abstract_sms_handler_handleIncomingSms_ready, _data_);
	return FALSE;
	_state_2:
	_fso_gsm_abstract_sms_handler_handleIncomingSms_finish (_data_->self, _data_->_res_);
	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;
}


static void fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport_data_free (gpointer _data) {
	fso_gsm_abstract_sms_handler_handleIncomingSmsReportData* _data_;
	_data_ = _data;
	_g_free0 (_data_->hexpdu);
	_g_object_unref0 (_data_->self);
	g_slice_free (fso_gsm_abstract_sms_handler_handleIncomingSmsReportData, _data_);
}


static void fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport (FsoGsmSmsHandler* base, const gchar* hexpdu, gint tpdulen, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	FsoGsmAbstractSmsHandler * self;
	fso_gsm_abstract_sms_handler_handleIncomingSmsReportData* _data_;
	FsoGsmAbstractSmsHandler* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	self = (FsoGsmAbstractSmsHandler*) base;
	_data_ = g_slice_new0 (fso_gsm_abstract_sms_handler_handleIncomingSmsReportData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = hexpdu;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->hexpdu = _tmp2_;
	_tmp3_ = tpdulen;
	_data_->tpdulen = _tmp3_;
	fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport_co (_data_);
}


static void fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport_finish (FsoGsmSmsHandler* base, GAsyncResult* _res_) {
	fso_gsm_abstract_sms_handler_handleIncomingSmsReportData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport_co (fso_gsm_abstract_sms_handler_handleIncomingSmsReportData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->hexpdu;
	_data_->_tmp1_ = _data_->tpdulen;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = sms_newFromHexPdu (_data_->_tmp0_, _data_->_tmp1_);
	_data_->sms = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->sms;
	if (_data_->_tmp3_ == NULL) {
		_data_->_tmp4_ = ((FsoFrameworkAbstractObject*) _data_->self)->logger;
		fso_framework_logger_warning (_data_->_tmp4_, "Can't parse SMS Status Report");
		_sms_free0 (_data_->sms);
		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;
	}
	_data_->_tmp5_ = _data_->sms;
	_data_->sms = NULL;
	_data_->_tmp6_ = _data_->_tmp5_;
	_fso_gsm_abstract_sms_handler_handleIncomingSmsReport (_data_->self, _data_->_tmp6_);
	_sms_free0 (_data_->_tmp6_);
	_sms_free0 (_data_->sms);
	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;
}


static void fso_gsm_abstract_sms_handler_real_storeTransactionIndizesForSentMessage (FsoGsmSmsHandler* base, GeeArrayList* hexpdus) {
	FsoGsmAbstractSmsHandler * self;
	FsoGsmISmsStorage* _tmp0_;
	FsoGsmISmsStorage* _tmp1_;
	GeeArrayList* _tmp2_;
	self = (FsoGsmAbstractSmsHandler*) base;
	g_return_if_fail (hexpdus != NULL);
	_tmp0_ = fso_gsm_sms_handler_get_storage ((FsoGsmSmsHandler*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = hexpdus;
	fso_gsm_isms_storage_storeTransactionIndizesForSentMessage (_tmp1_, _tmp2_);
}


static FsoGsmISmsStorage* fso_gsm_abstract_sms_handler_real_get_storage (FsoGsmSmsHandler* base) {
	FsoGsmISmsStorage* result;
	FsoGsmAbstractSmsHandler* self;
	FsoGsmISmsStorage* _tmp0_;
	self = (FsoGsmAbstractSmsHandler*) base;
	_tmp0_ = self->priv->_storage;
	result = _tmp0_;
	return result;
}


static void fso_gsm_abstract_sms_handler_real_set_storage (FsoGsmSmsHandler* base, FsoGsmISmsStorage* value) {
	FsoGsmAbstractSmsHandler* self;
	FsoGsmISmsStorage* _tmp0_;
	FsoGsmISmsStorage* _tmp1_;
	self = (FsoGsmAbstractSmsHandler*) base;
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_storage);
	self->priv->_storage = _tmp1_;
	g_object_notify ((GObject *) self, "storage");
}


static void fso_gsm_abstract_sms_handler_class_init (FsoGsmAbstractSmsHandlerClass * klass) {
	fso_gsm_abstract_sms_handler_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (FsoGsmAbstractSmsHandlerPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_fso_gsm_abstract_sms_handler_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_fso_gsm_abstract_sms_handler_set_property;
	G_OBJECT_CLASS (klass)->finalize = fso_gsm_abstract_sms_handler_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FSO_GSM_ABSTRACT_SMS_HANDLER_STORAGE, g_param_spec_object ("storage", "storage", "storage", FSO_GSM_TYPE_ISMS_STORAGE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void fso_gsm_abstract_sms_handler_fso_gsm_sms_handler_interface_init (FsoGsmSmsHandlerIface * iface) {
	fso_gsm_abstract_sms_handler_fso_gsm_sms_handler_parent_iface = g_type_interface_peek_parent (iface);
	iface->lastReferenceNumber = (guint16 (*)(FsoGsmSmsHandler*)) fso_gsm_abstract_sms_handler_real_lastReferenceNumber;
	iface->nextReferenceNumber = (guint16 (*)(FsoGsmSmsHandler*)) fso_gsm_abstract_sms_handler_real_nextReferenceNumber;
	iface->formatTextMessage = (GeeArrayList* (*)(FsoGsmSmsHandler*, const gchar*, const gchar*, gboolean)) fso_gsm_abstract_sms_handler_real_formatTextMessage;
	iface->handleIncomingSmsOnSim = (void (*)(FsoGsmSmsHandler*, guint)) fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim;
	iface->handleIncomingSmsOnSim_finish = fso_gsm_abstract_sms_handler_real_handleIncomingSmsOnSim_finish;
	iface->handleIncomingSms = (void (*)(FsoGsmSmsHandler*, const gchar*, gint)) fso_gsm_abstract_sms_handler_real_handleIncomingSms;
	iface->handleIncomingSms_finish = fso_gsm_abstract_sms_handler_real_handleIncomingSms_finish;
	iface->handleIncomingSmsReport = (void (*)(FsoGsmSmsHandler*, const gchar*, gint)) fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport;
	iface->handleIncomingSmsReport_finish = fso_gsm_abstract_sms_handler_real_handleIncomingSmsReport_finish;
	iface->storeTransactionIndizesForSentMessage = (void (*)(FsoGsmSmsHandler*, GeeArrayList*)) fso_gsm_abstract_sms_handler_real_storeTransactionIndizesForSentMessage;
	iface->get_storage = fso_gsm_abstract_sms_handler_real_get_storage;
	iface->set_storage = fso_gsm_abstract_sms_handler_real_set_storage;
}


static void fso_gsm_abstract_sms_handler_instance_init (FsoGsmAbstractSmsHandler * self) {
	self->priv = FSO_GSM_ABSTRACT_SMS_HANDLER_GET_PRIVATE (self);
}


static void fso_gsm_abstract_sms_handler_finalize (GObject* obj) {
	FsoGsmAbstractSmsHandler * self;
	self = FSO_GSM_ABSTRACT_SMS_HANDLER (obj);
	_g_object_unref0 (self->priv->_storage);
	G_OBJECT_CLASS (fso_gsm_abstract_sms_handler_parent_class)->finalize (obj);
}


/**
 * @class AbstractSmsHandler
 *
 * An abstract SMS message handler which implements most parts for handling
 * incoming and outgoing message and only requires an subclass to implement
 * the real actions like acknowledging a message.
 **/
GType fso_gsm_abstract_sms_handler_get_type (void) {
	static volatile gsize fso_gsm_abstract_sms_handler_type_id__volatile = 0;
	if (g_once_init_enter (&fso_gsm_abstract_sms_handler_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (FsoGsmAbstractSmsHandlerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) fso_gsm_abstract_sms_handler_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FsoGsmAbstractSmsHandler), 0, (GInstanceInitFunc) fso_gsm_abstract_sms_handler_instance_init, NULL };
		static const GInterfaceInfo fso_gsm_sms_handler_info = { (GInterfaceInitFunc) fso_gsm_abstract_sms_handler_fso_gsm_sms_handler_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType fso_gsm_abstract_sms_handler_type_id;
		fso_gsm_abstract_sms_handler_type_id = g_type_register_static (FSO_FRAMEWORK_TYPE_ABSTRACT_OBJECT, "FsoGsmAbstractSmsHandler", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_type_add_interface_static (fso_gsm_abstract_sms_handler_type_id, FSO_GSM_TYPE_SMS_HANDLER, &fso_gsm_sms_handler_info);
		g_once_init_leave (&fso_gsm_abstract_sms_handler_type_id__volatile, fso_gsm_abstract_sms_handler_type_id);
	}
	return fso_gsm_abstract_sms_handler_type_id__volatile;
}


static void _vala_fso_gsm_abstract_sms_handler_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	FsoGsmAbstractSmsHandler * self;
	self = FSO_GSM_ABSTRACT_SMS_HANDLER (object);
	switch (property_id) {
		case FSO_GSM_ABSTRACT_SMS_HANDLER_STORAGE:
		g_value_set_object (value, fso_gsm_sms_handler_get_storage ((FsoGsmSmsHandler*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_fso_gsm_abstract_sms_handler_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	FsoGsmAbstractSmsHandler * self;
	self = FSO_GSM_ABSTRACT_SMS_HANDLER (object);
	switch (property_id) {
		case FSO_GSM_ABSTRACT_SMS_HANDLER_STORAGE:
		fso_gsm_sms_handler_set_storage ((FsoGsmSmsHandler*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



