My Project
Loading...
Searching...
No Matches
SBrickHub Class Reference

#include <SBrickHub.h>

Inheritance diagram for SBrickHub:
Collaboration diagram for SBrickHub:

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)
 
BLEHubChannelControllerfindControllerByChannel (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
 

Constructor & Destructor Documentation

◆ SBrickHub()

SBrickHub::SBrickHub ( BLEHubConfiguration * config)

Member Function Documentation

◆ DriveTaskLoop()

void SBrickHub::DriveTaskLoop ( )
virtual

Implements BLEHub.

Here is the call graph for this function:

◆ MapPwrPercToRaw()

int16_t SBrickHub::MapPwrPercToRaw ( int pwrPerc)
virtual

Implements BLEHub.

◆ NotifyCallback()

void SBrickHub::NotifyCallback ( NimBLERemoteCharacteristic * pBLERemoteCharacteristic,
uint8_t * pData,
size_t length,
bool isNotify )
virtual

Callback function for notifications of a specific characteristic.

Parameters
[in]pBLERemoteCharacteristicThe pointer to the characteristic
[in]pDataThe pointer to the received data
[in]lengthThe length of the data array
[in]isNotify

Implements BLEHub.

◆ SetWatchdogTimeout()

bool SBrickHub::SetWatchdogTimeout ( const uint8_t watchdogTimeOutInTensOfSeconds)
virtual

Implements BLEHub.

Here is the call graph for this function:

The documentation for this class was generated from the following files: