summaryrefslogtreecommitdiff
path: root/rose.erl
blob: 51a1ec9d1234e7b09ee2b0664da31395de2fd817 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-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, #'Invoke'{invokeId = Id, opcode = Op}}) ->
	case Op of
		{local, 211} -> encode(Id, Op, <<5,0>>)
	end.