Hello!
I was reading the following page: Ethernet - Arduino Reference
As I was reading it it states the following:
Parameters
val: a value to send as a single byte (byte or char)
buf: an array to send as a series of bytes (byte or char)
len: the length of the buffer
It however does not state what types they should consist of. Int, byte[] etc. Can someone clarify what each is to consist of! Ta!
You can make a few function definitions out of this:
server.write(byte b);
server.write(char c);
server.write(byte[] byteArray, int byteArrayLength);
and etc..
I'm assuming that when the docs say "byte or char" they mean "char if a single-byte character set, byte otherwise". I'm sure this is a question I'll be asking in the future
But assuming a single-byte character set, write should look like this:
char[] outString = 'xyz';
server.write(outString,3);
or maybe you just want to write one character (byte):
server.write(outString[0]); // first character in array
I hope I haven't assumed less knowledge than you actually have, and I hope I've helped.