Ihealthgateway protocol format

Source: Internet
Author: User

Extended protocol-basic instruction format

Bytes

Value

Explanation

0

0xf5

Header command

1

0xnn

Port Number

2

0xnn

Packet Length (MSB)

3

0xnn

Packet Length (LSB)

4

0xnn

UID

...

0xnn

9

0xnn

10

0xnn

Command ID

11

0xnn

Data Field

...

0xnn

N

0xnn

N + 1

0xnn

And Verification

4.2.1Header command:

The header command of each extension protocol package is 0xf5.

4.2.2Port Number:

 

Description

0

Fixed Port Number of the extended chip (port0). The initial value of other modules is 0 before no port is allocated.

1 ~ 255

Port1 ~ 255. The port value is allocated by the extended chip or CPU.

 

4.2.3Packet Length:

It is calculated from the next byte of the packet length, excluding the verification byte. The packet length cannot exceed 65535 bytes.

4.2.4UID:

When uid = 0, it refers to the extended chip or expansion module.

When the UID is less than 0, it refers to the unique serial number of the product's internal Microcontroller (if it exceeds 6 bytes, the last 6 bytes will be taken ).

4.2.5Command ID:

When the command ID is 0, it indicates a data-type command. For other command IDs, see the following table.

Basic communication protocol-basic instruction format

Bytes

Value

Explanation

0

0xa0/0xb0

Header command

1

0xnn

Packet Length

2

0xnn

Status ID

3

0xnn

Sequential ID

4

0xnn

Command Data Field

...

0xnn

N

0xnn

N + 1

0xnn

MAC address field of the Wi-Fi module (This field is used for Wi-Fi communication, but not for other communication modes)

...

0xnn

N + 6

0xnn

N + 7

0xnn

And Verification

Note: in the preceding table, N indicates the nth byte of the data packet. 0xnn indicates that the content of this byte can be modified according to the actual command Package content. Except for special instructions, the rest are unsigned data, the same below.

Header command:The lower computer sends the command header command 0xa0 to the upper computer, and the upper computer sends the command header command 0xb0 to the lower computer.

Packet Length:It is calculated from the next byte of the packet length, excluding the verification byte. The packet length cannot exceed 255 bytes. If the number of data fields exceeds the limit, you need to subcontract the command data fields.

Status ID:Indicates the status of the command. This ID is used to specify the command status in the basic communication layer, and is not used in the product layer.

The Product Layer determines the status to the basic communication layer, and the status parameters should be used.

Sequence ID:The range is from 0x00-0xff. The order ID of the commands sent by the software on the upper computer increases progressively. The order ID of the commands sent by the software on the lower computer increases exponentially. The first order ID is 0x00 or 0x01, after that, the commands are sent one by one, and the overall statistics of the upper and lower computers are collected. When the sequential ID is 0xff, the sequential ID of the next command is 0x00.

Command data field:The product type, command, and data to be sent during communication. For the confirmation command, the length of this field may be zero.

MAC address field: the MAC address of the lower computer. The length is 6 bytes. This field is used for Wi-Fi communication. This field is not used for other communication methods.

And verify the sum of all data contained in the packet length, excluding the header command and the packet length.

Basic communication protocol-command Data Field Format

Bytes

Value

Explanation

0

0xnn

Product Type

1

0xff

Command ID

4

0xnn

Data Section

...

0xnn

N

0xnn

Product Type:See Appendix C. The product type value cannot be 0x00 during the drafting process;

Note: For products with public functions (for example, Wi-Fi module configuration and firmware upgrade), special product types should be used when sending such commands. For details, see appendix C.

Command ID:0xd0-0xff field, which is a reserved segment. The command ID defined by each product is unavailable. 0xd0-0xd6 indicates the self-upgraded command ID, 0xe0-0xe9 indicates the command ID used to set the Wi-Fi command, 0xf0-0xf9 indicates the command ID used to transmit device information for non-IDPs authentication devices, and 0xfa-0xff indicates the command ID used to encrypt. After the command ID of each product is used up, a command ID can be nested in the Data ID section. For example, when the command ID is a fixed value, the first byte of the Data part is the second-level command ID.

For module products, some commands are usually required for information exchange, setup, and tooling implementation between the module and MCU. The reserved command ID field cannot be used for such commands.We recommend that you use a special type for the product type.

Part of data bytesIt can be 0.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.