Skip to content

Commit

Permalink
fix(Connection): add override keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
leon0399 committed Dec 1, 2022
1 parent f8c6581 commit dfda604
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 26 deletions.
5 changes: 0 additions & 5 deletions firmware/connections/ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@ void BLEConnection::setup()

this->bleServer = BLEDevice::createServer();
}

void BLEConnection::loop()
{

}
4 changes: 3 additions & 1 deletion include/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

class Connection : public Component
{

public:
virtual void setup(void) {};
virtual void loop(void) {};
};
2 changes: 1 addition & 1 deletion include/connections/bhaptics.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ class BHapticsBLEConnection final : public BLEConnection
void (*motorTransformer)(std::string&);
public:
BHapticsBLEConnection(std::string deviceName, void (*motorTransformer)(std::string&)) : BLEConnection(deviceName), motorTransformer(motorTransformer) {};
void setup(void);
void setup(void) override;
};
37 changes: 18 additions & 19 deletions include/connections/ble.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
#pragma once

#include <string>

#include <BLEServer.h>

#include "config/bluetooth.h"
#include "connection.h"

class BLEConnection : public Connection
{
protected:
std::string deviceName;
BLEServer* bleServer = nullptr;
public:
BLEConnection(const std::string &deviceName) : deviceName(deviceName) {};
void setup(void) override;
void loop(void) override;
};
#pragma once

#include <string>

#include <BLEServer.h>

#include "config/bluetooth.h"
#include "connection.h"

class BLEConnection : public Connection
{
protected:
std::string deviceName;
BLEServer* bleServer = nullptr;
public:
BLEConnection(const std::string &deviceName) : deviceName(deviceName) {};
void setup(void) override;
};

0 comments on commit dfda604

Please sign in to comment.