git.droids-corp.org
/
protos
/
xbee-avr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rc_proto: allow to configure timers
[protos/xbee-avr.git]
/
rc_proto.h
diff --git
a/rc_proto.h
b/rc_proto.h
index
82f2fd2
..
3df4aaf
100644
(file)
--- a/
rc_proto.h
+++ b/
rc_proto.h
@@
-20,6
+20,7
@@
struct rc_proto_hello {
struct rc_proto_echo_req {
uint8_t type;
int8_t power;
struct rc_proto_echo_req {
uint8_t type;
int8_t power;
+ uint16_t timestamp; /* copied as-is in answer */
uint8_t datalen; /* len of data excluding header */
uint8_t data[];
} __attribute__((packed));
uint8_t datalen; /* len of data excluding header */
uint8_t data[];
} __attribute__((packed));
@@
-28,6
+29,7
@@
struct rc_proto_echo_req {
#define RC_PROTO_ECHO_ANS 0x02
struct rc_proto_echo_ans {
uint8_t type;
#define RC_PROTO_ECHO_ANS 0x02
struct rc_proto_echo_ans {
uint8_t type;
+ uint16_t timestamp;
uint8_t datalen; /* len of data excluding header */
uint8_t data[];
} __attribute__((packed));
uint8_t datalen; /* len of data excluding header */
uint8_t data[];
} __attribute__((packed));
@@
-84,6
+86,15
@@
struct rc_proto_stats {
uint8_t stats[]; /* format is struct rc_proto_stats_data */
} __attribute__((packed));
uint8_t stats[]; /* format is struct rc_proto_stats_data */
} __attribute__((packed));
+/* rc_proto timers configuration */
+struct rc_proto_timers {
+ uint16_t send_servo_min_ms;
+ uint16_t send_servo_max_ms;
+ uint16_t send_power_probe_ms;
+ uint16_t autobypass_ms;
+};
+extern struct rc_proto_timers rc_proto_timers;
+
/* send a Hello message to a peer */
int8_t rc_proto_send_hello(uint64_t addr, void *data, uint8_t data_len,
int8_t power);
/* send a Hello message to a peer */
int8_t rc_proto_send_hello(uint64_t addr, void *data, uint8_t data_len,
int8_t power);