|

楼主 |
发表于 2023-5-24 11:56:08
|
显示全部楼层
开机收到第一帧数据record_clear操作成功了,之后的数据record_clear就没有成功,以下是逻辑处理,请问哪里有什么问题吗
for i=0, recv_packet_size do
record_add(5,31,packet[i]..";")
if packet[i] == cmd_head and cmd_head_tag == 0 then
cmd_head_tag = 1
end
if cmd_head_tag == 1 then
store_buffer[cmd_length] = packet[i]
cmd_length = cmd_length + 1
cmd_end_tag = (cmd_end_tag << 8) | packet[i]
record_add(5,27,cmd_end_tag)
if (cmd_end_tag & cmd_end) == cmd_end then
local len = cmd_length - 1
record_clear(5,28)
set_text(5,30,0xFF)
for j=0,len do
record_insert(5,28,j,store_buffer[j]..";")
end
end
end
end |
|