Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
xtnctx authored Sep 15, 2023
1 parent 14b81da commit 715a8bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Arduino Nano 33 BLE Sense/ble_file_transfer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ BLEService service(FILE_TRANSFER_UUID("0000"));

// How big each transfer block can be. In theory this could be up to 512 bytes, but
// in practice I've found that going over 128 affects reliability of the connection.
constexpr int32_t file_block_byte_count = 128;
constexpr int32_t file_block_byte_count = 20;

// Where each data block is written to during the transfer.
BLECharacteristic file_block_characteristic(FILE_TRANSFER_UUID("3000"), BLEWrite, file_block_byte_count);
Expand Down Expand Up @@ -227,9 +227,9 @@ void onFileTransferComplete() {
in_progress_bytes_received = 0;
in_progress_bytes_expected = 0;

notifySuccess();

onBLEFileReceived(finished_file_buffer, finished_file_buffer_byte_count);

notifySuccess();
}

void onFileBlockWritten(BLEDevice central, BLECharacteristic characteristic) {
Expand Down Expand Up @@ -275,7 +275,7 @@ void onFileBlockWritten(BLEDevice central, BLECharacteristic characteristic) {
#ifdef ENABLE_LOGGING
Serial.print("Data received: length = ");
Serial.println(file_block_length);
Serial.println(String(string_buffer));
Serial.println(String((char*)string_buffer));
#endif // ENABLE_LOGGING

// Serial.println("string_buffer");
Expand Down

0 comments on commit 715a8bb

Please sign in to comment.