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 testSendSMS(command, expect) { michael@0: log("STK CMD " + JSON.stringify(command)); michael@0: is(command.typeOfCommand, iccManager.STK_CMD_SEND_SMS, expect.name); michael@0: is(command.commandQualifier, expect.commandQualifier, expect.name); michael@0: if (command.options.text) { michael@0: is(command.options.text, expect.title, expect.name); michael@0: } michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: let tests = [ michael@0: {command: "d037810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d657373616765", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_1", michael@0: commandQualifier: 0x00, michael@0: title: "Send SM"}}, michael@0: {command: "d032810301130182028183850753656e6420534d86099111223344556677f88b130100099110325476f840f40753656e6420534d", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_2", michael@0: commandQualifier: 0x01, michael@0: title: "Send SM"}}, michael@0: {command: "d03d810301130082028183850d53686f7274204d65737361676586099111223344556677f88b180100099110325476f840f00d53f45b4e0735cbf379f85c06", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_3", michael@0: commandQualifier: 0x00, michael@0: title: "Short Message"}}, michael@0: {command: "d081fd810301130182028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052501144657374696e6174696f6e114164647265737386099111223344556677f88b81ac0100099110325476f840f4a054776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e7370", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_4", michael@0: commandQualifier: 0x01, michael@0: title: "The address data object holds the RP_Destination_Address"}}, michael@0: {command: "d081e9810301130082028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052502044657374696e6174696f6e204164647265737386099111223344556677f88b81980100099110325476f840f0a0d4fb1b44cfc3cb7350585e0691cbe6b4bb4cd6815aa020688e7ecbe9a076793e0f9fcb20fa1b242e83e665371d447f83e8e832c85da6dfdff23528ed0685dda06973da9a5685cd2415d42ecfe7e17399057acb41613768da9cb686cf6633e82482dae5f93c7c2eb3407774595e06d1d165507d5e9683c8617a18340ebb41e232081e9ecfcb64105d1e76cfe1", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_5", michael@0: commandQualifier: 0x00, michael@0: title: "The address data object holds the RP Destination Address"}}, michael@0: {command: "d081fd8103011300820281838581e654776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e73706172656e746c793b202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954208b09010002911040f00120", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_6", michael@0: commandQualifier: 0x00, michael@0: title: "Two types are defined: - A short message to be sent to the network in an SMS-SUBMIT message, or an SMS-COMMAND message, where the user data can be passed transparently; - A short message to be sent to the network in an SMS-SUBMIT "}}, michael@0: {command: "d030810301130082028183850086099111223344556677f88b180100099110325476f840f40c54657374204d657373616765", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_7", michael@0: commandQualifier: 0x00, michael@0: title: ""}}, michael@0: {command: "d05581030113008202818385198004170414042004100412042104220412042304190422041586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_8", michael@0: commandQualifier: 0x00, michael@0: title: "ЗДРАВСТВУЙТЕ"}}, michael@0: {command: "d04b810301130082028183850f810c089794a09092a1a292a399a29586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_9", michael@0: commandQualifier: 0x00, michael@0: title: "ЗДРАВСТВУЙТЕ"}}, michael@0: {command: "d04c8103011300820281838510820c041087849080829192829389928586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_9", michael@0: commandQualifier: 0x00, michael@0: title: "ЗДРАВСТВУЙТЕ"}}, michael@0: {command: "d03b81030113008202818385074e4f2049434f4e86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020001", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_10", michael@0: commandQualifier: 0x00, michael@0: title: "NO ICON"}}, michael@0: {command: "d03b810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167651e020101", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_11", michael@0: commandQualifier: 0x00, michael@0: title: "Send SM"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_12", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 1"}}, michael@0: {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_13", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 2"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001001b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_14", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 1"}}, michael@0: {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_15", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 2"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001002b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_16", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 1"}}, michael@0: {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_17", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 2"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001004b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_18", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 1"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_19", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 2"}}, michael@0: {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_20", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 3"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001008b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_21", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 1"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_22", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 2"}}, michael@0: {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_23", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 3"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001010b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_24", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 1"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_25", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 2"}}, michael@0: {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_26", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 3"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001020b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_27", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 1"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_28", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 2"}}, michael@0: {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_29", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 3"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001040b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_30", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 1"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_31", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 2"}}, michael@0: {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_32", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 3"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001080b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_33", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 1"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_34", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 2"}}, michael@0: {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_35", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 3"}}, michael@0: {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_36", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 1"}}, michael@0: {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_37", michael@0: commandQualifier: 0x00, michael@0: title: "Text Attribute 2"}}, michael@0: {command: "d02d8103011300820281838505804e2d4e0086099111223344556677f88b100100099110325476f84008044e2d4e00", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_38", michael@0: commandQualifier: 0x00, michael@0: title: "中一"}}, michael@0: {command: "d02d810301130082028183850581029cad8086099111223344556677f88b100100099110325476f84008044e2d4e00", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_39", michael@0: commandQualifier: 0x00, michael@0: title: "中一"}}, michael@0: {command: "d02e810301130082028183850682024e00ad8086099111223344556677f88b100100099110325476f84008044e2d4e00", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_40", michael@0: commandQualifier: 0x00, michael@0: title: "中一"}}, michael@0: {command: "d0358103011300820281838509800038003030eb003086099111223344556677f88b140100099110325476f84008080038003030eb0031", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_41", michael@0: commandQualifier: 0x00, michael@0: title: "80ル0"}}, michael@0: {command: "d03381030113008202818385078104613831eb3186099111223344556677f88b140100099110325476f84008080038003030eb0032", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_42", michael@0: commandQualifier: 0x00, michael@0: title: "81ル1"}}, michael@0: {command: "d0348103011300820281838508820430a03832cb3286099111223344556677f88b140100099110325476f84008080038003030eb0033", michael@0: func: testSendSMS, michael@0: expect: {name: "send_sms_cmd_43", michael@0: commandQualifier: 0x00, michael@0: title: "82ル2"}} michael@0: ]; michael@0: michael@0: runNextTest();