aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js
diff options
context:
space:
mode:
authorFilipe Rodrigues <filipepazrodrigues@gmail.com>2018-06-17 17:51:09 -0700
committerFilipe Rodrigues <filipepazrodrigues@gmail.com>2018-06-24 19:02:31 -0700
commit1e9e7bc8b88af32f466f7438a06fb8dc96b3035d (patch)
treee98406a2fbe9a10df2f186adcac27ab1a9d02568 /Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js
parentbc57f4ea5afd29f2e0f0175d14cf1540b4408de8 (diff)
downloadlufa-1e9e7bc8b88af32f466f7438a06fb8dc96b3035d.tar.gz
lufa-1e9e7bc8b88af32f466f7438a06fb8dc96b3035d.tar.bz2
lufa-1e9e7bc8b88af32f466f7438a06fb8dc96b3035d.zip
CCID: Add support for PC-to-Reader XfrBlock message
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);
}
]);
}