From 469529985d8f6f79739a69efb020be1b36489666 Mon Sep 17 00:00:00 2001 From: Tambet Ingo Date: Fri, 20 Feb 2009 12:09:47 +0200 Subject: [PATCH] Use cached commands for things that never change (while the card is plugged). --- src/mm-generic-gsm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c index b13623cd..250b8cf6 100644 --- a/src/mm-generic-gsm.c +++ b/src/mm-generic-gsm.c @@ -270,7 +270,7 @@ get_imei (MMModemGsmCard *modem, MMCallbackInfo *info; info = mm_callback_info_string_new (MM_MODEM (modem), callback, user_data); - mm_serial_queue_command (MM_SERIAL (modem), "+CGSN", 3, get_string_done, info); + mm_serial_queue_command_cached (MM_SERIAL (modem), "+CGSN", 3, get_string_done, info); } static void @@ -281,7 +281,7 @@ get_imsi (MMModemGsmCard *modem, MMCallbackInfo *info; info = mm_callback_info_string_new (MM_MODEM (modem), callback, user_data); - mm_serial_queue_command (MM_SERIAL (modem), "+CIMI", 3, get_string_done, info); + mm_serial_queue_command_cached (MM_SERIAL (modem), "+CIMI", 3, get_string_done, info); } static void @@ -346,15 +346,16 @@ get_card_info (MMModemGsmCard *modem, gpointer user_data) { MMCallbackInfo *info; + MMSerial *serial = MM_SERIAL (modem); info = mm_callback_info_new_full (MM_MODEM (modem), gsm_card_info_invoke, G_CALLBACK (callback), user_data); - mm_serial_queue_command (MM_SERIAL (modem), "+CGMI", 3, get_manufacturer_done, info); - mm_serial_queue_command (MM_SERIAL (modem), "+CGMM", 3, get_model_done, info); - mm_serial_queue_command (MM_SERIAL (modem), "+CGMR", 3, get_version_done, info); + mm_serial_queue_command_cached (serial, "+CGMI", 3, get_manufacturer_done, info); + mm_serial_queue_command_cached (serial, "+CGMM", 3, get_model_done, info); + mm_serial_queue_command_cached (serial, "+CGMR", 3, get_version_done, info); } static void @@ -1080,7 +1081,7 @@ existing_apns_read (MMSerial *serial, mm_callback_info_schedule (info); else /* APN not configured on the card. Get the allowed CID range */ - mm_serial_queue_command (serial, "+CGDCONT=?", 3, cid_range_read, info); + mm_serial_queue_command_cached (serial, "+CGDCONT=?", 3, cid_range_read, info); } static void