My Project
Loading...
Searching...
No Matches
BLEHubConfiguration.h
Go to the documentation of this file.
1#pragma once
2
3#include <Arduino.h>
4
5#include "MCChannelConfig.h"
6#include "NimBLEAddress.h"
7#include <vector>
8
10 // Powered Up Hub (Lego).
12
13 // SBrick (Vengit).
15
16 // BuWizz2
18
19};
20
21// String switch paridgam
22struct bleHubTypeMap : public std::map<std::string, BLEHubType> {
24 {
25 this->operator[]("PU") = BLEHubType::PU;
26 this->operator[]("SBrick") = BLEHubType::SBrick;
27 this->operator[]("BuWizz2") = BLEHubType::BuWizz2;
28 };
30};
31
32// Map BuWizz2 powerlevel names to numers
33struct buwizzPowerMap : public std::map<std::string, uint8_t> {
35 {
36 this->operator[]("disabled") = 0;
37 this->operator[]("slow") = 1;
38 this->operator[]("normal") = 2;
39 this->operator[]("fast") = 3;
40 this->operator[]("ldcrs") = 4;
41 };
43};
44
46{
47 public:
48 BLEHubConfiguration(BLEHubType hubType, std::string deviceAddress, std::vector<MCChannelConfig *> channels,uint8_t powerlevel );
49
50 // Type of Hub.
52
53 // MAC address of the Hub.
54 NimBLEAddress *DeviceAddress;
55
56 // Hub channels.
57 std::vector<MCChannelConfig *> Channels;
58
59 //hub power level, only valid for BuWizz2, the rest is ignored
60 uint8_t powerLevel;
61};
BLEHubType
Definition BLEHubConfiguration.h:9
@ BuWizz2
Definition BLEHubConfiguration.h:17
@ SBrick
Definition BLEHubConfiguration.h:14
@ PU
Definition BLEHubConfiguration.h:11
Definition BLEHubConfiguration.h:46
BLEHubConfiguration(BLEHubType hubType, std::string deviceAddress, std::vector< MCChannelConfig * > channels, uint8_t powerlevel)
Definition BLEHubConfiguration.cpp:3
std::vector< MCChannelConfig * > Channels
Definition BLEHubConfiguration.h:57
BLEHubType HubType
Definition BLEHubConfiguration.h:51
NimBLEAddress * DeviceAddress
Definition BLEHubConfiguration.h:54
uint8_t powerLevel
Definition BLEHubConfiguration.h:60
Definition BLEHubConfiguration.h:22
bleHubTypeMap()
Definition BLEHubConfiguration.h:23
~bleHubTypeMap()
Definition BLEHubConfiguration.h:29
Definition BLEHubConfiguration.h:33
~buwizzPowerMap()
Definition BLEHubConfiguration.h:42
buwizzPowerMap()
Definition BLEHubConfiguration.h:34