From fbfb7f895362331532e9cc4d7f02c8ffcf6b061e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 29 Apr 2010 18:57:49 -0700 Subject: [PATCH] novatel: let generic CDMA class handle signal strength while connected Instead of returning an unhelpful error when there isn't a second AT port (which there never will be for Novatel CDMA devices) we should let the superclass handle the request. --- plugins/mm-modem-novatel-cdma.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/mm-modem-novatel-cdma.c b/plugins/mm-modem-novatel-cdma.c index bf747d1a..64ee15f2 100644 --- a/plugins/mm-modem-novatel-cdma.c +++ b/plugins/mm-modem-novatel-cdma.c @@ -143,15 +143,18 @@ get_signal_quality (MMModemCdma *modem, { MMCallbackInfo *info; MMAtSerialPort *port; + MMModemCdma *parent_iface; - info = mm_callback_info_uint_new (MM_MODEM (modem), callback, user_data); - - port = mm_generic_cdma_get_best_at_port (MM_GENERIC_CDMA (modem), &info->error); + port = mm_generic_cdma_get_best_at_port (MM_GENERIC_CDMA (modem), NULL); if (!port) { - mm_callback_info_schedule (info); + /* Let the superclass handle it */ + parent_iface = g_type_interface_peek_parent (MM_MODEM_CDMA_GET_INTERFACE (modem)); + parent_iface->get_signal_quality (MM_MODEM_CDMA (modem), callback, user_data); return; } + info = mm_callback_info_uint_new (MM_MODEM (modem), callback, user_data); + /* Many Novatel CDMA cards don't report CSQ in standard 0 - 31 and the CSQ * reply doesn't appear to be in positive dBm either; instead try the custom * Novatel command for it.