9 #ifndef RH_TcpProtocol_h
10 #define RH_TcpProtocol_h
12 #define RH_TCP_MESSAGE_TYPE_NOP 0
13 #define RH_TCP_MESSAGE_TYPE_THISADDRESS 1
14 #define RH_TCP_MESSAGE_TYPE_PACKET 2
17 #define RH_TCP_MAX_PAYLOAD_LEN 255
21 #define RH_TCP_HEADER_LEN 4
25 #define RH_TCP_MAX_MESSAGE_LEN (RH_TCP_MAX_PAYLOAD_LEN - RH_TCP_HEADER_LEN)
27 #pragma pack(push, 1) // No padding
33 uint8_t payload[RH_TCP_MAX_PAYLOAD_LEN + 1];
41 uint8_t payload[RH_TCP_MAX_PAYLOAD_LEN];
61 uint8_t payload[RH_TCP_MAX_MESSAGE_LEN];
uint32_t length
Number of octets following, in network byte order.
Definition: RHTcpProtocol.h:39
uint8_t thisAddress
Node address.
Definition: RHTcpProtocol.h:49
uint8_t type
== RH_TCP_MESSAGE_TYPE_THISADDRESS
Definition: RHTcpProtocol.h:48
Generic RH_TCP simulator message structure.
Definition: RHTcpProtocol.h:30
uint8_t from
Node address of the sender.
Definition: RHTcpProtocol.h:58
uint8_t flags
Message flags.
Definition: RHTcpProtocol.h:60
uint32_t length
Number of octets following, in network byte order.
Definition: RHTcpProtocol.h:32
uint8_t type
One of RH_TCP_MESSAGE_TYPE_*.
Definition: RHTcpProtocol.h:40
Generic RH_TCP message structure with message type.
Definition: RHTcpProtocol.h:37
uint32_t length
Number of octets following, in network byte order.
Definition: RHTcpProtocol.h:55
RH_TCP radio message passed to or from the simulator.
Definition: RHTcpProtocol.h:53
uint8_t to
Node address of the recipient.
Definition: RHTcpProtocol.h:57
uint32_t length
Number of octets following, in network byte order.
Definition: RHTcpProtocol.h:47
uint8_t type
== RH_TCP_MESSAGE_TYPE_PACKET
Definition: RHTcpProtocol.h:56
uint8_t id
Message sequence number.
Definition: RHTcpProtocol.h:59
RH_TCP message Notifies the server of thisAddress of this client.
Definition: RHTcpProtocol.h:45