Revert "s_modem: Make "AT+CGMR" response parsing be compatible with the modem only...
authorNicolas Bertrand <nicolas.bertrand@linux.intel.com>
Wed, 13 Mar 2013 18:30:14 +0000 (19:30 +0100)
committerwootak.jung <wootak.jung@samsung.com>
Sun, 24 Mar 2013 07:46:41 +0000 (16:46 +0900)
This reverts commit d5ec4ae373aaf32efa264faf0d3fc0d8e2669fbc.

Change-Id: Id7c5b38dab875c401aa14b6a710f11e63d6d305f

src/s_modem.c

index dac6ca4..3ea6fc2 100644 (file)
@@ -164,7 +164,7 @@ void prepare_and_send_pending_request(TcorePlugin *plugin, char *co_name, const
        tcore_pending_set_request_data(pending, 0, req);
        tcore_pending_set_response_callback(pending, callback, NULL);
        tcore_pending_set_send_callback(pending, on_confirmation_modem_message_send, NULL);
-       tcore_pending_link_user_request(pending, NULL); // set user request to NULL - this is internal request
+       tcore_pending_link_user_request(pending, NULL); // set user request to NULL - this is intenal request
        ret = tcore_hal_send_request(hal, pending);
        return;
 }
@@ -186,13 +186,13 @@ void on_response_last_bootup_subscription(TcorePending *p, int data_len, const v
 {
        const TcoreATResponse *resp = data;
 
-       dbg("entry of on_response_last_bootup_subscription() - final response comes\n");
+       dbg("enry of on_response_last_bootup_subscription() - final response comes\n");
        if (resp->success) {
                dbg("SEND OK");
        } else {
                dbg("SEND FAIL");
        }
-       dbg("Boot-up configuration completed for IMC modem. Bring CP to online based on Flightmode status\n");
+       dbg("Response for AT+CLIP. Boot-up configration completed for IMC modem. Bring CP to online based on Flightmode status\n");
        on_event_modem_power(NULL, NULL, tcore_pending_ref_plugin(p));
 }
 
@@ -364,23 +364,20 @@ static void on_response_version(TcorePending *p, int data_len, const void *data,
                if (resp->lines) {
                        line = (const char *) resp->lines->data;
                        tokens = tcore_at_tok_new(line);
-                       if (g_slist_length(tokens) == 1) {
-                               swver = g_slist_nth_data(tokens, 0);
-                               dbg("version: sw=[%s]", swver);
-                       } else if (g_slist_length(tokens) == 5) {
-                               swver = g_slist_nth_data(tokens, 0);
-                               hwver = g_slist_nth_data(tokens, 1);
-                               caldate = g_slist_nth_data(tokens, 2);
-                               pcode = g_slist_nth_data(tokens, 3);
-                               id = g_slist_nth_data(tokens, 4);
-
-                               dbg("version: sw=[%s], hw=[%s], rf_cal=[%s], product_code=[%s], model_id=[%s]", swver, hwver, caldate, pcode, id);
-                       } else {
+                       if (g_slist_length(tokens) != 5) {
                                msg("invalid message");
                                goto OUT;
                        }
                }
 
+               swver = g_slist_nth_data(tokens, 0);
+               hwver = g_slist_nth_data(tokens, 1);
+               caldate = g_slist_nth_data(tokens, 2);
+               pcode = g_slist_nth_data(tokens, 3);
+               id = g_slist_nth_data(tokens, 4);
+
+               dbg("version: sw=[%s], hw=[%s], rf_cal=[%s], product_code=[%s], model_id=[%s]", swver, hwver, caldate, pcode, id);
+
                vi = calloc(sizeof(TelMiscVersionInformation), 1);
                if (NULL != swver)
                        memcpy(vi->szSwVersion, swver, strlen(swver));