Merge branch 'main' of https://124.70.178.159/andy/checker_gen1
This commit is contained in:
@@ -35,7 +35,9 @@ class protm:
|
||||
self.is_big_data=False
|
||||
self.num_to_recv=0
|
||||
self.recv_data=bytearray()
|
||||
self.ser = serial.Serial(port=com, baudrate=115200,bytesize=serial.EIGHTBITS,parity=serial.PARITY_NONE,
|
||||
self.com=com
|
||||
def init(self):
|
||||
self.ser = serial.Serial(port=self.com, baudrate=115200,bytesize=serial.EIGHTBITS,parity=serial.PARITY_NONE,
|
||||
stopbits=serial.STOPBITS_ONE,timeout=None)
|
||||
def encode(self,data:bytearray):
|
||||
t=bytearray()
|
||||
@@ -130,6 +132,9 @@ class protm:
|
||||
|
||||
|
||||
u=protm("com5")
|
||||
u.start_recv()
|
||||
u.wait()
|
||||
|
||||
# u.start_recv()
|
||||
# u.wait()
|
||||
u.cmd=1
|
||||
u.addr=1
|
||||
u.host_addr=0
|
||||
print(u.encode(bytearray()).hex(","))
|
||||
|
Reference in New Issue
Block a user