michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: MARIONETTE_HEAD_JS = "stk_helper.js"; michael@0: michael@0: function testLocalInfoLocation(cmd) { michael@0: log("STK CMD " + JSON.stringify(cmd)); michael@0: is(cmd.typeOfCommand, iccManager.STK_CMD_PROVIDE_LOCAL_INFO); michael@0: is(cmd.commandNumber, 0x01); michael@0: is(cmd.commandQualifier, iccManager.STK_LOCAL_INFO_LOCATION_INFO); michael@0: is(cmd.options.localInfoType, iccManager.STK_LOCAL_INFO_LOCATION_INFO); michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: function testLocalInfoImei(cmd) { michael@0: log("STK CMD " + JSON.stringify(cmd)); michael@0: is(cmd.typeOfCommand, iccManager.STK_CMD_PROVIDE_LOCAL_INFO); michael@0: is(cmd.commandNumber, 0x01); michael@0: is(cmd.commandQualifier, iccManager.STK_LOCAL_INFO_IMEI); michael@0: is(cmd.options.localInfoType, iccManager.STK_LOCAL_INFO_IMEI); michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: function testLocalInfoDate(cmd) { michael@0: log("STK CMD " + JSON.stringify(cmd)); michael@0: is(cmd.typeOfCommand, iccManager.STK_CMD_PROVIDE_LOCAL_INFO); michael@0: is(cmd.commandNumber, 0x01); michael@0: is(cmd.commandQualifier, iccManager.STK_LOCAL_INFO_DATE_TIME_ZONE); michael@0: is(cmd.options.localInfoType, iccManager.STK_LOCAL_INFO_DATE_TIME_ZONE); michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: function testLocalInfoLanguage(cmd) { michael@0: log("STK CMD " + JSON.stringify(cmd)); michael@0: is(cmd.typeOfCommand, iccManager.STK_CMD_PROVIDE_LOCAL_INFO); michael@0: is(cmd.commandNumber, 0x01); michael@0: is(cmd.commandQualifier, iccManager.STK_LOCAL_INFO_LANGUAGE); michael@0: is(cmd.options.localInfoType, iccManager.STK_LOCAL_INFO_LANGUAGE); michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: function testRefresh(cmd) { michael@0: log("STK CMD " + JSON.stringify(cmd)); michael@0: is(cmd.typeOfCommand, iccManager.STK_CMD_REFRESH); michael@0: is(cmd.commandNumber, 0x01); michael@0: is(cmd.commandQualifier, 0x01); michael@0: is(cmd.options, null); michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: function testTimerManagementStart(cmd) { michael@0: log("STK CMD " + JSON.stringify(cmd)); michael@0: is(cmd.typeOfCommand, iccManager.STK_CMD_TIMER_MANAGEMENT); michael@0: is(cmd.commandNumber, 0x01); michael@0: is(cmd.commandQualifier, iccManager.STK_TIMER_START); michael@0: is(cmd.options.timerAction, iccManager.STK_TIMER_START); michael@0: is(cmd.options.timerId, 0x01); michael@0: is(cmd.options.timerValue, (0x01 * 60 * 60) + (0x02 * 60) + 0x03); michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: function testTimerManagementDeactivate(cmd) { michael@0: log("STK CMD " + JSON.stringify(cmd)); michael@0: is(cmd.typeOfCommand, iccManager.STK_CMD_TIMER_MANAGEMENT); michael@0: is(cmd.commandNumber, 0x01); michael@0: is(cmd.commandQualifier, iccManager.STK_TIMER_DEACTIVATE); michael@0: is(cmd.options.timerAction, iccManager.STK_TIMER_DEACTIVATE); michael@0: is(cmd.options.timerId, 0x04); michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: function testTimerManagementGetCurrentValue(cmd) { michael@0: log("STK CMD " + JSON.stringify(cmd)); michael@0: is(cmd.typeOfCommand, iccManager.STK_CMD_TIMER_MANAGEMENT); michael@0: is(cmd.commandNumber, 0x01); michael@0: is(cmd.commandQualifier, iccManager.STK_TIMER_GET_CURRENT_VALUE); michael@0: is(cmd.options.timerAction, iccManager.STK_TIMER_GET_CURRENT_VALUE); michael@0: is(cmd.options.timerId, 0x08); michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: let tests = [ michael@0: {command: "d009810301260082028182", michael@0: func: testLocalInfoLocation}, michael@0: {command: "d009810301260182028182", michael@0: func: testLocalInfoImei}, michael@0: {command: "d009810301260382028182", michael@0: func: testLocalInfoDate}, michael@0: {command: "d009810301260482028182", michael@0: func: testLocalInfoLanguage}, michael@0: {command: "d011810301270082028182a40101a503102030", michael@0: func: testTimerManagementStart}, michael@0: {command: "d00c810301270182028182a40104", michael@0: func: testTimerManagementDeactivate}, michael@0: {command: "d00c810301270282028182a40108", michael@0: func: testTimerManagementGetCurrentValue}, michael@0: ]; michael@0: michael@0: runNextTest();