]> git.droids-corp.org - protos/xbee-avr.git/commitdiff
sq timestamp
authorOlivier Matz <zer0@droids-corp.org>
Tue, 6 May 2014 21:00:20 +0000 (23:00 +0200)
committerOlivier Matz <zer0@droids-corp.org>
Tue, 6 May 2014 21:00:20 +0000 (23:00 +0200)
rc_proto.c

index 4b1ffb19361a788a16fd7481a7264eb458f50ac8..1c1a29fec54d5714af6d5b39b154eb832b5d6af5 100644 (file)
@@ -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,
-       int8_t power)
+       int8_t power, uint16_t timestamp)
 {
        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.timestamp = timestamp;
 
        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),
-                                       rce->data, rce->datalen, power) < 0)
+                                       rce->data, rce->datalen, power,
+                                       rce->timestamp) < 0)
                                return -1;
 
                        return 0;