allow override of CB handling

see #14
This commit is contained in:
Markus Sattler
2015-10-31 11:37:07 +01:00
parent 187a4ac823
commit d5b0364f5c
4 changed files with 35 additions and 18 deletions

View File

@ -84,6 +84,18 @@ class WebSocketsClient: private WebSockets {
void sendHeader(WSclient_t * client);
void handleHeader(WSclient_t * client);
/**
* called for sending a Event to the app
* @param type WStype_t
* @param payload uint8_t *
* @param length size_t
*/
virtual void runCbEvent(WStype_t type, uint8_t * payload, size_t length) {
if(_cbEvent) {
_cbEvent(type, payload, length);
}
}
};
#endif /* WEBSOCKETSCLIENT_H_ */