diff --git a/code/espurna/config/prototypes.h b/code/espurna/config/prototypes.h index cde74200..f1438f80 100644 --- a/code/espurna/config/prototypes.h +++ b/code/espurna/config/prototypes.h @@ -152,15 +152,10 @@ void webRequestRegister(web_request_callback_f callback); typedef std::function ws_on_send_callback_f; void wsOnSendRegister(ws_on_send_callback_f callback); void wsSend(ws_on_send_callback_f sender); - typedef std::function ws_on_action_callback_f; void wsOnActionRegister(ws_on_action_callback_f callback); - typedef std::function ws_on_after_parse_callback_f; void wsOnAfterParseRegister(ws_on_after_parse_callback_f callback); - - typedef std::function ws_on_receive_callback_f; - void wsOnReceiveRegister(ws_on_receive_callback_f callback); #else #define ws_on_send_callback_f void * #define ws_on_action_callback_f void * diff --git a/code/espurna/rfm69.ino b/code/espurna/rfm69.ino index 0e8e7d8f..55a51530 100644 --- a/code/espurna/rfm69.ino +++ b/code/espurna/rfm69.ino @@ -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) { if (strcmp(action, "clear-counts") == 0) _rfm69Clear(); } @@ -70,6 +62,14 @@ void _rfm69WebSocketOnAction(uint32_t client_id, const char * action, JsonObject #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) { // Look for the last defined node @@ -269,12 +269,11 @@ void rfm69Setup() { #if WEB_SUPPORT wsOnSendRegister(_rfm69WebSocketOnSend); - wsOnReceiveRegister(_rfm69WebSocketOnReceive); wsOnAfterParseRegister(_rfm69Configure); wsOnActionRegister(_rfm69WebSocketOnAction); #endif - // Register loop + settingsRegisterKeyCheck(_rfm69KeyCheck); espurnaRegisterLoop(_rfm69Loop); }