Code refactoring
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
// This is a personal academic project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: https://pvs-studio.com
|
||||
|
||||
#include "BluetoothDispatcher.hpp"
|
||||
|
||||
static DeviceConnectedCb deviceConnectedCallback = nullptr;
|
||||
@@ -11,7 +14,7 @@ BluetoothDispatcher::BluetoothDispatcher(BluetoothSerial *controller, const char
|
||||
_controller = controller;
|
||||
}
|
||||
|
||||
bool BluetoothDispatcher::initialize(bool loop_on_fail, int readTimeoutMS) {
|
||||
bool BluetoothDispatcher::initialize(volatile bool loop_on_fail, int readTimeoutMS) {
|
||||
_controller->enableSSP();
|
||||
_controller->onConfirmRequest([this](uint16_t pin) {
|
||||
_onConfirmRequest(pin);
|
||||
|
||||
@@ -25,7 +25,7 @@ typedef std::function<void(char *package)> NewPackageCallback;
|
||||
class BluetoothDispatcher {
|
||||
public:
|
||||
BluetoothDispatcher(BluetoothSerial *controller, const char *device_name = "Helicopter");
|
||||
bool initialize(bool loop_on_fail = true, int readTimeoutMS = 2);
|
||||
bool initialize(volatile bool loop_on_fail = true, int readTimeoutMS = 2);
|
||||
void tick();
|
||||
void onNewPackageReceived(NewPackageCallback newPackageReceivedCb);
|
||||
void onNewDeviceConnected(DeviceConnectedCb deviceConnectedCb);
|
||||
|
||||
Reference in New Issue
Block a user