7 } __attribute__((packed));
9 /* send a hello message, no answer is expected from the peer */
10 #define RC_PROTO_HELLO 0
11 struct rc_proto_hello {
13 uint8_t datalen; /* len of data excluding header */
15 } __attribute__((packed));
17 /* send an echo request, expect an echo reply from the peer */
18 #define RC_PROTO_ECHO_REQ 1
19 struct rc_proto_echo_req {
21 uint8_t datalen; /* len of data excluding header */
23 } __attribute__((packed));
25 /* reply to an echo request */
26 #define RC_PROTO_ECHO_ANS 2
27 struct rc_proto_echo_ans {
29 uint8_t datalen; /* len of data excluding header */
31 } __attribute__((packed));
33 /* send a power level probe to the peer */
34 #define RC_PROTO_POWER_PROBE 3
35 struct rc_proto_power_probe {
38 } __attribute__((packed));
40 /* send a servo command */
41 #define RC_PROTO_SERVO 4
42 struct rc_proto_servo {
45 uint8_t seq_and_pow; /* bitfield: pow are the 3 lsb, seq the 5 msb */
48 /* acknowledge a servo command */
49 #define RC_PROTO_ACK 5
53 } __attribute__((packed));
56 /* send a Hello message to a peer */
57 int8_t rc_proto_send_hello(uint64_t addr, void *data, uint8_t data_len);
59 void rc_proto_rx_range(int power_level);