From: Jérémie D. <Ba...@us...> - 2010-03-07 22:09:05
|
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 19398dd4d385b2ce50f474cb573743d6ec7f70a6 (commit) from 34e5436fb905872556fa9d0c2f83be2c5764f9d6 (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 19398dd4d385b2ce50f474cb573743d6ec7f70a6 Author: Jérémie Dimino <je...@di...> Date: Sun Mar 7 23:06:27 2010 +0100 send a string in the lcd.send command ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/script_commands.ml b/PC_Mainboard/clients/script_commands.ml index b7369a4..5741602 100644 --- a/PC_Mainboard/clients/script_commands.ml +++ b/PC_Mainboard/clients/script_commands.ml @@ -18,6 +18,7 @@ type logger = Lwt_term.styled_text -> unit Lwt.t type arg_type = | Int | Float + | String | Keyword of string list type command = { @@ -130,6 +131,13 @@ let int ?default name = { a_default = default; } +let string ?default name = { + a_name = name; + a_type = String; + a_cast = (fun str -> str); + a_default = default; +} + let float ?default name = { a_name = name; a_type = Float; diff --git a/PC_Mainboard/generators/gen_script_commands.ml b/PC_Mainboard/generators/gen_script_commands.ml index 8e48838..8ee4f3e 100644 --- a/PC_Mainboard/generators/gen_script_commands.ml +++ b/PC_Mainboard/generators/gen_script_commands.ml @@ -20,6 +20,8 @@ let print_common is_card path caml_path name args repl = List.iter (function | Arg(name, { caml_type = "int" }) -> printf " (int \"%s\")" name + | Arg(name, { caml_type = "string" }) -> + printf " (string \"%s\")" name | Arg(name, { caml_type = "bool" }) -> printf " (keyword \"%s\" [(\"false\", false); (\"true\", true)])" name | Arg(name, { caml_type = caml_type }) -> diff --git a/PC_Mainboard/interface/interface.ml b/PC_Mainboard/interface/interface.ml index a730840..d260e89 100644 --- a/PC_Mainboard/interface/interface.ml +++ b/PC_Mainboard/interface/interface.ml @@ -584,7 +584,7 @@ let interfaces = [ command ~name:"send" ~code:PcInterface.cmd_send - ~args:[Arg("cmd", uint8)] + ~args:[Arg("message", string)] (); ]); ] hooks/post-receive -- krobot |