summaryrefslogtreecommitdiff
path: root/rose.erl
blob: 14af5d96e31d357fb13c543de0467ae07413e5c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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.