Исправление. Не соотв. протоколу
This commit is contained in:
@@ -27,7 +27,7 @@ class NaviSource extends unit.Unit:
|
||||
if rx_data.size() < 28:
|
||||
emit_signal('parse_failed', self)
|
||||
return false
|
||||
var flags: = rx_data.decode_u16(24)
|
||||
var flags: = rx_data.decode_u16(26)
|
||||
data.clear()
|
||||
data['mode'] = akng_mode[(flags >> 4) & 3];
|
||||
if flags & (1 << 0):
|
||||
@@ -40,6 +40,6 @@ class NaviSource extends unit.Unit:
|
||||
data['longitude'] = float(rx_data.decode_s32(16) * 180) / pow_2_30
|
||||
if flags & (1 << 3):
|
||||
data['speed'] = rx_data.decode_float(20)
|
||||
data['err'] = rx_data.decode_u16(22)
|
||||
data['err'] = rx_data.decode_u16(24)
|
||||
emit_signal('data_received', data)
|
||||
return true
|
||||
|
||||
@@ -209,14 +209,17 @@ func poll_receive_udp(sock: Socket) -> bool:
|
||||
var addr_port: = [addr, port]
|
||||
if units.has(addr_port):
|
||||
units[addr_port].parse(data, tick)
|
||||
continue
|
||||
if unit_keys.has(port):
|
||||
var key = unit_keys[port]
|
||||
if units.has(key):
|
||||
units[key].parse(data, tick)
|
||||
continue
|
||||
port = sock.get_local_port()
|
||||
var key = ['*', port]
|
||||
if units.has(key):
|
||||
units[key].parse(data, tick)
|
||||
continue
|
||||
return false
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user