From: Jérémie D. <Ba...@us...> - 2010-03-24 22:13:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "krobot". The branch, master has been updated via d959904fc8c84cf918b665d5e1f587a860223a61 (commit) from 76537af4b98b2564c9d1371b574a493c3056f4e4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d959904fc8c84cf918b665d5e1f587a860223a61 Author: Jérémie Dimino <je...@di...> Date: Wed Mar 24 23:10:50 2010 +0100 send all errors to clients ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/driver/driver.ml b/PC_Mainboard/driver/driver.ml index fcb947a..e983f39 100644 --- a/PC_Mainboard/driver/driver.ml +++ b/PC_Mainboard/driver/driver.ml @@ -835,7 +835,7 @@ lwt () = in ignore begin - monitor_card ~name:"interace" ~vendor_id:PcInterface.usb_vid ~product_id:PcInterface.usb_pid_robot_interface ~set:set_card_interface + monitor_card ~name:"interface" ~vendor_id:PcInterface.usb_vid ~product_id:PcInterface.usb_pid_robot_interface ~set:set_card_interface (fun card -> lwt () = USB_commands.Servo.enable card `Both in lwt () = Compass.OBus.export bus =|< Compass.make card ["fr"; "krobot"; "Devices"; "Compass"] diff --git a/PC_Mainboard/driver/krobot_card.ml b/PC_Mainboard/driver/krobot_card.ml index 5b23d9d..772d47b 100644 --- a/PC_Mainboard/driver/krobot_card.ml +++ b/PC_Mainboard/driver/krobot_card.ml @@ -220,6 +220,12 @@ let rec dispatch card = return () end else begin let msg = parse_message buffer in + if msg.error <> 0 then begin + if msg.command = PcInterface.cmd_respond then + card.push_error ("response: " ^ error_message msg.error) + else + card.push_error ("spontaneous: " ^ error_message msg.error) + end; if msg.command = PcInterface.cmd_respond then begin match try Some(Int_map.find msg.host_serial card.reply_waiters) with Not_found -> None with | Some wakener -> @@ -242,10 +248,7 @@ let rec dispatch card = ignore (Lwt_log.exn_f ~section ~exn "pushing event %d from %s card failed with" msg.command card.wrapper.name)) seq | None -> - if msg.error <> 0 then - card.push_error (error_message msg.error) - else - ignore (dropped "command" card msg) + ignore (dropped "command" card msg) end; dispatch card end hooks/post-receive -- krobot |