serialqueue: Don't report sent_time on responses that are retransmitted
On a retransmit, the sent_time of the command associated with the given response message isn't accurate. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
6f65ba9214
commit
61ee63f358
|
@ -517,7 +517,8 @@ handle_message(struct serialqueue *sq, double eventtime, int len)
|
||||||
if (len > MESSAGE_MIN) {
|
if (len > MESSAGE_MIN) {
|
||||||
// Add message to receive queue
|
// Add message to receive queue
|
||||||
struct queue_message *qm = message_fill(sq->input_buf, len);
|
struct queue_message *qm = message_fill(sq->input_buf, len);
|
||||||
qm->sent_time = sq->last_receive_sent_time;
|
qm->sent_time = (rseq > sq->retransmit_seq
|
||||||
|
? sq->last_receive_sent_time : 0.);
|
||||||
qm->receive_time = get_monotonic(); // must be time post read()
|
qm->receive_time = get_monotonic(); // must be time post read()
|
||||||
qm->receive_time -= sq->baud_adjust * len;
|
qm->receive_time -= sq->baud_adjust * len;
|
||||||
list_add_tail(&qm->node, &sq->receive_queue);
|
list_add_tail(&qm->node, &sq->receive_queue);
|
||||||
|
|
Loading…
Reference in New Issue