initial commit
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
#ifndef ChronoBLE_H
|
||||
#define ChronoBLE_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <NimBLEDevice.h>
|
||||
#include <GunProfile.h>
|
||||
|
||||
typedef void (*CallbackFunction)();
|
||||
|
||||
class ChronoBLE {
|
||||
public:
|
||||
enum ConnectionState {
|
||||
IDLE,
|
||||
SCANNING,
|
||||
DEVICE_FOUND,
|
||||
CONNECTING,
|
||||
CONNECTED
|
||||
};
|
||||
|
||||
// Constructor: Called when a ChronoBLE object is created
|
||||
ChronoBLE();
|
||||
|
||||
// Public methods
|
||||
ConnectionState currentState;
|
||||
void init();
|
||||
void startScan();
|
||||
bool isIdle();
|
||||
bool isConnected();
|
||||
bool foundDevice();
|
||||
bool connectToDevice();
|
||||
static void setDevice(const NimBLEAdvertisedDevice* device);
|
||||
static bool changeGunType(int type);
|
||||
void setSpeedCallback(void (*pFunc)(int speed));
|
||||
bool setSpeedProfile(uint8_t low, uint8_t high);
|
||||
|
||||
private:
|
||||
void _setState(ConnectionState state);
|
||||
void _disconnectDevice();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user