1 From a2b5d447eb38825e0af9e57dde07b6e941d48389 Mon Sep 17 00:00:00 2001
2 From: Philippe Nunes <philippe.nunes@linux.intel.com>
3 Date: Wed, 26 Sep 2012 17:26:42 +0200
4 Subject: [PATCH 09/23] s_modem: Add XGENDATA query to get firmware
6 Content-Type: text/plain; charset="utf-8"
7 Content-Transfer-Encoding: 8bit
10 src/s_modem.c | 30 ++++++++++++++++++++++++++++++
11 1 file changed, 30 insertions(+)
13 diff --git a/src/s_modem.c b/src/s_modem.c
14 index 2c71457..22adfa3 100644
17 @@ -275,6 +275,33 @@ static void on_response_set_flight_mode(TcorePending *p, int data_len, const voi
18 tcore_at_tok_free(tokens);
21 +static void on_response_xgendata(TcorePending *p, int data_len, const void *data, void *user_data)
23 + const TcoreATResponse *resp = data;
24 + GSList *tokens = NULL;
27 + if (resp->success > 0) {
30 + line = (const char *) resp->lines->data;
31 + tokens = tcore_at_tok_new(line);
32 + if (g_slist_length(tokens) != 1) {
33 + msg("invalid message");
38 + dbg("XGENDATA = [%s]", g_slist_nth_data(tokens, 0));
43 + tcore_at_tok_free(tokens);
48 static void on_response_imei(TcorePending *p, int data_len, const void *data, void *user_data)
50 const TcoreATResponse *resp = data;
51 @@ -511,6 +538,9 @@ gboolean on_event_modem_power(TcoreAT *at, const char *line, TcorePlugin *p)
52 /* Get Version Number */
53 prepare_and_send_pending_request(p, "modem", "AT+CGMR", NULL, TCORE_AT_SINGLELINE, on_response_version);
55 + /* Get XGENDATA info */
56 + prepare_and_send_pending_request(p, "modem", "AT+XGENDATA", "+XGENDATA:", TCORE_AT_MULTILINE, on_response_xgendata);
58 tcore_modem_set_powered(o, TRUE);
60 modem_power.state = MODEM_STATE_ONLINE;