Browse Source
Merge pull request #695 from valpinkman/fix/error-in-ws
fix error throwing when exchanging apdus
master
Gaëtan Renaudeau
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
0 deletions
-
src/helpers/socket.js
|
|
@ -74,7 +74,9 @@ export const createDeviceSocket = (transport: Transport<*>, url: string) => |
|
|
|
for (const apdu of data) { |
|
|
|
const r: Buffer = await transport.exchange(Buffer.from(apdu, 'hex')) |
|
|
|
lastStatus = r.slice(r.length - 2) |
|
|
|
if (lastStatus.toString('hex') !== '9000') break |
|
|
|
} |
|
|
|
|
|
|
|
if (!lastStatus) { |
|
|
|
throw new DeviceSocketNoBulkStatus() |
|
|
|
} |
|
|
|