Peter Becker 033a583f0a remove duplicate code in main\ZgatewayBT.ino (#557)
* merge duplicate code into function setWorBMac

* rename setWorBMac to updateWorB

* add helper getDeviceByMac

* change updateWorB to use helper getDeviceByMac

* change isWhite to use helper getDeviceByMac

* change isBlack to use helper getDeviceByMac

* change isDiscovered to use helper getDeviceByMac

* eliminate duplicate devices walk for isWhite, isBlack and isDiscovered check

* fix a data corruption race between MQTTtoBT and discovery-functions

the ***Discovery functions every time create a new device unless this device is set to white-list before. as a result of this, the devices list contains the same mac multiple times with different flags

* eliminate duplicate devices walk for oneWhite check

because now we have a utility function 'createOrUpdateDevice' we can globally cache this as a single flag

* secure createOrUpdateDevice agains data races on multicore esp32

* fix the concept of the createOrUpdateDevice

c / c++ does not allow NULL as function parameter like modern languages

* use nkolban Semaphore helper class (already included and used from eos1d3/ESP32_BLE librarie)

this makes the semaphore handling more cleaner and readable

* merge duplicate code during createDiscovery into new helper createDiscoveryFromList

* replace excessive use of ZmqttDiscovery precompiler directive in ble advertised callbacks with dummy functions

for a better readability we can remove this because isDiscovered does not do a devices walk anymore

* fix build errors found by travis-ci
2020-03-02 13:54:53 -06:00
2020-02-12 21:58:15 +01:00
2020-02-12 22:36:08 +01:00
2019-07-18 22:45:45 +02:00
2018-04-29 21:41:37 +02:00
2017-07-01 22:17:29 +02:00
2017-06-02 22:11:14 +02:00
2019-10-30 22:15:40 +01:00
2019-10-30 22:15:40 +01:00
2020-02-12 21:58:15 +01:00

Community forum Build Status Codacy Badge Percentage of issues still open GitLicense Download count HitCount

Questions, support please don't open an issue, go first to the docs and if you not find your answer go to the community forum

OpenMQTTGateway

Download OpenMQTTGateway from the releases page

The reference sheet, with the list of all functions, pinouts is here

A list of supported devices is available here, door/window sensors, PIR sensors, smoke detectors, weather stations...

A list of compatible components to build your gateway is available here, nodemcu, esp32, emitters and receivers...

S
Description
No description provided
Readme GPL-3.0
72 MiB
0 Stars 1 Watchers 0 Forks
2026-10-29 20:50:05 +00:00
Languages
C++ 76.1%
C 13.6%
Shell 7.2%
JavaScript 2.3%
Python 0.8%