I have a device which has a rs485 output and another gsm device connected to this output.
I can access gsm device with a special IP and port. Gsm device is working transparently. Sending all data recieved from tcp socket to rs485, and retrieving data on rs485 then write to the opened tcp socket.
connection between gsm device and rs485 existing device is wired and fix baudrate on 300.
when I tried to read rs485 existing device with my laptop, connect rs485 to my usb, setting serial parameters like;
- parity : even
- databit : 7
- stopbit : 1
- baudrate : 300
(This configuration is universal and described with a standard documentation)
With this configuration everything is right and I can transfer data.
When I tried to use gsm device, I have to manipulate the generated byte array to fit the rs485 exsiting device.
for instance;
I want to send /?![CR][LF]
as UTF-8.
When using wired connection to device basically sending
"/?!\r\n".getBytes("UTF-8")
and device answering.
When using gsm, I monitor over wireshark, device is only answering with byte array : AF-3F-21-8D-A0
AF
is signed format of "/" - 2F
Also 8D
is signed format of [CR] - 0D
I thinking that, the difference with bytes is causing from my configuration that used on serial connection.
Is there a way to set this configurations (parity, stop, data bits ) when using tcp/ip sockets ?
Thanks for your reply.