[breaking] Refactor the BLE devices identification (#720)

* [breaking] Refactor the BLE devices identification

generalize the use of the mac address with : for the lists, white, black and internal identification
Move structures from config_BT.h to ZgatewayBT.ino
update doc

* Move minRssi to INO and optimizations

change Minrssi name to match other variable convention
Optimize the add of : to mac address
Reduce the use of abs()

Note: I cannot move BLEinterval to the ZgatewayBT.ino due to its use on main.ino
This commit is contained in:
Florian authored and GitHub committed 2020-08-04 12:03:22 -05:00
1 parent d4457f817a
commit 8d79bebab8
3 files changed
+67 -82

No files matched your search

+2 -22
View File
@@ -45,6 +45,8 @@ extern void MQTTtoBT(char* topicOri, JsonObject& RFdata);
# define TimeBtw_Read 55555 //define default time between 2 scans
#endif
unsigned int BLEinterval = TimeBtw_Read; //time between 2 scans
#ifndef pubKnownBLEServiceData
# define pubKnownBLEServiceData false // define true if you want to publish service data belonging to recognised sensors
#endif
@@ -65,28 +67,6 @@ extern void MQTTtoBT(char* topicOri, JsonObject& RFdata);
// if not commented Home presence integration with HOME ASSISTANT is activated
#define subjectHomePresence "home_presence/" // will send Home Assistant room presence message to this topic (first part is same for all rooms, second is room name)
unsigned int BLEinterval = TimeBtw_Read; //time between 2 scans
int Minrssi = MinimumRSSI; //minimum rssi value
struct BLEdevice {
char macAdr[13];
bool isDisc;
bool isWhtL;
bool isBlkL;
};
#define device_flags_isDisc 1 << 0
#define device_flags_isWhiteL 1 << 1
#define device_flags_isBlackL 1 << 2
struct decompose {
char subject[4];
int start;
int len;
bool reverse;
char extract[60];
};
/*-------------------PIN DEFINITIONS----------------------*/
#if !defined(BT_RX) || !defined(BT_TX)
# ifdef ESP8266