~indicator-network-developers/ofono/trunk.packaging

« back to all changes in this revision

Viewing changes to drivers/ifxmodem/ctm.c

  • Committer: Kalle Valo
  • Date: 2011-02-21 07:46:07 UTC
  • mfrom: (2738.1.2125)
  • Revision ID: kalle.valo@canonical.com-20110221074607-u4rocuj2p75kpht9
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#include "ifxmodem.h"
42
42
 
43
43
static const char *none_prefix[] = { NULL };
44
 
static const char *xctms_prefix[] = { "XCTMS:", NULL };
 
44
static const char *xctms_prefix[] = { "+XCTMS:", NULL };
45
45
 
46
46
struct ctm_data {
47
47
        GAtChat *chat;
65
65
 
66
66
        g_at_result_iter_init(&iter, result);
67
67
 
68
 
        if (g_at_result_iter_next(&iter, "XCTMS:") == FALSE)
 
68
        if (g_at_result_iter_next(&iter, "+XCTMS:") == FALSE)
69
69
                goto error;
70
70
 
71
71
        if (g_at_result_iter_next_number(&iter, &value) == FALSE)
88
88
        struct ctm_data *ctmd = ofono_ctm_get_data(ctm);
89
89
        struct cb_data *cbd = cb_data_new(cb, data);
90
90
 
91
 
        if (cbd == NULL)
92
 
                goto error;
93
 
 
94
91
        if (g_at_chat_send(ctmd->chat, "AT+XCTMS?", xctms_prefix,
95
92
                                xctms_query_cb, cbd, g_free) > 0)
96
93
                return;
97
94
 
98
 
error:
99
95
        g_free(cbd);
100
96
 
101
97
        CALLBACK_WITH_FAILURE(cb, -1, data);
121
117
        struct cb_data *cbd = cb_data_new(cb, data);
122
118
        char buf[20];
123
119
 
124
 
        if (cbd == NULL)
125
 
                goto error;
126
 
 
127
120
        /* Only FULL TTY mode enabled/disabled */
128
121
        snprintf(buf, sizeof(buf), "AT+XCTMS=%i", enable ? 1 : 0);
129
122
 
131
124
                                xctms_modify_cb, cbd, g_free) > 0)
132
125
                return;
133
126
 
134
 
error:
135
127
        g_free(cbd);
136
128
 
137
129
        CALLBACK_WITH_FAILURE(cb, data);