mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 03:27:33 +08:00
[sim] protect binding if ac_id field doesn't exists
This commit is contained in:
@@ -179,10 +179,10 @@ module Make (A:Data.MISSION) (FM: FlightModel.SIG) = struct
|
|||||||
let msg_id, _ = Dl_Pprz.message_of_name name in
|
let msg_id, _ = Dl_Pprz.message_of_name name in
|
||||||
let s = Dl_Pprz.payload_of_values msg_id ground_id vs in
|
let s = Dl_Pprz.payload_of_values msg_id ground_id vs in
|
||||||
set_message (Protocol.string_of_payload s) in
|
set_message (Protocol.string_of_payload s) in
|
||||||
let ac_id = PprzLink.int_assoc "ac_id" vs in
|
let ac_id = try Some (PprzLink.int_assoc "ac_id" vs) with _ -> None in
|
||||||
match link_mode with
|
match link_mode, ac_id with
|
||||||
PprzLink.Forwarded when ac_id = !my_id -> if dl_button#active then set ()
|
PprzLink.Forwarded, Some x when x = !my_id -> if dl_button#active then set ()
|
||||||
| PprzLink.Broadcasted -> if dl_button#active then set ()
|
| PprzLink.Broadcasted, _ -> if dl_button#active then set ()
|
||||||
| _ -> ()
|
| _ -> ()
|
||||||
|
|
||||||
let message_bind = fun name link_mode ->
|
let message_bind = fun name link_mode ->
|
||||||
|
|||||||
Reference in New Issue
Block a user