From 282f7b5940870986266bc1761a9d481d080f9745 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 27 Oct 2015 16:34:34 +0100 Subject: Split files --- rose.erl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 rose.erl (limited to 'rose.erl') diff --git a/rose.erl b/rose.erl new file mode 100644 index 0000000..14af5d9 --- /dev/null +++ b/rose.erl @@ -0,0 +1,18 @@ +-module(rose). + +-export([decode/1, encode/3, dispatch/1]). + +-include("Remote-Operations-Generic-ROS-PDUs.hrl"). + +decode(Msg) -> 'Remote-Operations-Generic-ROS-PDUs':decode('ROS', Msg). + +encode(Id, Op, Msg) -> 'Remote-Operations-Generic-ROS-PDUs':encode('ROS', + {returnResult, #'ReturnResult'{invokeId = Id, + result = #'ReturnResult_result'{opcode = Op, result = Msg}}}). + +dispatch(#'Invoke'{invokeId = Id, opcode = Op}) -> + case Op of + {local, 211} -> + {ok, Status} = rose:encode(Id, Op, <<5,0>>), + Status + end. -- cgit v1.2.3