kopia lustrzana https://github.com/felHR85/UsbSerial
pull/217/head
rodzic
d9b790f611
commit
ed8cf6208e
|
@ -2,14 +2,22 @@ import serial
|
|||
import sys
|
||||
import os
|
||||
|
||||
port = sys.argv[0]
|
||||
port = sys.argv[0]
|
||||
size = sys.argv[1]
|
||||
speed = sys.argv[2]
|
||||
|
||||
comm = serial.Serial()
|
||||
comm.
|
||||
comm = serial.Serial(port, int(speed))
|
||||
|
||||
data = os.urandom(size)
|
||||
data_tx = os.urandom(size)
|
||||
|
||||
comm.write(data_tx)
|
||||
|
||||
data_rx = comm.read(size)
|
||||
|
||||
if data_tx == data_rx:
|
||||
print("Success: Data was transmitted correctly")
|
||||
else:
|
||||
print("Error: Data was not transmitted")
|
||||
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue