Exemple #1
0
 def __init__(self, loop, verbose):
     self.verbose = verbose
     led = Pin(2, Pin.OUT, value=1)  # Optional LED
     self.cl = client.Client(loop, local.MY_ID, local.SERVER,
                             local.PORT, local.SSID, local.PW,
                             local.TIMEOUT, verbose=verbose, led=led)
     self.tx_msg_id = 0
     self.dupes = 0  # Incoming dupe count
     self.missing = 0
     self.last = 0
     self.rxbuf = []
     loop.create_task(self.start(loop))
Exemple #2
0
 def __init__(self, loop, verbose):
     self.verbose = verbose
     self.led = Pin(2, Pin.OUT, value=1)  # LED for received data
     self.cl = client.Client(loop,
                             'rx',
                             local.SERVER,
                             local.PORT,
                             local.SSID,
                             local.PW,
                             local.TIMEOUT,
                             verbose=verbose)
     loop.create_task(self.start(loop))
Exemple #3
0
 def __init__(self, loop, verbose):
     self.verbose = verbose
     led = Pin(2, Pin.OUT, value=1)  # Optional LED
     # Pushbutton on Cockle board from shrimping.it
     self.switch = Switch(loop, Pin(0, Pin.IN))
     self.switch.close_func(lambda: self.must_send.set())
     self.switch.open_func(lambda: self.must_send.set())
     self.must_send = Event()
     self.cl = client.Client(loop, 'tx', local.SERVER, local.PORT,
                             local.SSID, local.PW, timeout=local.TIMEOUT,
                             verbose=verbose, led=led)
     loop.create_task(self.start(loop))
Exemple #4
0
 def __init__(self, loop, verbose):
     self.verbose = verbose
     self.cl = client.Client(loop,
                             local.MY_ID,
                             local.SERVER,
                             local.PORT,
                             local.SSID,
                             local.PW,
                             local.TIMEOUT,
                             conn_cb=self.constate,
                             verbose=verbose,
                             led=led,
                             wdog=False)
     loop.create_task(self.start(loop))