Skip to content

Commit 9630846

Browse files
authored
Merge pull request #4 from makermelissa/main
Allow BLE file transfer to work with files > 4K
2 parents c753acb + feccc81 commit 9630846

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

adafruit-ble-file-transfer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ const FLAG_DIRECTORY = 0x01;
2929
const BYTES_PER_WRITE = 20;
3030

3131
class FileTransferClient {
32-
constructor(bleDevice) {
32+
constructor(bleDevice, bufferSize=4096) {
3333
this._resolve = null;
3434
this._reject = null;
3535
this._command = ANY_COMMAND;
3636
this._offset = 0;
3737
// We have a ton of memory so just buffer everything :-)
38-
this._buffer = new Uint8Array(4096);
38+
this._buffer = new Uint8Array(bufferSize);
3939
this._transfer = null;
4040
this._device = bleDevice;
4141
bleDevice.addEventListener("gattserverdisconnected", this.onDisconnected.bind(this));

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"registry": "https://npm.pkg.github.com"
55
},
6-
"version": "0.9.1",
6+
"version": "1.0.0",
77
"description": "WebBluetooth library for transferring files over BLE",
88
"main": "adafruit-ble-file-transfer.js",
99
"dependencies": {

0 commit comments

Comments
 (0)