Merge branch 'master' of git://gitorious.org/modemmanager/asacs-mbm
This commit is contained in:
@@ -51,6 +51,24 @@
|
||||
</arg>
|
||||
</method>
|
||||
|
||||
<method name="SendPuk">
|
||||
<tp:docstring>
|
||||
Send the PUK and a new PIN to unlock the SIM card.
|
||||
</tp:docstring>
|
||||
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
|
||||
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_gsm_modem_send_puk"/>
|
||||
<arg name="puk" type="s" direction="in">
|
||||
<tp:docstring>
|
||||
The PUK code.
|
||||
</tp:docstring>
|
||||
</arg>
|
||||
<arg name="pin" type="s" direction="in">
|
||||
<tp:docstring>
|
||||
The PIN code.
|
||||
</tp:docstring>
|
||||
</arg>
|
||||
</method>
|
||||
|
||||
<method name="SendPin">
|
||||
<tp:docstring>
|
||||
Send the PIN (or PUK) to unlock the SIM card.
|
||||
|
@@ -326,6 +326,35 @@ get_card_info (MMModemGsmCard *modem,
|
||||
mm_serial_queue_command (MM_SERIAL (modem), "+CGMR", 3, get_version_done, info);
|
||||
}
|
||||
|
||||
static void
|
||||
send_puk_done (MMSerial *serial,
|
||||
GString *response,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
||||
|
||||
if (error)
|
||||
info->error = g_error_copy (error);
|
||||
mm_callback_info_schedule (info);
|
||||
}
|
||||
|
||||
static void
|
||||
send_puk (MMModemGsmCard *modem,
|
||||
const char *puk,
|
||||
const char *pin,
|
||||
MMModemFn callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMCallbackInfo *info;
|
||||
char *command;
|
||||
|
||||
info = mm_callback_info_new (MM_MODEM (modem), callback, user_data);
|
||||
command = g_strdup_printf ("+CPIN=\"%s\",\"%s\"", puk, pin);
|
||||
mm_serial_queue_command (MM_SERIAL (modem), command, 3, send_puk_done, info);
|
||||
g_free (command);
|
||||
}
|
||||
|
||||
static void
|
||||
send_pin_done (MMSerial *serial,
|
||||
GString *response,
|
||||
@@ -1104,6 +1133,7 @@ modem_gsm_card_init (MMModemGsmCard *class)
|
||||
class->get_imsi = get_imsi;
|
||||
class->get_info = get_card_info;
|
||||
class->send_pin = send_pin;
|
||||
class->send_puk = send_puk;
|
||||
class->enable_pin = enable_pin;
|
||||
class->change_pin = change_pin;
|
||||
}
|
||||
|
@@ -19,6 +19,11 @@ static void impl_gsm_modem_send_pin (MMModemGsmCard *modem,
|
||||
const char *pin,
|
||||
DBusGMethodInvocation *context);
|
||||
|
||||
static void impl_gsm_modem_send_puk (MMModemGsmCard *modem,
|
||||
const char *puk,
|
||||
const char *pin,
|
||||
DBusGMethodInvocation *context);
|
||||
|
||||
static void impl_gsm_modem_enable_pin (MMModemGsmCard *modem,
|
||||
const char *pin,
|
||||
gboolean enabled,
|
||||
@@ -182,6 +187,24 @@ mm_modem_gsm_card_get_info (MMModemGsmCard *self,
|
||||
info_call_not_supported (self, callback, user_data);
|
||||
}
|
||||
|
||||
void
|
||||
mm_modem_gsm_card_send_puk (MMModemGsmCard *self,
|
||||
const char *puk,
|
||||
const char *pin,
|
||||
MMModemFn callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_return_if_fail (MM_IS_MODEM_GSM_CARD (self));
|
||||
g_return_if_fail (puk != NULL);
|
||||
g_return_if_fail (pin != NULL);
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
if (MM_MODEM_GSM_CARD_GET_INTERFACE (self)->send_puk)
|
||||
MM_MODEM_GSM_CARD_GET_INTERFACE (self)->send_puk (self, puk, pin, callback, user_data);
|
||||
else
|
||||
async_call_not_supported (self, callback, user_data);
|
||||
}
|
||||
|
||||
void
|
||||
mm_modem_gsm_card_send_pin (MMModemGsmCard *self,
|
||||
const char *pin,
|
||||
@@ -256,6 +279,15 @@ impl_gsm_modem_get_info (MMModemGsmCard *modem,
|
||||
mm_modem_gsm_card_get_info (modem, info_call_done, context);
|
||||
}
|
||||
|
||||
static void
|
||||
impl_gsm_modem_send_puk (MMModemGsmCard *modem,
|
||||
const char *puk,
|
||||
const char *pin,
|
||||
DBusGMethodInvocation *context)
|
||||
{
|
||||
mm_modem_gsm_card_send_puk (modem, puk, pin, async_call_done, context);
|
||||
}
|
||||
|
||||
static void
|
||||
impl_gsm_modem_send_pin (MMModemGsmCard *modem,
|
||||
const char *pin,
|
||||
|
@@ -35,6 +35,12 @@ struct _MMModemGsmCard {
|
||||
MMModemGsmCardInfoFn callback,
|
||||
gpointer user_data);
|
||||
|
||||
void (*send_puk) (MMModemGsmCard *self,
|
||||
const char *puk,
|
||||
const char *pin,
|
||||
MMModemFn callback,
|
||||
gpointer user_data);
|
||||
|
||||
void (*send_pin) (MMModemGsmCard *self,
|
||||
const char *pin,
|
||||
MMModemFn callback,
|
||||
@@ -67,6 +73,12 @@ void mm_modem_gsm_card_get_info (MMModemGsmCard *self,
|
||||
MMModemGsmCardInfoFn callback,
|
||||
gpointer user_data);
|
||||
|
||||
void mm_modem_gsm_card_send_puk (MMModemGsmCard *self,
|
||||
const char *puk,
|
||||
const char *pin,
|
||||
MMModemFn callback,
|
||||
gpointer user_data);
|
||||
|
||||
void mm_modem_gsm_card_send_pin (MMModemGsmCard *self,
|
||||
const char *pin,
|
||||
MMModemFn callback,
|
||||
|
Reference in New Issue
Block a user