Home > Back-end >  Java how to encapsulate a frame format of the data, and then to the collector
Java how to encapsulate a frame format of the data, and then to the collector

Time:11-20

Protocol frame description
68 h frame start
BCD A0A1A2A3A4A5 device number (6 bytes)
68 h frame start
C control word
L data length
The DATE data domain
CS check code
16 h frame end

1.2.19 set the host a new IP address (the main set after send to you need to set up the collector)
Applications sent through the communication port Settings host a new IP address command frame to detect terminal, testing after receiving the command frame save the new IP terminal operation, the operation is done will result in accordance with the provisions of this agreement through the communication port data frame format is sent to the application software, testing terminal in start a new IP, next time you're connected to the main specific data frame is as follows:
? Frame: the main - & gt; Collector
Control code: C=0 x2e
Data length: L (decision, based on the content length and & lt; 16)
Host IP address: character, format for AAA, BBB, CCC, DDD
The frame format:
Device number frame start control code length data domain (IP address) String
68 h A0A1A2A3A4A5 68 h 2 eh L AAA. BBB. CCC. DDD CS 16 h

How to realize the main this using Java to transmit frame format of the data collector?

CodePudding user response:

Elder brother have the result

CodePudding user response:

With operations in the byte array,

Byte [] frame={xa1 x68 0, 0 xa0, 0, 0 xa2, 0 xa3, 0 xa4, 0 xa5, 0 x68, 0 x2e, (byte) 192, (byte) 168,1,1,0 x16, 0 x16}
  • Related