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 testBipCommand(command, expect) { michael@0: log("STK CMD " + JSON.stringify(command)); michael@0: michael@0: is(command.typeOfCommand, expect.typeOfCommand, expect.name); michael@0: is(command.options.text, expect.text, expect.name); michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: let tests = [ michael@0: {command: "d04b81030140018202818205074f70656e204944350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101", michael@0: func: testBipCommand, michael@0: expect: {name: "open_channel_1", michael@0: typeOfCommand: iccManager.STK_CMD_OPEN_CHANNEL, michael@0: text: "Open ID"}}, michael@0: {command: "d0448103014001820281820500350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101", michael@0: func: testBipCommand, michael@0: expect: {name: "open_channel_2", michael@0: typeOfCommand: iccManager.STK_CMD_OPEN_CHANNEL, michael@0: text: ""}}, michael@0: {command: "d05381030140018202818205094f70656e2049442031350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101d004000900b4", michael@0: func: testBipCommand, michael@0: expect: {name: "open_channel_3", michael@0: typeOfCommand: iccManager.STK_CMD_OPEN_CHANNEL, michael@0: text: "Open ID 1"}}, michael@0: {command: "d01b810301410082028121850a436c6f73652049442031d004000a00b4", michael@0: func: testBipCommand, michael@0: expect: {name: "close_channel_1", michael@0: typeOfCommand: iccManager.STK_CMD_CLOSE_CHANNEL, michael@0: text: "Close ID 1"}}, michael@0: {command: "d022810301420082028121850e5265636569766520446174612031b701c8d004000e00b4", michael@0: func: testBipCommand, michael@0: expect: {name: "receive_data_1", michael@0: typeOfCommand: iccManager.STK_CMD_RECEIVE_DATA, michael@0: text: "Receive Data 1"}}, michael@0: {command: "d026810301430182028121850b53656e6420446174612031b6080001020304050607d004000b00b4", michael@0: func: testBipCommand, michael@0: expect: {name: "send_data_1", michael@0: typeOfCommand: iccManager.STK_CMD_SEND_DATA, michael@0: text: "Send Data 1"}}, michael@0: ]; michael@0: michael@0: runNextTest();