summaryrefslogtreecommitdiff
path: root/rose.erl
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-10-27 16:34:34 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-10-27 16:34:34 +0100
commit282f7b5940870986266bc1761a9d481d080f9745 (patch)
treea6115c13e4985a40b9569752265bb718e9424675 /rose.erl
parentbe23cdc78558a75a06bd7a616949101362b29b48 (diff)
Split files
Diffstat (limited to 'rose.erl')
-rw-r--r--rose.erl18
1 files changed, 18 insertions, 0 deletions
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.