Sending commands to Forte over TCP; Header in Payload [message #1848229] |
Thu, 25 November 2021 14:08 |
Eclipse User |
|
|
|
Dear all,
I am currently working on sending management commands directly over TCP to Forte (on a Raspberry Pi).
To do this, I looked at the stream that 4Diac IDE sends to Forte and realized that the same content is being sent as what is in the forte-bootfile (except the query command).
In my own attempt to send the content, I run into a problem in the TCP payload. There seems me to be some kind of header included before the actual command. Can anyone tell me how the bytes come about?
In the pictures it is for example in the 1st request:
P (0x50) + null (0x00) + null (0x00) + P (0x50) + null (0x00) + @(0x40) -> Command (<Request...).
For another request linked to a resource, the first 2 bytes are the same (0x50, 0x00), the third (0x07) is not. Between the resource and the command are another 3 bytes (0x50 0x00 0x93).
I have already tried the Java socket as described on Holobloc. The sending works in principle in the same way. I use the ObjectOutputStream and tried different commands (writeBytes, writeObject...). However, the "header" of the payload does not fit properly.
Further attempts I have made also in Python and C, however by their Send function no "header" arises in the Payload, but starting from the 1.Byte the bytes are contained by the Command.
If I program e.g. the complete payload of 4Diac IDE as byte array in C and then use this in C as payload, I also get the response of Forte with the response ID as payload.
However, I would like to understand how the bytes - that are not part of the command - result.
I'm looking forward to your answers :)
Best,
Johannes
|
|
|
|
|
Re: Sending commands to Forte over TCP; Header in Payload [message #1848425 is a reply to message #1848420] |
Wed, 01 December 2021 18:13 |
|
Hi Johannes,
Clause 6 of the compliance profile defines what data is to be sent to devices for configuring them and what data is returned. Clause 5 Interoperability Provisions defines how the data is encoded. There you find how strings are encoded with teh 0x50 + lenght + string content.
I hope this helps.
Cheers,
Alois
|
|
|
Powered by
FUDForum. Page generated in 0.03335 seconds