title: When to flush Pyserial buffers?
body: <p>I am working with Pyserial and have a question regarding best practices surrounding flushing the input and output buffers. Currently I reset the output buffer before sending a command and reset the input before reading the reply. It seems I occasionally miss the start of a reply so I am considering modifying my program to reset the input buffer before I send my command. I am also considering linking my send and receive functions so that the send always calls the receive and hopefully tightens up the loop. </p>
  
  <pre><code>    def send_cmd(self, cmd_to_send):
          self.ser.reset_output_buffer()
          self.ser.write(cmd_to_send)
  
      def receive_cmd(self):
          self.ser.reset_input_buffer()
          # Read logic below
  </code></pre>
  
  <p>Considering transitioning to something like this</p>
  
  <pre><code>    def send_cmd(self, cmd_to_send):
          self.ser.reset_output_buffer()
          self.ser.reset_input_buffer()
          self.ser.write(cmd_to_send)
          self.receive_cmd()
  
      def receive_cmd(self):
          # Read logic below
  </code></pre>