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

#include <BuWizz2Hub.h>

Inheritance diagram for BuWizz2Hub:
Collaboration diagram for BuWizz2Hub:

Public Member Functions

 BuWizz2Hub (BLEHubConfiguration *config)
 
bool SetWatchdogTimeout (const uint8_t watchdogTimeOutInTensOfSeconds)
 
void DriveTaskLoop ()
 
int16_t MapPwrPercToRaw (int pwrPerc)
 
void setPowerLevel (uint8_t newLevel)
 
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)
 

Public Attributes

double batteryVoltage
 
uint8_t status
 
uint8_t powerLevel
 
uint8_t defaultPowerLevel
 

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

◆ BuWizz2Hub()

BuWizz2Hub::BuWizz2Hub ( BLEHubConfiguration * config)

Member Function Documentation

◆ DriveTaskLoop()

void BuWizz2Hub::DriveTaskLoop ( )
virtual

Implements BLEHub.

Here is the call graph for this function:

◆ MapPwrPercToRaw()

int16_t BuWizz2Hub::MapPwrPercToRaw ( int pwrPerc)
virtual

Implements BLEHub.

◆ NotifyCallback()

void BuWizz2Hub::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.

Here is the call graph for this function:

◆ setPowerLevel()

void BuWizz2Hub::setPowerLevel ( uint8_t newLevel)

◆ SetWatchdogTimeout()

bool BuWizz2Hub::SetWatchdogTimeout ( const uint8_t watchdogTimeOutInTensOfSeconds)
virtual

Implements BLEHub.

Here is the call graph for this function:

Member Data Documentation

◆ batteryVoltage

double BuWizz2Hub::batteryVoltage

◆ defaultPowerLevel

uint8_t BuWizz2Hub::defaultPowerLevel

◆ powerLevel

uint8_t BuWizz2Hub::powerLevel

◆ status

uint8_t BuWizz2Hub::status

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