2012-12-05 07:58:07 +00:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
2013-10-25 08:20:05 +00:00
|
|
|
MARIONETTE_HEAD_JS = "stk_helper.js";
|
2012-12-05 07:58:07 +00:00
|
|
|
|
2012-11-26 08:37:35 +00:00
|
|
|
function testLocalInfoLocation(cmd) {
|
|
|
|
log("STK CMD " + JSON.stringify(cmd));
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.typeOfCommand, iccManager.STK_CMD_PROVIDE_LOCAL_INFO);
|
2012-11-26 08:37:35 +00:00
|
|
|
is(cmd.commandNumber, 0x01);
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.commandQualifier, iccManager.STK_LOCAL_INFO_LOCATION_INFO);
|
|
|
|
is(cmd.options.localInfoType, iccManager.STK_LOCAL_INFO_LOCATION_INFO);
|
2012-11-26 08:37:35 +00:00
|
|
|
|
|
|
|
runNextTest();
|
|
|
|
}
|
|
|
|
|
|
|
|
function testLocalInfoImei(cmd) {
|
|
|
|
log("STK CMD " + JSON.stringify(cmd));
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.typeOfCommand, iccManager.STK_CMD_PROVIDE_LOCAL_INFO);
|
2012-11-26 08:37:35 +00:00
|
|
|
is(cmd.commandNumber, 0x01);
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.commandQualifier, iccManager.STK_LOCAL_INFO_IMEI);
|
|
|
|
is(cmd.options.localInfoType, iccManager.STK_LOCAL_INFO_IMEI);
|
2012-11-26 08:37:35 +00:00
|
|
|
|
|
|
|
runNextTest();
|
|
|
|
}
|
|
|
|
|
|
|
|
function testLocalInfoDate(cmd) {
|
|
|
|
log("STK CMD " + JSON.stringify(cmd));
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.typeOfCommand, iccManager.STK_CMD_PROVIDE_LOCAL_INFO);
|
2012-11-26 08:37:35 +00:00
|
|
|
is(cmd.commandNumber, 0x01);
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.commandQualifier, iccManager.STK_LOCAL_INFO_DATE_TIME_ZONE);
|
|
|
|
is(cmd.options.localInfoType, iccManager.STK_LOCAL_INFO_DATE_TIME_ZONE);
|
2012-11-26 08:37:35 +00:00
|
|
|
|
|
|
|
runNextTest();
|
|
|
|
}
|
|
|
|
|
|
|
|
function testLocalInfoLanguage(cmd) {
|
|
|
|
log("STK CMD " + JSON.stringify(cmd));
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.typeOfCommand, iccManager.STK_CMD_PROVIDE_LOCAL_INFO);
|
2012-11-26 08:37:35 +00:00
|
|
|
is(cmd.commandNumber, 0x01);
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.commandQualifier, iccManager.STK_LOCAL_INFO_LANGUAGE);
|
|
|
|
is(cmd.options.localInfoType, iccManager.STK_LOCAL_INFO_LANGUAGE);
|
2012-11-26 08:37:35 +00:00
|
|
|
|
|
|
|
runNextTest();
|
|
|
|
}
|
|
|
|
|
2012-12-10 10:07:36 +00:00
|
|
|
function testRefresh(cmd) {
|
|
|
|
log("STK CMD " + JSON.stringify(cmd));
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.typeOfCommand, iccManager.STK_CMD_REFRESH);
|
2012-12-10 10:07:36 +00:00
|
|
|
is(cmd.commandNumber, 0x01);
|
|
|
|
is(cmd.commandQualifier, 0x01);
|
|
|
|
is(cmd.options, null);
|
|
|
|
|
|
|
|
runNextTest();
|
|
|
|
}
|
|
|
|
|
2012-12-07 06:55:12 +00:00
|
|
|
function testTimerManagementStart(cmd) {
|
|
|
|
log("STK CMD " + JSON.stringify(cmd));
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.typeOfCommand, iccManager.STK_CMD_TIMER_MANAGEMENT);
|
2012-12-07 06:55:12 +00:00
|
|
|
is(cmd.commandNumber, 0x01);
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.commandQualifier, iccManager.STK_TIMER_START);
|
|
|
|
is(cmd.options.timerAction, iccManager.STK_TIMER_START);
|
2012-12-07 06:55:12 +00:00
|
|
|
is(cmd.options.timerId, 0x01);
|
|
|
|
is(cmd.options.timerValue, (0x01 * 60 * 60) + (0x02 * 60) + 0x03);
|
|
|
|
|
|
|
|
runNextTest();
|
|
|
|
}
|
|
|
|
|
|
|
|
function testTimerManagementDeactivate(cmd) {
|
|
|
|
log("STK CMD " + JSON.stringify(cmd));
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.typeOfCommand, iccManager.STK_CMD_TIMER_MANAGEMENT);
|
2012-12-07 06:55:12 +00:00
|
|
|
is(cmd.commandNumber, 0x01);
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.commandQualifier, iccManager.STK_TIMER_DEACTIVATE);
|
|
|
|
is(cmd.options.timerAction, iccManager.STK_TIMER_DEACTIVATE);
|
2012-12-07 06:55:12 +00:00
|
|
|
is(cmd.options.timerId, 0x04);
|
|
|
|
|
|
|
|
runNextTest();
|
|
|
|
}
|
|
|
|
|
|
|
|
function testTimerManagementGetCurrentValue(cmd) {
|
|
|
|
log("STK CMD " + JSON.stringify(cmd));
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.typeOfCommand, iccManager.STK_CMD_TIMER_MANAGEMENT);
|
2012-12-07 06:55:12 +00:00
|
|
|
is(cmd.commandNumber, 0x01);
|
2013-10-31 04:14:45 +00:00
|
|
|
is(cmd.commandQualifier, iccManager.STK_TIMER_GET_CURRENT_VALUE);
|
|
|
|
is(cmd.options.timerAction, iccManager.STK_TIMER_GET_CURRENT_VALUE);
|
2012-12-07 06:55:12 +00:00
|
|
|
is(cmd.options.timerId, 0x08);
|
|
|
|
|
|
|
|
runNextTest();
|
|
|
|
}
|
|
|
|
|
2012-12-05 07:58:07 +00:00
|
|
|
let tests = [
|
2012-11-26 08:37:35 +00:00
|
|
|
{command: "d009810301260082028182",
|
|
|
|
func: testLocalInfoLocation},
|
|
|
|
{command: "d009810301260182028182",
|
|
|
|
func: testLocalInfoImei},
|
|
|
|
{command: "d009810301260382028182",
|
|
|
|
func: testLocalInfoDate},
|
|
|
|
{command: "d009810301260482028182",
|
|
|
|
func: testLocalInfoLanguage},
|
2012-12-07 06:55:12 +00:00
|
|
|
{command: "d011810301270082028182a40101a503102030",
|
|
|
|
func: testTimerManagementStart},
|
|
|
|
{command: "d00c810301270182028182a40104",
|
|
|
|
func: testTimerManagementDeactivate},
|
|
|
|
{command: "d00c810301270282028182a40108",
|
|
|
|
func: testTimerManagementGetCurrentValue},
|
2013-08-16 02:14:17 +00:00
|
|
|
];
|
2012-12-05 07:58:07 +00:00
|
|
|
|
|
|
|
runNextTest();
|