use 255 data points, slight tweaks for consistency

pull/193/head
Mark Zachmann 2020-06-05 10:24:13 -04:00
rodzic 47528ee34c
commit 0e4b668836
2 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -127,5 +127,5 @@ def detect_version(serialPort: serial.Serial) -> str:
# this is a nanovna v2
return 'nanovnav2'
logger.error('Unknown VNA type: hardware responded to \r with: %s', data)
logger.error('Unknown VNA type: hardware responded to CR with: %s', data)
return 'unknown'

Wyświetl plik

@ -34,7 +34,7 @@ def _unpackUnsigned16(b):
class NanoVNAV2(VNA):
name = "NanoVNA-V2"
datapoints = 101
datapoints = 255
screenwidth = 320
screenheight = 240
@ -43,7 +43,7 @@ class NanoVNAV2(VNA):
if platform.system() != 'Windows':
tty.setraw(self.serial.fd)
self.serial.timeout = 3
self.serial.timeout = 6 # for this much data we need a longer timeout
# reset protocol to known state
self.serial.write([0, 0, 0, 0, 0, 0, 0, 0])
@ -174,4 +174,5 @@ class NanoVNAV2(VNA):
cmd = b"\x23\x00" + int.to_bytes(int(self.sweepStartHz), 8, 'little')
cmd += b"\x23\x10" + int.to_bytes(int(self.sweepStepHz), 8, 'little')
cmd += b"\x21\x20" + int.to_bytes(int(self.datapoints), 2, 'little')
cmd += b"\x21\x22" + int.to_bytes(1, 2, 'little') # number of samples
self.serial.write(cmd)