First a little background: I'm doing an SMPP client on vb.net, trying to communicate with my telco's SMSC. I've got the receiving part alright, but sending has got me stumped.
I have this hex value in String: "534D5050" ("SMPP"). I am currently writing it to my socket stream like this:
Dim w As New IO.StreamWriter(smppClient.GetStream)
Problem is, I need to send it as an octet, e.g. 53 is 00110101 in binary.
Hence, the actual data I have to send is, 00110101 1001101 1010000 1010000, but in *bytes*, not binary.
My question is, how do I go about converting hex strings into bytes?
edit: Just to clarify, using the example string "SMPP", I should send out 4 bytes instead of 8, like it is doing right now from my code above.
Thank you, and good day.