diff --git a/sw/airborne/arch/sim/ivy_transport.h b/sw/airborne/arch/sim/ivy_transport.h index cd2bbf96efd..d84ff19234b 100644 --- a/sw/airborne/arch/sim/ivy_transport.h +++ b/sw/airborne/arch/sim/ivy_transport.h @@ -18,8 +18,8 @@ extern int ivy_dl_enabled; #define Space() ivy_p += sprintf(ivy_p, " "); #define Comma() ivy_p += sprintf(ivy_p, ","); -#define DelimStart() ivy_p += sprintf(ivy_p, "["); -#define DelimEnd() ivy_p += sprintf(ivy_p, "]"); +#define DelimStart() ivy_p += sprintf(ivy_p, "|"); +#define DelimEnd() ivy_p += sprintf(ivy_p, "|"); #define IvyTransportPutcByAddr(_dev,x) ivy_p += sprintf(ivy_p, "%c", *x); #define IvyTransportPutCharByAddr(_dev,x) IvyTransportPutcByAddr(_dev,x) Space() diff --git a/sw/ground_segment/tmtc/server.ml b/sw/ground_segment/tmtc/server.ml index b185137017c..2de1e85ef87 100644 --- a/sw/ground_segment/tmtc/server.ml +++ b/sw/ground_segment/tmtc/server.ml @@ -201,7 +201,7 @@ let send_dl_values = fun a -> for i = 0 to a.nb_dl_setting_values - 1 do csv := sprintf "%s%f," !csv a.dl_setting_values.(i) done; - let vs = ["ac_id", Pprz.String a.id; "values", Pprz.String ("["^ !csv ^"]")] in + let vs = ["ac_id", Pprz.String a.id; "values", Pprz.String ("|"^ !csv ^"|")] in Ground_Pprz.message_send my_id "DL_VALUES" vs let send_svsinfo = fun a -> @@ -223,7 +223,7 @@ let send_svsinfo = fun a -> concat azim a.svinfo.(i).azim; concat age a.svinfo.(i).age done; - let f = fun s r -> (s, Pprz.String ("["^ !r ^"]")) in + let f = fun s r -> (s, Pprz.String ("|"^ !r ^"|")) in let vs = ["ac_id", Pprz.String a.id; "pacc", Pprz.Int a.gps_Pacc; f "svid" svid; f "flags" flags; f "qi" qi; f "msg_age" age; diff --git a/sw/lib/ocaml/pprz.ml b/sw/lib/ocaml/pprz.ml index a10a67b97b6..b6af3c1fa64 100644 --- a/sw/lib/ocaml/pprz.ml +++ b/sw/lib/ocaml/pprz.ml @@ -160,7 +160,7 @@ let rec string_of_value = function | Int64 x -> Int64.to_string x | Char c -> String.make 1 c | String s -> s - | Array a -> "["^(String.concat separator (Array.to_list (Array.map string_of_value a)))^"]" + | Array a -> "|"^(String.concat separator (Array.to_list (Array.map string_of_value a)))^"|" let magic = fun x -> (Obj.magic x:('a,'b,'c) Pervasives.format) @@ -661,15 +661,15 @@ module MessagesOfXml(Class:CLASS_Xml) = struct let space = Str.regexp "[ \t]+" - let array_sep = Str.regexp "\\[\\|\\]" + let array_sep = Str.regexp "|" let values_of_string = fun s -> (* split arguments and arrays *) let array_split = Str.full_split array_sep s in let rec loop = fun fields -> match fields with | [] -> [] - | (Str.Delim "[")::((Str.Text l)::[Str.Delim "]"]) -> [l] - | (Str.Delim "[")::((Str.Text l)::((Str.Delim "]")::xs)) -> [l] @ (loop xs) + | (Str.Delim "|")::((Str.Text l)::[Str.Delim "|"]) -> [l] + | (Str.Delim "|")::((Str.Text l)::((Str.Delim "|")::xs)) -> [l] @ (loop xs) | [Str.Text x] -> Str.split space x | (Str.Text x)::xs -> (Str.split space x) @ (loop xs) | (Str.Delim _)::_ -> failwith "Pprz.values_of_string: incorrect array delimiter"