-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add unused annotations * Fix missing explicit casting issues * Remove "_" prefix from header guards and make them readable
- Loading branch information
Showing
6 changed files
with
37 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
#ifndef _SENSIRION_UPT_BLE_AUTO_DETECTION_BLECLIENTCALLBACK_H | ||
#define _SENSIRION_UPT_BLE_AUTO_DETECTION_BLECLIENTCALLBACK_H | ||
#ifndef SENSIRION_UPT_BLE_AUTO_DETECTION_BLE_CLIENT_CALLBACK_H | ||
#define SENSIRION_UPT_BLE_AUTO_DETECTION_BLE_CLIENT_CALLBACK_H | ||
|
||
class BleClientCallback { | ||
public: | ||
virtual ~BleClientCallback() { | ||
} | ||
virtual ~BleClientCallback() = default; | ||
|
||
virtual void onAdvertisementReceived(std::string address, std::string name, | ||
std::string data); | ||
std::string data) = 0; | ||
}; | ||
|
||
#endif /* _SENSIRION_UPT_BLE_AUTO_DETECTION_BLECLIENTCALLBACK_H */ | ||
#endif /* SENSIRION_UPT_BLE_AUTO_DETECTION_BLE_CLIENT_CALLBACK_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
#ifndef _SENSIRION_UPT_BLE_AUTO_DETECTION_NIMBLECLIENT_H | ||
#define _SENSIRION_UPT_BLE_AUTO_DETECTION_NIMBLECLIENT_H | ||
#ifndef SENSIRION_UPT_BLE_AUTO_DETECTION_NIMBLE_CLIENT_H | ||
#define SENSIRION_UPT_BLE_AUTO_DETECTION_NIMBLE_CLIENT_H | ||
|
||
#include "BleClient.h" | ||
#include "NimBLEDevice.h" | ||
|
||
class NimBleClient: public BleClient, public NimBLEAdvertisedDeviceCallbacks { | ||
class __attribute__((unused)) NimBleClient | ||
: public BleClient, | ||
public NimBLEAdvertisedDeviceCallbacks { | ||
public: | ||
NimBleClient() : _bleScan(nullptr), _callback(nullptr){}; | ||
NimBleClient() : _bleScan(nullptr), _callback(nullptr) {}; | ||
void begin(BleClientCallback* callback) override; | ||
void keepAlive() override; | ||
|
||
private: | ||
NimBLEScan* _bleScan; | ||
BleClientCallback* _callback; | ||
void setupAndStartBleScans(); | ||
void onResult(NimBLEAdvertisedDevice* advertisedDevice); | ||
void onResult(NimBLEAdvertisedDevice* advertisedDevice) override; | ||
}; | ||
|
||
#endif /* _SENSIRION_UPT_BLE_AUTO_DETECTION_NIMBLECLIENT_H */ | ||
#endif /* SENSIRION_UPT_BLE_AUTO_DETECTION_NIMBLE_CLIENT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters