mirror of
https://github.com/lowobservable/coax.git
synced 2026-04-26 04:08:01 +00:00
New pycoax API
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
|
||||
from common import open_example_serial_interface
|
||||
|
||||
from coax import poll, poll_ack
|
||||
from coax import Poll, PollAck
|
||||
|
||||
with open_example_serial_interface(poll_flush=False) as interface:
|
||||
print('POLL...')
|
||||
|
||||
poll_response = poll(interface, receive_timeout=5)
|
||||
poll_response = interface.execute(Poll(), timeout=5)
|
||||
|
||||
print(poll_response)
|
||||
|
||||
if poll_response:
|
||||
print('POLL_ACK...')
|
||||
|
||||
poll_ack(interface)
|
||||
interface.execute(PollAck())
|
||||
|
||||
Reference in New Issue
Block a user