diff --git a/gex/transport.py b/gex/transport.py index 546c601..ad790e3 100644 --- a/gex/transport.py +++ b/gex/transport.py @@ -54,8 +54,8 @@ class DongleAdapter(BaseGexTransport): self.gw_reset() self.gw_add_nodes([slave]) - print('Gateway network ID: ' + - '.'.join(['%02X' % x for x in self.gw_get_net_id()])) + print('Dongle network prefix: ' + + ':'.join(['%02X' % x for x in self.gw_get_net_id()])) def _handleRx(self, frame): if len(frame) != 64: diff --git a/test_dongle.py b/test_dongle.py index 3b134f6..2061ae1 100644 --- a/test_dongle.py +++ b/test_dongle.py @@ -4,14 +4,22 @@ import time import gex with gex.DongleAdapter(gex.TrxRawUSB(remote=True), 0x10) as transport: +# with gex.TrxRawUSB() as transport: # connect GEX client library to the remote slave client = gex.Client(transport) + do = gex.DOut(client, "led") adc = gex.ADC(client, "adc") - print(adc.read_smooth()) + while True: + do.toggle(confirm=True) + print(adc.read_smooth()) + time.sleep(0.2) - print(adc.read_raw()) - - # this will fail unless the communication works + # adc = gex.ADC(client, "adc") + # for j in range(10): + # try: + # print(adc.read_smooth()) + # except: + # print("Failed") diff --git a/test_ini.py b/test_ini.py index 61ca0de..0e61d4a 100644 --- a/test_ini.py +++ b/test_ini.py @@ -3,5 +3,7 @@ import time import gex -with gex.Client(gex.TrxRawUSB()) as client: - print(client.ini_read(1)) +# with gex.Client(gex.TrxRawUSB()) as client: +with gex.DongleAdapter(gex.TrxRawUSB(remote=True), 0x10) as transport: + client = gex.Client(transport) + print(client.ini_read(0))