GW-ETH-02A
Application protocol for UDP channel
The communication is realized with the application protocol described below. It uses the transport protocol UDP according
the OSI reference model. For establishing a connection it is necessary to know the UDP port where the GW is listening and
its IP address or the NetBIOS name (Host Name).
GW answers and response to commands to any asking device. Asynchronous messages are sent to broadcast address
until the communication is established. After communication establishing the messages are sent to address of the last
communicating host. Thus, more hosts (e.g. servicing programs on more PCs) can communicate with the GW.
If the IP address or NetBIOS of the GW and the port number are known it is just possible to establish the connection.
Otherwise the request for a GW identification can be sent to broadcast address (in a single LAN segment only – routers
filter packets with broadcast addresses.) All GWs receiving this request will answer which allows to get actual IP address of
given GW.
Packet description
The packet structure is the same for both communication directions:
HEADER (H = 9 B)
DATA (D = 0 – 497 B)
CRC (2 B)
For receiving, GW checks:
• GW_ADR validity – see the packet header
• packet length must not be lower than CRC
• packet length must not be higher than DATA MAX + CRC
• CRC
Header
Packet header has a fixed length:
0
1
2
3
4
5
6
7
8
GW_ADR
CMD
SUBCMD
RES
RES
PACID_H
PACID_L
DLEN_H
DLEN_L
GW_ADR
identification address of the equipment of the GW-ETH-02A type (value: 0x22)
CMD
command of a packet (values: 0x01 … 0x7F)
answer to given command: CMD = CMD | 0x80 (bit 7 of given CMD set)
SUBCMD
auxiliary information of a command (values: see description below)
RES
reserved
PACID_H
packet identification – upper byte (values: 0x00 … 0xFF)
PACID_L
packet identification – lower byte (values: 0x00 … 0xFF)
DLEN_H
data length – upper byte (values: 0x00, 0x01)
DLEN_L
data length – lower byte (values: 0x00 … 0xFF)
The packet identification (PACID) can be any number 0x0000 – 0xFFFF according to the host specification. The GW
always copies this number to the answer to given packet.
CRC
The check part has a fixed length:
H+D
H+D+1
CRC_H
CRC_L
CRC type
CRC-16-CCITT
Polynomial
0x1021 (x^16 + x^12 + x^5 + 1)
Initial value
0x0000
CRC is calculated from the HEADER and DATA parts.
© 2016 MICRORISC s.r.o.
www.iqrf.org
User_Guide_GW-ETH-02A_ 160208
Page 29