aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2018-06-29 19:37:23 +1000
committerGitHub <noreply@github.com>2018-06-29 19:37:23 +1000
commit941bc1470d9fe8857352facb56f7a250c1809933 (patch)
treee98406a2fbe9a10df2f186adcac27ab1a9d02568 /Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js
parentbc57f4ea5afd29f2e0f0175d14cf1540b4408de8 (diff)
parent1e9e7bc8b88af32f466f7438a06fb8dc96b3035d (diff)
downloadlufa-941bc1470d9fe8857352facb56f7a250c1809933.tar.gz
lufa-941bc1470d9fe8857352facb56f7a250c1809933.tar.bz2
lufa-941bc1470d9fe8857352facb56f7a250c1809933.zip
Merge pull request #131 from kidbomb/feature-ccid-xfrblock
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);
}
]);
}