Skip to content

Commit

Permalink
Update ChainableGattServerEventHandler to be consistent with const re…
Browse files Browse the repository at this point in the history
…ference parameters
  • Loading branch information
AGlass0fMilk committed Oct 9, 2020
1 parent 606dff9 commit 10f64b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,31 @@ class ChainableGattServerEventHandler : public ble::GattServer::EventHandler,
connectionHandle, attMtuSize);
}

void onDataSent(const GattDataSentCallbackParams* params) override {
void onDataSent(const GattDataSentCallbackParams &params) override {
execute_on_all(&ble::GattServer::EventHandler::onDataSent, params);
}

void onDataWritten(const GattWriteCallbackParams *params) override {
void onDataWritten(const GattWriteCallbackParams &params) override {
execute_on_all(&ble::GattServer::EventHandler::onDataWritten, params);
}

void onDataRead(const GattReadCallbackParams *params) override {
void onDataRead(const GattReadCallbackParams &params) override {
execute_on_all(&ble::GattServer::EventHandler::onDataRead, params);
}

void onShutdown(const GattServer *server) override {
void onShutdown(const GattServer &server) override {
execute_on_all(&ble::GattServer::EventHandler::onShutdown, server);
}

void onUpdatesEnabled(const GattUpdatesEnabledCallbackParams* params) override {
void onUpdatesEnabled(const GattUpdatesEnabledCallbackParams &params) override {
execute_on_all(&ble::GattServer::EventHandler::onUpdatesEnabled, params);
}

void onUpdatesDisabled(const GattUpdatesDisabledCallbackParams* params) override {
void onUpdatesDisabled(const GattUpdatesDisabledCallbackParams &params) override {
execute_on_all(&ble::GattServer::EventHandler::onUpdatesDisabled, params);
}

void onConfirmationReceived(const GattConfirmationReceivedCallbackParams* params) override {
void onConfirmationReceived(const GattConfirmationReceivedCallbackParams &params) override {
execute_on_all(&ble::GattServer::EventHandler::onConfirmationReceived, params);
}

Expand Down
14 changes: 7 additions & 7 deletions connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ ble_error_t GattServer::reset(ble::GattServer* server)
{
/* Notify that the instance is about to shutdown */
if(eventHandler) {
eventHandler->onShutdown(server);
eventHandler->onShutdown(*server);
}

// Execute callbacks added with deprecated API
Expand Down Expand Up @@ -1487,7 +1487,7 @@ GattServer::EventHandler *GattServer::getEventHandler()
void GattServer::handleDataWrittenEvent(const GattWriteCallbackParams *params)
{
if(eventHandler) {
eventHandler->onDataWritten(params);
eventHandler->onDataWritten(*params);
}

// Execute callbacks added with deprecated API
Expand All @@ -1497,7 +1497,7 @@ void GattServer::handleDataWrittenEvent(const GattWriteCallbackParams *params)
void GattServer::handleDataReadEvent(const GattReadCallbackParams *params)
{
if(eventHandler) {
eventHandler->onDataRead(params);
eventHandler->onDataRead(*params);
}

// Execute callbacks added with deprecated API
Expand All @@ -1518,7 +1518,7 @@ void GattServer::handleEvent(
.connHandle = connHandle,
.attHandle = attributeHandle
});
eventHandler->onUpdatesEnabled(&params);
eventHandler->onUpdatesEnabled(params);
}

// Execute deprecated callback
Expand All @@ -1533,7 +1533,7 @@ void GattServer::handleEvent(
.connHandle = connHandle,
.attHandle = attributeHandle
});
eventHandler->onUpdatesDisabled(&params);
eventHandler->onUpdatesDisabled(params);
}

// Execute deprecated callback
Expand All @@ -1548,7 +1548,7 @@ void GattServer::handleEvent(
.connHandle = connHandle,
.attHandle = attributeHandle
});
eventHandler->onConfirmationReceived(&params);
eventHandler->onConfirmationReceived(params);
}

// Execute deprecated callback
Expand All @@ -1564,7 +1564,7 @@ void GattServer::handleEvent(
.connHandle = connHandle,
.attHandle = attributeHandle
});
eventHandler->onDataSent(&params);
eventHandler->onDataSent(params);
}

// Execute deprecated callback
Expand Down

0 comments on commit 10f64b3

Please sign in to comment.