Skip to content

Commit

Permalink
🚧 (EXPERIMENT): Fix sonarcloud issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas authored and YannLocatelli committed Feb 24, 2022
1 parent cd422e9 commit da9cc62
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
2 changes: 0 additions & 2 deletions libs/BLEKit/include/CoreGap.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class CoreGap

CoreGapEventHandler _gap_event_handler;
ble::Gap &_gap;

// std::function<void()> _post_init;
};

} // namespace leka
2 changes: 1 addition & 1 deletion libs/BLEKit/include/internal/BLEService.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class BLEService : public GattService
_callback_on_data_ready_to_send = callback;
};

void sendData(const data_to_send_handle_t &handle) { _callback_on_data_ready_to_send(handle); }
void sendData(const data_to_send_handle_t &handle) const { _callback_on_data_ready_to_send(handle); }

private:
std::function<void(const data_to_send_handle_t &)> _callback_on_data_ready_to_send {};
Expand Down
4 changes: 0 additions & 4 deletions libs/BLEKit/source/CoreGap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ void CoreGap::setEventHandler()
void CoreGap::onInitializationComplete(BLE::InitializationCompleteCallbackContext *params)
{
_gap_event_handler.onInitializationComplete(params);

// if (_post_init) {
// _post_init();
// }
}

void CoreGap::setDeviceName(const char *name)
Expand Down
2 changes: 1 addition & 1 deletion libs/BLEKit/source/CoreGattServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ void CoreGattServer::setServices(std::span<interface::BLEService *> services)

void CoreGattServer::write(GattAttribute::Handle_t characteristic_updated, std::span<const uint8_t> data)
{
_gatt_server.write(characteristic_updated, data.data(), std::size(data));
_gatt_server.write(characteristic_updated, data.data(), static_cast<uint16_t>(std::size(data)));
}
5 changes: 3 additions & 2 deletions spikes/lk_ble/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using namespace leka;
using namespace std::chrono;

auto level = 0;
auto level = uint8_t {0};
auto service_battery = BLEServiceBattery {};

auto services = std::to_array<interface::BLEService *>({&service_battery});
Expand All @@ -33,6 +33,7 @@ auto main() -> int
log_info("Main thread running...");
rtos::ThisThread::sleep_for(5s);

service_battery.setBatteryLevel(level++);
service_battery.setBatteryLevel(level);
++level;
}
}

0 comments on commit da9cc62

Please sign in to comment.