Skip to content

Commit

Permalink
fix webble ATT_MTU bug
Browse files Browse the repository at this point in the history
  • Loading branch information
taichunmin committed Sep 5, 2023
1 parent 05b43f7 commit 69ff3d4
Show file tree
Hide file tree
Showing 4 changed files with 811 additions and 626 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ console.log(JSON.stringify(resp6)) // {"success":[1,1,1,1,... (truncated)]}
* [Mifare Classic 1k ev1 v3.2 | NXP](https://www.nxp.com/docs/en/data-sheet/MF1S50YYX_V1.pdf)
* [Mifare Classic 4k ev1 v3.2 | NXP](https://www.nxp.com/docs/en/data-sheet/MF1S70YYX_V1.pdf)
* [Mifare Identifcation Procedure - AN10833 | NXP](https://www.nxp.com/docs/en/application-note/AN10833.pdf)
* [MIFARE ISO/IEC 14443 PICC selection - AN10834 | NXP](https://www.nxp.com/docs/en/application-note/AN10834.pdf)
* [MIFARE product and handling of UIDs - AN10927 | NXP](https://www.nxp.com/docs/en/application-note/AN10927.pdf)
* [A 2018 practical guide to hacking NFC/RFID](https://smartlockpicking.com/slides/Confidence_A_2018_Practical_Guide_To_Hacking_RFID_NFC.pdf)
* [Magic Cards Notes](https://github.com/RfidResearchGroup/proxmark3/blob/master/doc/magic_cards_notes.md)
* [elechouse/PN532: NFC library for Arduino](https://github.com/elechouse/PN532)
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,32 @@
"web-serial-polyfill": "^1.0.14"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-terser": "^0.4.3",
"cross-env": "^7.0.3",
"dayjs": "^1.11.7",
"documentation": "^14.0.1",
"dotenv": "^16.0.3",
"eslint": "^8.37.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.0.0",
"dayjs": "^1.11.9",
"documentation": "^14.0.2",
"dotenv": "^16.3.1",
"eslint": "^8.48.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.0.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-pug": "^1.2.5",
"fast-glob": "^3.2.12",
"fast-glob": "^3.3.1",
"finalhandler": "^1.2.0",
"html-minifier": "^4.0.0",
"jest": "^29.5.0",
"jest": "^29.6.4",
"jstransformer-sass": "^1.0.0",
"livereload": "^0.9.3",
"lodash": "^4.17.21",
"node-watch": "^0.7.3",
"node-watch": "^0.7.4",
"pug": "^3.0.2",
"rollup": "^3.20.2",
"serialport": "^11.0.0",
"rollup": "^3.28.1",
"serialport": "^12.0.0",
"serve-static": "^1.15.0",
"web-streams-polyfill": "^3.2.1"
},
Expand Down
9 changes: 7 additions & 2 deletions src/plugin/WebbleAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,18 @@ export default class Pn532WebbleAdapter {
transform: async (pack, controller) => {
// https://stackoverflow.com/questions/38913743/maximum-packet-length-for-bluetooth-le
// 20 bytes are left for the attribute data
for (const chunk of pack.chunk(20)) controller.enqueue(chunk)
for (let i = 0; i < pack.length; i += 20) {
const buf1 = pack.subarray(i, i + 20)
const buf2 = new Packet(buf1.length)
buf2.set(buf1)
controller.enqueue(buf2)
}
},
})
pn532.tx.readable.pipeTo(new WritableStream({ // no wait
write: async chunk => {
if (!me.charWrite) throw new Error('me.charWrite can not be null')
await me.charWrite.writeValueWithResponse(chunk.buffer)
await me.charWrite.writeValueWithoutResponse(chunk.buffer)
},
}, new CountQueuingStrategy({ highWaterMark: 1 })))

Expand Down
Loading

0 comments on commit 69ff3d4

Please sign in to comment.