]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Send seq num only for non-suppressed packets.
authorc vw <dl1ycf@darc.de>
Thu, 15 Nov 2018 11:01:37 +0000 (12:01 +0100)
committerc vw <dl1ycf@darc.de>
Thu, 15 Nov 2018 11:01:37 +0000 (12:01 +0100)
old_protocol.c

index ea11203433c3b41ac4ca54fc5cc9fb7bba7580ea..0ac2e797e69a77e0385965511c2d344950dfcecc 100644 (file)
@@ -1380,17 +1380,18 @@ static int metis_write(unsigned char ep,unsigned char* buffer,int length) {
     metis_buffer[5]=(send_sequence>>16)&0xFF;
     metis_buffer[6]=(send_sequence>>8)&0xFF;
     metis_buffer[7]=(send_sequence)&0xFF;
-    send_sequence++;
-
 
     //
     // When using UDP, the buffer will ALWAYS be sent. However, when using TCP,
     // we must be able to suppress sending buffers HERE asynchronously
     // when we want to sent a METIS start or stop packet. This is so because TCP
     // is a byte stream, and data from two sources might end up interleaved
+    // In order not to confuse the SDR, we increase the sequence number only
+    // for packets actually sent.
     //
     if (!suppress_ozy_packet) {
       // send the buffer
+      send_sequence++;
       metis_send_buffer(&metis_buffer[0],1032);
     }
     metis_offset=8;