Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /PC_Mainboard/Apps/cards/dbus-drivers/card_interface.ml [70e6c5] .. [248975] Maximize Restore

  Switch to side-by-side view

--- a/PC_Mainboard/Apps/cards/dbus-drivers/card_interface.ml
+++ b/PC_Mainboard/Apps/cards/dbus-drivers/card_interface.ml
@@ -10,6 +10,7 @@
 (* Driver for the interface Kard *)
 
 open OBus_type.Perv
+open Lwt
 
 type card = {
   card : Card.t;
@@ -21,16 +22,16 @@
                               let get card = card.obus
                             end)
 
-include M.MakeInterface(struct let interface = "fr.krobot.Device.Compass"
+include M.MakeInterface(struct let name = "fr.krobot.Device.Compass" end)
 
 OL_method GetCompas : int = fun card ->
-  lwt data = Card.make_buffer () in
+  let data = Card.make_buffer () in
   lwt data = Card.send_request card.card Protocol.get_cmp03_data data in
   return (RW.get_int16 data 2)
 
 let () = Lwt_main.run begin
-  lwt card = Card.open_card ~product_id:Protocol.product_id ~vendor_id:Protocol.prout and bus = Lazy.force OBus_bus.system in
-  let card = { card = card; obus = OBus_object.make [ "fr"; "krobot"; "Devices"; "Compass" ] in
+  lwt card = Card.open_card ~product_id:Protocol.usb_vid ~vendor_id:Protocol.usb_pid_robot_interface and bus = Lazy.force OBus_bus.system in
+  let card = { card = card; obus = OBus_object.make [ "fr"; "krobot"; "Devices"; "Compass" ] } in
   M.export bus card;
   lwt _ = OBus_bus.request_name bus "fr.krobot.Device.Compass" in
   fst (Lwt.wait ())