class Interface: def __init__(self, dev_path): self.nrf = CDC_nRF(dev_path) self.nrf.writeRegister(1, 0) self.nrf.setPower(True) # enable power self.nrf._bus.setDTR(True) # enable transparent mode self.nrf._bus.timeout = 0.01 # disable read/write timeouts def send(self, data): self.nrf._bus.write(data) def receive(self): return self.nrf._bus.read(1024)
def __init__(self, dev_path): self.nrf = CDC_nRF(dev_path) self.nrf.writeRegister(1, 0) self.nrf.setPower(True) # enable power self.nrf._bus.setDTR(True) # enable transparent mode self.nrf._bus.timeout = 0.01 # disable read/write timeouts