Convert HEX and send to port

Hi Experts,
I need to do a conversion of the equivalent Hex Value of a string.
This implies that my 'string':
55 01 00 01 00 01 00 E1 FF 01 00 61 61 61 61 61 61 61 61 61 61 61 61 70 06 AA
is allready the actual HEX which I want to define as:
unsigned char buffer[24] = { 0x55, 0x00, 0x03, 0x00, 0x05, 0x00, 0x01, 0xE1, 0x01, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x70, 0x06, 0xAA }
AS Char, the first value will typically be "U"
I then need to send the buffer to a port using:

 Dim serverStream As NetworkStream = clientSocket.GetStream()
 serverStream.Flush()
WOuld appreciate some help to code this correctly or a link please
regards
espsAsked:
Who is Participating?
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You need to use a BYTE array, not a char array though.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.