1

wialon retrasnlator response

Тема: wialon retrasnlator response

Hi
i need to send data via retranslator usin dotnet and  i have this hex string
0000003B313933393033005D5C97A9000000010BBB000000260102706F73696E666F00A165DD3F160B59C0D5EC8156609C39400000000000805A400000000B

i convert this string to binary data
then i convert that binary data to an array of bytes and send it via tcp protocol

the response in int is 63 but i dont get any data con the portal
https://hosting.wialon.com/

do you know wich is the response to know that the message was succesfully received?
thanks in advance

2

wialon retrasnlator response

Re: wialon retrasnlator response

Hello!

Please specify where do you send data via retranslator to Wialon  or to other system (from Wialon)
Which TCP protocol do you use?

Diana Cheley
Wialon Hosting Expert
Gurtam
3

wialon retrasnlator response

Re: wialon retrasnlator response

hello! thank for the answer!
i  convert the hex string into binary data with this c# code

string finalBinaryString = String.Join(String.Empty,
                finalHexString.Select(
                    c => Convert.ToString(Convert.ToInt32(c.ToString(), 16), 2).PadLeft(4, '0')
                )
                );

and then i convert the binary data into byte array with this code

int numOfBytes = finalBinaryString.Length / 8;
                byte[] binaryBytes = new byte[numOfBytes];
                for(int i = 0; i < numOfBytes; ++i)
                {
                    binaryBytes[i] = Convert.ToByte(finalBinaryString.Substring(8 * i, 8), 2);
                }

finally i send it via tcp protocol with web socket

IPEndPoint remoteEP = new IPEndPoint(ipAddress, 20163);
 Socket sender = new Socket(ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp); 
  sender.Connect(remoteEP);
int bytesSent = sender.Send(binaryBytes);
4

wialon retrasnlator response

Re: wialon retrasnlator response

Hi i already have send info to wialon retranslator
my error was that i was sending the course as 2 bytes and the retranslator need 4
thank you!