After sending the Read_SZL request, only the protocol_id is checked. After that, the same packet is send a second time. Then the response gets parsed for basic hardware information.
-- send and receive the READ_SZL packet
response = send_receive(sock, Read_SZL)
local pos, protocol_id = bin.unpack("C", response, 8)
-- if protocol ID is not 0x32 then return nil
if ( protocol_id ~= 0x32) then
return nil
end
-- send and receive the first SZL Request packet
response = send_receive(sock, first_SZL_Request)
-- parse the response for basic hardware information
output = parse_response(response, host, port, output)
why not extract the hardware information from the first received response?