Skip to content

Commit

Permalink
🔊 (BLEKit): Move back mtu change log to gatt event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed May 21, 2024
1 parent 7f9cf91 commit 980fcc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions libs/BLEKit/source/CoreGattServerEventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void CoreGattServerEventHandler::onMTUNegotiated(const std::function<void(uint16

void CoreGattServerEventHandler::onAttMtuChange(ble::connection_handle_t handle, uint16_t new_mtu)

Check warning on line 53 in libs/BLEKit/source/CoreGattServerEventHandler.cpp

View check run for this annotation

Codecov / codecov/patch

libs/BLEKit/source/CoreGattServerEventHandler.cpp#L53

Added line #L53 was not covered by tests
{
log_info("Negotiated MTU size: %i bytes", new_mtu);
if (_on_mtu_negotiated_callback != nullptr) {
_on_mtu_negotiated_callback(new_mtu);

Check warning on line 57 in libs/BLEKit/source/CoreGattServerEventHandler.cpp

View check run for this annotation

Codecov / codecov/patch

libs/BLEKit/source/CoreGattServerEventHandler.cpp#L55-L57

Added lines #L55 - L57 were not covered by tests
}
Expand Down
5 changes: 1 addition & 4 deletions spikes/lk_ble/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ auto main() -> int

blekit.onConnectionCallback([] { log_info("Connected !"); });
blekit.onDisconnectionCallback([] { log_info("Disconnected !"); });
blekit.onMTUNegotiated([](uint16_t new_mtu) {
log_info("Negotiated MTU size: %i bytes", new_mtu);
service_monitoring.setNegotiatedMtu(new_mtu);
});
blekit.onMTUNegotiated([](uint16_t new_mtu) { service_monitoring.setNegotiatedMtu(new_mtu); });

blekit.init();

Expand Down

0 comments on commit 980fcc1

Please sign in to comment.