Browse Source

Remove references to wsOnReceiveRegister

v2
Xose Pérez 6 years ago
parent
commit
e25a80595b
2 changed files with 9 additions and 15 deletions
  1. +0
    -5
      code/espurna/config/prototypes.h
  2. +9
    -10
      code/espurna/rfm69.ino

+ 0
- 5
code/espurna/config/prototypes.h View File

@ -152,15 +152,10 @@ void webRequestRegister(web_request_callback_f callback);
typedef std::function<void(JsonObject&)> ws_on_send_callback_f;
void wsOnSendRegister(ws_on_send_callback_f callback);
void wsSend(ws_on_send_callback_f sender);
typedef std::function<void(uint32_t, const char *, JsonObject&)> ws_on_action_callback_f;
void wsOnActionRegister(ws_on_action_callback_f callback);
typedef std::function<void(void)> ws_on_after_parse_callback_f;
void wsOnAfterParseRegister(ws_on_after_parse_callback_f callback);
typedef std::function<bool(const char *, JsonVariant&)> 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 *


+ 9
- 10
code/espurna/rfm69.ino View File

@ -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);
}


Loading…
Cancel
Save