~ubuntu-branches/ubuntu/wily/ofono/wily-proposed

« back to all changes in this revision

Viewing changes to unit/test-mtkunsol.c

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Tony Espy, Vicamo Yang, Alfonso Sanchez-Beato
  • Date: 2015-02-04 09:18:00 UTC
  • mfrom: (1.3.30)
  • Revision ID: package-import@ubuntu.com-20150204091800-ptp0cyfidrf69ar1
Tags: 1.12.bzr6886+15.04.20150204-0ubuntu1
[ Tony Espy ]
* test/rilmodem/sim: add new SIM test scripts
* test: fix test-call-forwarding script (LP: #1396323)

[ Vicamo Yang ]
* mtkmodem, rilmodem: re-factor naming
  This change makes the naming of GRil, mtk_data,
  ofono_modem, and ril_data instances consistent.
* rilmodem: fix duplicate APPSTATE* constants
* gril: get rid of duplicate ringbuffer.h (LP: #1408250)
* mtk.c: use RIL_RADIO_POWER request for single slot modems

[ Alfonso Sanchez-Beato ]
* gril, unit, mtk.c: SIM mode and session ID fixes for arale
  For MTK modems, DUAL_SIM_MODE requests aren't necessary.  Also
  add session-id to SIM IO requests for newer MTK modems.
* rilmodem, mtk.c, ril.c: add auto-answer support
  This change adds auto-answer support which is triggered
  by usage of a special test SIM (MCC/MNC 001/01 or 001/001).
* mtkmodem, unit, mtk.c: support arale firmware switch
  This change will cause the correct modem firmware to
  be loaded based upon the SIM MCC and MNC.  If new
  firmware is loaded, a modem reset is triggered.
* mtkmodem, unit, mtk.c: handle suspend events
  RIL_RESUME_REGISTRATION requests are not sent to
  MTK modems if suspend events are received.
* gril, include, mbpi, rilmodem, mtkmodem, rilmodem,
  gprs, unit, modem, ril.c, mtk.c: LTE updates
  This changes detection logic for LTE modems to rilmodem
  ( via an environment var ) and mtkmodem ( via a modem
  query ).  If detected, a RIL_INITIAL_ATTACH_APN request
  is not sent to the modem during gprs initialization.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
        .error = 0,
73
73
};
74
74
 
 
75
/*
 
76
 * The following hexadecimal data represents a serialized Binder parcel instance
 
77
 * containing a valid MTK_RIL_UNSOL_RESPONSE_REGISTRATION_SUSPENDED message with
 
78
 * the following parameters:
 
79
 *
 
80
 * {1}
 
81
 */
 
82
static const guchar unsol_registration_suspended_parcel1[] = {
 
83
        0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00
 
84
};
 
85
 
 
86
static const struct ril_msg unsol_registration_suspended_valid_1 = {
 
87
        .buf = (gchar *) &unsol_registration_suspended_parcel1,
 
88
        .buf_len = sizeof(unsol_registration_suspended_parcel1),
 
89
        .unsolicited = TRUE,
 
90
        .req = MTK_RIL_UNSOL_RESPONSE_REGISTRATION_SUSPENDED,
 
91
        .serial_no = 0,
 
92
        .error = 0,
 
93
};
 
94
 
75
95
static void test_unsol_incoming_call_indication_valid(gconstpointer data)
76
96
{
77
97
        struct unsol_call_indication *unsol;
83
103
        g_mtk_unsol_free_call_indication(unsol);
84
104
}
85
105
 
 
106
static void test_unsol_registration_suspended_valid(gconstpointer data)
 
107
{
 
108
        int suspended;
 
109
 
 
110
        suspended = g_mtk_unsol_parse_registration_suspended(NULL,
 
111
                                                (struct ril_msg *) data);
 
112
 
 
113
        g_assert(suspended > 0);
 
114
}
 
115
 
86
116
#endif  /* LITTLE_ENDIAN */
87
117
 
88
118
int main(int argc, char **argv)
102
132
                                &unsol_incoming_call_indication_valid_1,
103
133
                                test_unsol_incoming_call_indication_valid);
104
134
 
 
135
        g_test_add_data_func("/testmtkunsol/network: "
 
136
                                "valid RESPONSE_REGISTRATION_SUSPENDED Test 1",
 
137
                                &unsol_registration_suspended_valid_1,
 
138
                                test_unsol_registration_suspended_valid);
 
139
 
105
140
#endif  /* LITTLE_ENDIAN */
106
141
 
107
142
        return g_test_run();