Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yann/feature/ble/allow larger packet reception #1356

Merged
merged 3 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/mbed_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"bluenrg_ms.SPI_nCS": "BLE_SPI_NSS",
"bluenrg_ms.SPI_SCK": "BLE_SPI_SCK",
"cordio.desired-att-mtu": 251,
"cordio.rx-acl-buffer-size": 259,
"cordio.max-prepared-writes": 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YannLocatelli can you explain why the default value of 4 was not working and why the value of 1 is better?

my understanding is that a lower value might impact the efficiency of operations requiring multiple attribute writes.

is 1 used to avoid more than one thing happening at once? and to make sure each command are processed one at a time?

can you explain the issue you were encountering?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked about it few months ago, with value of 4 it works but we have to handle it differently.

You receive 4 packets at the same time in the robot and since you write directly in the file the data you received, you have to handle writing + ordering at the same time
I tried some solutions but never succeed, if you have any idea, let me know.

"sd.SPI_CS": "SD_SPI_CS",
"sd.SPI_MISO": "SD_SPI_MISO",
"sd.SPI_MOSI": "SD_SPI_MOSI",
Expand Down
4 changes: 2 additions & 2 deletions libs/BLEKit/include/BLEServiceFileExchange.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ class BLEServiceFileExchange : public interface::BLEService
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY};
std::function<void()> _on_clear_file_requested_callback {};

std::array<uint8_t, 128> file_reception_buffer {};
WriteOnlyArrayGattCharacteristic<uint8_t, 128> file_reception_buffer_characteristic {
std::array<uint8_t, 256> file_reception_buffer {};
WriteOnlyArrayGattCharacteristic<uint8_t, 256> file_reception_buffer_characteristic {
service::file_exchange::characteristic::file_reception_buffer, file_reception_buffer.begin()};

std::array<uint8_t, 32> file_sha256 {};
Expand Down
2 changes: 1 addition & 1 deletion libs/FileManagerKit/include/FileReception.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class FileReception
CoreEventQueue event_queue {};

CircularQueue<uint8_t, 1024> _circular_queue {};
std::array<uint8_t, 128> _buffer {};
std::array<uint8_t, 256> _buffer {};
};

} // namespace leka
Loading