forked from tbnobody/OpenDTU
-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bind the callback to a topic (enum value) such that there is no need to tokenize the full topic (string) to find out what value is being processed. tokenizing is expensive. * get rid of using the config in the callback, which improves thread-safety since the MQTT callback is running in the MQTT thread. * prefer C++ method stof to convert MQTT value to a float, which saves us from using new and delete for a buffer in particular. * prefer switch statements over if-else-trees. * split long lines. * get rid of topic #defines. * fix indention.
- Loading branch information
1 parent
fe2f82e
commit 4632260
Showing
2 changed files
with
97 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters