summaryrefslogtreecommitdiff
path: root/rose.erl
diff options
context:
space:
mode:
Diffstat (limited to 'rose.erl')
-rw-r--r--rose.erl28
1 files changed, 19 insertions, 9 deletions
diff --git a/rose.erl b/rose.erl
index c00db2f..a367ee0 100644
--- a/rose.erl
+++ b/rose.erl
@@ -4,22 +4,32 @@
-include("Remote-Operations-Generic-ROS-PDUs.hrl").
-decode(Data) -> 'Remote-Operations-Generic-ROS-PDUs':decode('ROS', Data).
+decode(Data) ->
+ 'Remote-Operations-Generic-ROS-PDUs':decode('ROS', Data).
-return(Id, Op, {ok, Data}) -> 'Remote-Operations-Generic-ROS-PDUs':encode('ROS',
+return(Id, Op, {ok, Data}) ->
+ 'Remote-Operations-Generic-ROS-PDUs':encode('ROS',
{returnResult, #'ReturnResult'{invokeId = Id,
result = #'ReturnResult_result'{opcode = Op, result = Data}}}).
-invoke(Id, Op, {ok, Data}) -> 'Remote-Operations-Generic-ROS-PDUs':encode('ROS',
+invoke(Id, Op, {ok, Data}) ->
+ 'Remote-Operations-Generic-ROS-PDUs':encode('ROS',
{invoke, #'Invoke'{invokeId = Id, opcode = Op, argument = Data}}).
-dispatch({invoke, #'Invoke'{invokeId = Id, opcode = Op}}) ->
+dispatch({invoke, #'Invoke'{invokeId = Id, opcode = Op, argument = Data}}) ->
case Op of
- {local, 21} -> ok;
- {local, 51} -> ok;
- {local, 71} -> ok;
- {local, 211} -> return(Id, Op, status:status());
- _ -> error
+ {local, 21} ->
+ ok;
+ {local, 51} ->
+ {ok, Esc} = csta:decode(Data),
+ io:format("Esc ~p~n", [Esc]),
+ ok;
+ {local, 71} ->
+ ok;
+ {local, 211} ->
+ return(Id, Op, status:status());
+ _ ->
+ error
end;
dispatch({returnResult, #'ReturnResult'{result = Data}}) ->