ArduinoWebsocketServer
ArduinoWebsocketServer copied to clipboard
Problems with getData()
When i call de function getdata() it shows me an error my code its just like the example:
void loop() {
String data;
if (client.connected()) {
data = webSocketClient.getData();
if (data.length() > 0) {
Serial.print("Received data: ");
Serial.println(data);
}
and i get this error:
Arduino:1.8.3 (Windows 8), Tarjeta:"Arduino/Genuino Uno"
G:\Usuario\Documents\Arduino\wesocket\wesocket.ino: In function 'void loop()':
wesocket:90: error: no matching function for call to 'WebSocketClient::getData()'
data = webSocketClient.getData();
^
G:\Usuario\Documents\Arduino\wesocket\wesocket.ino:90:36: note: candidates are:
In file included from G:\Usuario\Documents\Arduino\wesocket\wesocket.ino:12:0:
C:\Program Files (x86)\Arduino\libraries\Websocket/WebSocketClient.h:112:10: note: bool WebSocketClient::getData(String&, uint8_t*)
bool getData(String& data, uint8_t *opcode = NULL);
^
C:\Program Files (x86)\Arduino\libraries\Websocket/WebSocketClient.h:112:10: note: candidate expects 2 arguments, 0 provided
C:\Program Files (x86)\Arduino\libraries\Websocket/WebSocketClient.h:113:7: note: bool WebSocketClient::getData(char*, unsigned int, uint8_t*)
bool getData(char *data, unsigned int dataLen, uint8_t *opcode = NULL);
^
C:\Program Files (x86)\Arduino\libraries\Websocket/WebSocketClient.h:113:7: note: candidate expects 3 arguments, 0 provided
exit status 1
no matching function for call to 'WebSocketClient::getData()'
Can you help me please!!!