mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 18:52:30 +00:00
Refactor MQTT::onReceive to reduce if/else nesting (#5592)
* Refactor MQTT::onReceive to reduce if/else nesting * Fix missing #include <functional> * const DecodedServiceEnvelope e * Combine validDecode if statement. * Only call pb_release when validDecode. * s/ptr/channelName/ * Use reference type for deleter * Use lambda instead of bind * Document deleter * Reorder 'if's to avoid object creation * Remove unnecessary comment * Remove 'else'; simpifies #5516 --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
@@ -117,9 +117,6 @@ class MQTT : private concurrency::OSThread
|
||||
// Check if we should report unencrypted information about our node for consumption by a map
|
||||
void perhapsReportToMap();
|
||||
|
||||
// returns true if this is a valid JSON envelope which we accept on downlink
|
||||
bool isValidJsonEnvelope(JSONObject &json);
|
||||
|
||||
/// Determines if the given address is a private IPv4 address, i.e. not routable on the public internet.
|
||||
/// These are the ranges: 127.0.0.1, 10.0.0.0-10.255.255.255, 172.16.0.0-172.31.255.255, 192.168.0.0-192.168.255.255.
|
||||
bool isPrivateIpAddress(const char address[]);
|
||||
|
||||
Reference in New Issue
Block a user