|
@ -55,14 +55,6 @@ void _rfm69WebSocketOnSend(JsonObject& root) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool _rfm69WebSocketOnReceive(const char * key, JsonVariant& value) { |
|
|
|
|
|
if (strncmp(key, "rfm69", 5) == 0) return true; |
|
|
|
|
|
if (strncmp(key, "node" , 4) == 0) return true; |
|
|
|
|
|
if (strncmp(key, "key" , 3) == 0) return true; |
|
|
|
|
|
if (strncmp(key, "topic", 5) == 0) return true; |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void _rfm69WebSocketOnAction(uint32_t client_id, const char * action, JsonObject& data) { |
|
|
void _rfm69WebSocketOnAction(uint32_t client_id, const char * action, JsonObject& data) { |
|
|
if (strcmp(action, "clear-counts") == 0) _rfm69Clear(); |
|
|
if (strcmp(action, "clear-counts") == 0) _rfm69Clear(); |
|
|
} |
|
|
} |
|
@ -70,6 +62,14 @@ void _rfm69WebSocketOnAction(uint32_t client_id, const char * action, JsonObject |
|
|
|
|
|
|
|
|
#endif // WEB_SUPPORT
|
|
|
#endif // WEB_SUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
bool _rfm69KeyCheck(const char * key) { |
|
|
|
|
|
if (strncmp(key, "rfm69", 5) == 0) return true; |
|
|
|
|
|
if (strncmp(key, "node" , 4) == 0) return true; |
|
|
|
|
|
if (strncmp(key, "key" , 3) == 0) return true; |
|
|
|
|
|
if (strncmp(key, "topic", 5) == 0) return true; |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void _rfm69CleanNodes(unsigned char num) { |
|
|
void _rfm69CleanNodes(unsigned char num) { |
|
|
|
|
|
|
|
|
// Look for the last defined node
|
|
|
// Look for the last defined node
|
|
@ -269,12 +269,11 @@ void rfm69Setup() { |
|
|
|
|
|
|
|
|
#if WEB_SUPPORT
|
|
|
#if WEB_SUPPORT
|
|
|
wsOnSendRegister(_rfm69WebSocketOnSend); |
|
|
wsOnSendRegister(_rfm69WebSocketOnSend); |
|
|
wsOnReceiveRegister(_rfm69WebSocketOnReceive); |
|
|
|
|
|
wsOnAfterParseRegister(_rfm69Configure); |
|
|
wsOnAfterParseRegister(_rfm69Configure); |
|
|
wsOnActionRegister(_rfm69WebSocketOnAction); |
|
|
wsOnActionRegister(_rfm69WebSocketOnAction); |
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
|
|
|
// Register loop
|
|
|
|
|
|
|
|
|
settingsRegisterKeyCheck(_rfm69KeyCheck); |
|
|
espurnaRegisterLoop(_rfm69Loop); |
|
|
espurnaRegisterLoop(_rfm69Loop); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|