Skip to content

Commit

Permalink
✨ (rc): Link BLE ResetFileRequested to FileReception ResetFile
Browse files Browse the repository at this point in the history
  • Loading branch information
YannLocatelli committed Dec 8, 2022
1 parent 6dedf46 commit 7c89c61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/RobotKit/include/RobotController.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class RobotController : public interface::RobotController
{
_service_file_exchange.onFilePathReceived(
[this](std::span<const char> path) { file_reception.setFilePath(path.data()); });
_service_file_exchange.onResetFileRequested([this] { file_reception.resetFile(); });
_service_file_exchange.onFileDataReceived(
[this](std::span<const uint8_t> buffer) { file_reception.onPacketReceived(buffer); });
_service_file_exchange.onFileSHA256Requested([this](std::span<const char> path) {
Expand All @@ -225,6 +226,7 @@ class RobotController : public interface::RobotController
_service_file_exchange.setFileExchangeState(false);

_service_file_exchange.onFilePathReceived(nullptr);
_service_file_exchange.onResetFileRequested(nullptr);
_service_file_exchange.onFileDataReceived(nullptr);
_service_file_exchange.onFileSHA256Requested(nullptr);
}
Expand Down
2 changes: 2 additions & 0 deletions spikes/lk_ble/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ auto main() -> int
service_file_exchange.onFilePathReceived(
[](std::span<const char> path) { file_reception_handler.setFilePath(path.data()); });

service_file_exchange.onResetFileRequested([] { file_reception_handler.resetFile(); });

service_file_exchange.onFileDataReceived(
[](std::span<const uint8_t> buffer) { file_reception_handler.onPacketReceived(buffer); });

Expand Down

0 comments on commit 7c89c61

Please sign in to comment.