add support for up to 10 ESPNow remotes (#4654)
* add support for up to 10 ESPNow remotes * removed debug line * changed todo comment * fixed some issues, shortened html/java code - reverting name to `linked_remote` - ESPNow remote list is now hidden if unchecked - shortened java script function names and variables to save flash - removed now obsolete settings in xml.cpp - correct checking of valid hex string for remote list in java script * fixed indentation, using emplace_back instead of push_back, using JsonVariant, replaced buttons with +/- * shortened java code * updated java code, fixed bug - element is now properly removed - `+` button is hidden if list is full - user needs to remove a remote, then reload the page to add it (workaround for edge case that needs more code to handle otherwise) * add limit * clearer usage description
This commit is contained in:
@@ -181,16 +181,10 @@ static bool remoteJson(int button)
|
||||
return parsed;
|
||||
}
|
||||
|
||||
// Callback function that will be executed when data is received
|
||||
// Callback function that will be executed when data is received from a linked remote
|
||||
void handleWiZdata(uint8_t *incomingData, size_t len) {
|
||||
message_structure_t *incoming = reinterpret_cast<message_structure_t *>(incomingData);
|
||||
|
||||
if (strcmp(last_signal_src, linked_remote) != 0) {
|
||||
DEBUG_PRINT(F("ESP Now Message Received from Unlinked Sender: "));
|
||||
DEBUG_PRINTLN(last_signal_src);
|
||||
return;
|
||||
}
|
||||
|
||||
if (len != sizeof(message_structure_t)) {
|
||||
DEBUG_PRINTF_P(PSTR("Unknown incoming ESP Now message received of length %u\n"), len);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user