diff --git a/test/TEST_TX.py b/test/TEST_TX.py index 4eaf1852..c07436c5 100644 --- a/test/TEST_TX.py +++ b/test/TEST_TX.py @@ -13,6 +13,7 @@ import binascii #required for string.to_bytes() function import sys + def main(): modem = FreeDV() #Load FreeDV Class as "modem" @@ -55,15 +56,15 @@ class FreeDV(): buffer[:len(data_list[i])] = data_list[i] # set buffersize to length of data which will be send crc = c_ushort(self.c_lib.freedv_gen_crc16(bytes(buffer), self.payload_per_frame)) # generate CRC16 - crc = crc.value.to_bytes(2, byteorder='big') # convert buffer to 2 byte hex string + crc = crc.value.to_bytes(2, byteorder='big') # convert crc to 2 byte hex string buffer += crc # append crc16 to buffer - data = self.FrameBytes().from_buffer_copy(buffer) #change data format form bytearray to ctypes.u_byte + data = self.FrameBytes().from_buffer_copy(buffer) #change data format from bytearray to ctypes.u_byte - self.c_lib.freedv_rawdatatx(self.freedv,mod_out,data) # modulate DATA + self.c_lib.freedv_rawdatatx(self.freedv,mod_out,data) # modulate DATA and safe it into mod_out pointer - sys.stdout.buffer.write(mod_out) # the normal way of piping data - sys.stdout.flush() # flushing data + sys.stdout.buffer.write(mod_out) # print data to terminal for piping the output to other programs + sys.stdout.flush() # flushing stdout main() \ No newline at end of file