mirror of https://github.com/ArduPilot/ardupilot
AP_Scripting: allow for 0x00 for 2nd checksum byte in INF_Inject driver
the device does send 0x00 sometimes and data is valid
This commit is contained in:
parent
5a2b7c0ab2
commit
e2767f899f
|
@ -210,7 +210,11 @@ local function check_input()
|
|||
local chk1 = state.chk1
|
||||
state.check0, state.check1 = string.unpack("<BB", read_bytes(2))
|
||||
|
||||
local checksum_ok = chk0 == state.check0 and chk1 == state.check1
|
||||
--[[
|
||||
the device will sometimes use 0 for the 2nd 8 bits of the checksum
|
||||
we will accept these packets, relying on the other header checks
|
||||
--]]
|
||||
local checksum_ok = chk0 == state.check0 and (chk1 == state.check1 or state.check1 == 0)
|
||||
if not checksum_ok then
|
||||
gcs:send_text(MAV_SEVERITY.INFO, string.format("chksum wrong (0x%02x,0x%02x) (0x%02x,0x%02x)", chk0, chk1, state.check0, state.check1))
|
||||
return false
|
||||
|
|
Loading…
Reference in New Issue