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

/*
 * Copyright (C) 2010  Antonio Ospite <ospite@studenti.unina.it>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

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

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

#include <glib.h>
#include <glib-object.h>
#include <fsogsm.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>


#define FREESCALE_NEPTUNE_TYPE_NEPTUNE_PLUS_CPIN (freescale_neptune_neptune_plus_cpin_get_type ())
#define FREESCALE_NEPTUNE_NEPTUNE_PLUS_CPIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FREESCALE_NEPTUNE_TYPE_NEPTUNE_PLUS_CPIN, FreescaleNeptuneNeptunePlusCPIN))
#define FREESCALE_NEPTUNE_NEPTUNE_PLUS_CPIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FREESCALE_NEPTUNE_TYPE_NEPTUNE_PLUS_CPIN, FreescaleNeptuneNeptunePlusCPINClass))
#define FREESCALE_NEPTUNE_IS_NEPTUNE_PLUS_CPIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FREESCALE_NEPTUNE_TYPE_NEPTUNE_PLUS_CPIN))
#define FREESCALE_NEPTUNE_IS_NEPTUNE_PLUS_CPIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FREESCALE_NEPTUNE_TYPE_NEPTUNE_PLUS_CPIN))
#define FREESCALE_NEPTUNE_NEPTUNE_PLUS_CPIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FREESCALE_NEPTUNE_TYPE_NEPTUNE_PLUS_CPIN, FreescaleNeptuneNeptunePlusCPINClass))

typedef struct _FreescaleNeptuneNeptunePlusCPIN FreescaleNeptuneNeptunePlusCPIN;
typedef struct _FreescaleNeptuneNeptunePlusCPINClass FreescaleNeptuneNeptunePlusCPINClass;
typedef struct _FreescaleNeptuneNeptunePlusCPINPrivate FreescaleNeptuneNeptunePlusCPINPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _FreescaleNeptuneNeptunePlusCPIN {
	FsoGsmPlusCPIN parent_instance;
	FreescaleNeptuneNeptunePlusCPINPrivate * priv;
};

struct _FreescaleNeptuneNeptunePlusCPINClass {
	FsoGsmPlusCPINClass parent_class;
};


static gpointer freescale_neptune_neptune_plus_cpin_parent_class = NULL;
static GType freescale_neptune_neptune_plus_cpin_type_id = 0;

GType freescale_neptune_neptune_plus_cpin_get_type (void) G_GNUC_CONST;
GType freescale_neptune_neptune_plus_cpin_register_type (GTypeModule * module);
enum  {
	FREESCALE_NEPTUNE_NEPTUNE_PLUS_CPIN_DUMMY_PROPERTY
};
gchar* freescale_neptune_neptune_plus_cpin_issue (FreescaleNeptuneNeptunePlusCPIN* self, gint pin_type, const gchar* pin);
FreescaleNeptuneNeptunePlusCPIN* freescale_neptune_neptune_plus_cpin_new (void);
FreescaleNeptuneNeptunePlusCPIN* freescale_neptune_neptune_plus_cpin_construct (GType object_type);
void freescale_neptune_registerCustomAtCommands (GeeHashMap* table);


gchar* freescale_neptune_neptune_plus_cpin_issue (FreescaleNeptuneNeptunePlusCPIN* self, gint pin_type, const gchar* pin) {
	gchar* result = NULL;
	gint _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pin != NULL, NULL);
	_tmp0_ = pin_type;
	_tmp1_ = pin;
	_tmp2_ = g_strdup_printf ("+CPIN=%d,\"%s\"", _tmp0_, _tmp1_);
	result = _tmp2_;
	return result;
}


FreescaleNeptuneNeptunePlusCPIN* freescale_neptune_neptune_plus_cpin_construct (GType object_type) {
	FreescaleNeptuneNeptunePlusCPIN * self = NULL;
	self = (FreescaleNeptuneNeptunePlusCPIN*) fso_gsm_plus_cpin_construct (object_type);
	return self;
}


FreescaleNeptuneNeptunePlusCPIN* freescale_neptune_neptune_plus_cpin_new (void) {
	return freescale_neptune_neptune_plus_cpin_construct (FREESCALE_NEPTUNE_TYPE_NEPTUNE_PLUS_CPIN);
}


static void freescale_neptune_neptune_plus_cpin_class_init (FreescaleNeptuneNeptunePlusCPINClass * klass) {
	freescale_neptune_neptune_plus_cpin_parent_class = g_type_class_peek_parent (klass);
}


static void freescale_neptune_neptune_plus_cpin_instance_init (FreescaleNeptuneNeptunePlusCPIN * self) {
}


/**
 * Modem violating GSM 07.07 here.
 *
 * Format seems to be +CPIN=<number>,"<PIN>", where 1 is PIN1, 2 may be PIN2 or PUK1
 **/
GType freescale_neptune_neptune_plus_cpin_get_type (void) {
	return freescale_neptune_neptune_plus_cpin_type_id;
}


GType freescale_neptune_neptune_plus_cpin_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (FreescaleNeptuneNeptunePlusCPINClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) freescale_neptune_neptune_plus_cpin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FreescaleNeptuneNeptunePlusCPIN), 0, (GInstanceInitFunc) freescale_neptune_neptune_plus_cpin_instance_init, NULL };
	freescale_neptune_neptune_plus_cpin_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_PLUS_CPIN, "FreescaleNeptuneNeptunePlusCPIN", &g_define_type_info, 0);
	return freescale_neptune_neptune_plus_cpin_type_id;
}


/**
 * Register all custom commands
 **/
void freescale_neptune_registerCustomAtCommands (GeeHashMap* table) {
	GeeHashMap* _tmp0_;
	FreescaleNeptuneNeptunePlusCPIN* _tmp1_;
	FreescaleNeptuneNeptunePlusCPIN* _tmp2_;
	g_return_if_fail (table != NULL);
	_tmp0_ = table;
	_tmp1_ = freescale_neptune_neptune_plus_cpin_new ();
	_tmp2_ = _tmp1_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, "+CPIN", (FsoGsmAtCommand*) _tmp2_);
	_g_object_unref0 (_tmp2_);
}



