Merge remote-tracking branch 'lepshiy/master' into для_киры

This commit is contained in:
sasha80
2024-11-07 13:44:03 +03:00
9 changed files with 369 additions and 103 deletions

View File

@@ -98,6 +98,7 @@ class Sch3 extends unit.Unit:
if cmd_state != CmdState.DONE: return false
var json_dict = {'code': 'write', 'data': [addr] + data}
tx_data = JSON.stringify(json_dict).to_utf8_buffer()
tx_len = len(tx_data)
cmd_state = CmdState.SEND
return true
@@ -108,6 +109,7 @@ class Sch3 extends unit.Unit:
if cmd_state != CmdState.DONE: return false
var json_dict = {'code': 'read_holding', 'data': [addr, count]}
tx_data = JSON.stringify(json_dict).to_utf8_buffer()
tx_len = len(tx_data)
cmd_state = CmdState.SEND
return true
@@ -118,5 +120,6 @@ class Sch3 extends unit.Unit:
if cmd_state != CmdState.DONE: return false
var json_dict = {'code': 'read_input', 'data': [addr, count]}
tx_data = JSON.stringify(json_dict).to_utf8_buffer()
tx_len = len(tx_data)
cmd_state = CmdState.SEND
return true