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
sq timestamp
[protos/xbee-avr.git]
/
rc_proto.c
diff --git
a/rc_proto.c
b/rc_proto.c
index
4b1ffb1
..
1c1a29f
100644
(file)
--- a/
rc_proto.c
+++ b/
rc_proto.c
@@
-269,7
+269,7
@@
int8_t rc_proto_send_echo_req(uint64_t addr, void *data, uint8_t data_len,
/* send an echo message: expect a reply */
int8_t rc_proto_send_echo_ans(uint64_t addr, void *data, uint8_t data_len,
/* send an echo message: expect a reply */
int8_t rc_proto_send_echo_ans(uint64_t addr, void *data, uint8_t data_len,
- int8_t power)
+ int8_t power
, uint16_t timestamp
)
{
struct rc_proto_echo_ans hdr;
struct xbee_msg msg;
{
struct rc_proto_echo_ans hdr;
struct xbee_msg msg;
@@
-278,6
+278,7
@@
int8_t rc_proto_send_echo_ans(uint64_t addr, void *data, uint8_t data_len,
hdr.type = RC_PROTO_ECHO_ANS;
hdr.datalen = data_len;
hdr.type = RC_PROTO_ECHO_ANS;
hdr.datalen = data_len;
+ hdr.timestamp = timestamp;
msg.iovlen = 2;
msg.iov[0].buf = &hdr;
msg.iovlen = 2;
msg.iov[0].buf = &hdr;
@@
-612,7
+613,8
@@
int rc_proto_rx(struct xbee_recv_hdr *recvframe, unsigned len)
stats.echo_req_rx++;
if (rc_proto_send_echo_ans(ntohll(recvframe->srcaddr),
stats.echo_req_rx++;
if (rc_proto_send_echo_ans(ntohll(recvframe->srcaddr),
- rce->data, rce->datalen, power) < 0)
+ rce->data, rce->datalen, power,
+ rce->timestamp) < 0)
return -1;
return 0;
return -1;
return 0;