My Project
|
#include <SBrickHub.h>
Public Member Functions | |
SBrickHub (BLEHubConfiguration *config) | |
bool | SetWatchdogTimeout (const uint8_t watchdogTimeOutInTensOfSeconds) |
void | DriveTaskLoop () |
int16_t | MapPwrPercToRaw (int pwrPerc) |
void | NotifyCallback (NimBLERemoteCharacteristic *pBLERemoteCharacteristic, uint8_t *pData, size_t length, bool isNotify) |
Callback function for notifications of a specific characteristic. | |
Public Member Functions inherited from BLEHub | |
BLEHub (BLEHubConfiguration *config) | |
bool | IsDiscovered () |
bool | IsConnected () |
void | SetConnectCallback (std::function< void(bool)> callback) |
std::string | GetRawAddress () |
NimBLEAddress | GetAddress () |
void | Drive (const int16_t minPwrPerc, const int16_t pwrPerc) |
int16_t | GetCurrentDrivePwrPerc () |
void | Execute (MCLocoAction *action) |
void | BlinkLights (int durationInMs) |
void | SetHubLedColor (HubLedColor color) |
void | SetManualBrake (const bool enabled) |
void | SetEmergencyBrake (const bool enabled) |
bool | Connect (const uint8_t watchdogTimeOutInTensOfSeconds) |
Additional Inherited Members | |
Protected Member Functions inherited from BLEHub | |
void | initChannelControllers () |
void | dumpPData (uint8_t *pData, size_t length) |
void | setTargetPwrPercByAttachedDevice (DeviceType device, int16_t minPwrPerc, int16_t pwrPerc) |
HubLedColor | getRawLedColorForController (BLEHubChannelController *controller) |
uint8_t | getRawChannelPwrForController (BLEHubChannelController *controller) |
BLEHubChannelController * | findControllerByChannel (BLEHubChannel channel) |
bool | attachCharacteristic (NimBLEUUID serviceUUID, NimBLEUUID characteristicUUID) |
bool | startDriveTask () |
void | connected () |
void | disconnected () |
Static Protected Member Functions inherited from BLEHub | |
static void | driveTaskImpl (void *) |
Protected Attributes inherited from BLEHub | |
std::function< void(bool)> | _onConnectionChangedCallback |
BLEHubConfiguration * | _config |
std::vector< BLEHubChannelController * > | _channelControllers |
TaskHandle_t | _driveTaskHandle |
NimBLEAdvertisedDevice * | _advertisedDevice |
NimBLEAdvertisedDeviceCallbacks * | _advertisedDeviceCallback |
NimBLEClient * | _hub |
NimBLEClientCallbacks * | _clientCallback |
bool | _mbrake |
bool | _ebrake |
bool | _blinkLights |
ulong | _blinkUntil |
bool | _isDiscovered |
bool | _isConnected |
uint16_t | _watchdogTimeOutInTensOfSeconds |
NimBLERemoteService * | _remoteControlService |
NimBLERemoteCharacteristic * | _remoteControlCharacteristic |
SBrickHub::SBrickHub | ( | BLEHubConfiguration * | config | ) |
|
virtual |
|
virtual |
Implements BLEHub.
|
virtual |
Callback function for notifications of a specific characteristic.
[in] | pBLERemoteCharacteristic | The pointer to the characteristic |
[in] | pData | The pointer to the received data |
[in] | length | The length of the data array |
[in] | isNotify |
Implements BLEHub.
|
virtual |