'Stop the receive thread.
Parameters
stop_measurement : bool
Also stop the measurement.'

def stop_receive_thread(self, stop_measurement=False):

    if (self._recv_thread is not None):
        self._recv_thread.stop()
        self._recv_thread = None
