system
1
Hi, it's possible to send string over TCP with YunClient? I tried this, but unfortunately it not work:
char payload[] = "Hello world";
client.write(payload, sizeof(payload));
Got error:
/Applications/Arduino.app/Contents/Java/libraries/Bridge/src/YunClient.h:40:20: error: initializing argument 1 of 'virtual size_t YunClient::write(const uint8_t*, size_t)' [-fpermissive]
virtual size_t write(const uint8_t *buf, size_t size);
If it's possible, how?
system
2
candidate expects 2 arguments, 1 provided
Is there some part of this that you don't understand?
system
3
Sorry, I made a mistake. Updated.
system
4
client.write(payload, sizeof(payload));
sizeof() is the wrong function to be using. strlen() is the correct function. In this case, the results will be the same. But:
char payload[100] = "Hey";
would have sizeof() returning 100, and strlen() returning 3.
As for the current message, lie to the compiler:
client.write((uint8_t *)payload, sizeof(payload));
In the future, no NOT replace your original post. Post the new code and new errors in a reply.