aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js')
-rw-r--r--Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js b/Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js
index 993c0e550..e521cdb5a 100644
--- a/Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js
+++ b/Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js
@@ -106,17 +106,16 @@ function GetSlotStatusMessage(slot, seq)
];
}
-function XfrBlockMessage(slot, seq)
+function XfrBlockMessage(slot, seq, apdu)
{
return [
CCID_PC_to_RDR_XfrBlock, //message type
- 5, 0, 0, 0, //length (05)
+ apdu.length, 0, 0, 0, //length: only for < 0xFF
slot,
seq,
0, //BWI
- 0, 0, //level parameter
- 0, 0xfd, 0, 0, 0 //message
- ];
+ 0, 0 //level parameter
+ ].concat(apdu);
}
@@ -140,6 +139,12 @@ function startTest()
},
function(callback) {
read(ccidInterface, 10, callback);
+ },
+ function(callback) {
+ write(ccidInterface, new Buffer(XfrBlockMessage(0, 4, [0x0, 0xFD, 0x0, 0x0, 0x0])), callback);
+ },
+ function(callback) {
+ read(ccidInterface, 10 + 2, callback);
}
]);
}