Hi All,
I am trying to send information from my vb.Net
app to a piece of hardware with an embedded
TCP/IP controller using sockets.
I can send information so the sockets are working
but the data is garbage!!!
It works if the ascii of the character I am sending
is less than 127, however, if I send ascii 128 or
above (up to 255, obviously) then things start to
go wrong.
I am sure it is to do with the encoding of the
byte and thee fact that it seems to be signed
as oppossed to unsigned.
Decimal 1 in binary is
00000001
Decimal 127 in binary is
011111111
In an unisgned int, decimal 128 is
100000000
and decimal 255 is
11111111
How can I get this to be outputted to my
embedded controller using sockets???
Please help.
This is what I have used for my output stream to the
socket.
Dim writer As New IO.StreamWriter(m_Client.GetStream(),
System.Text.Encoding.ASCII)
Regards,
Jason.