summaryrefslogtreecommitdiff
path: root/src/pbx_rose.erl
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-11-11 14:49:51 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-11-11 14:49:51 +0100
commit8346e23acabd2a94dc50fd84316221d6790f7f90 (patch)
tree7eb5a0baa9998d4d2adf5d4262a599daea93bb7d /src/pbx_rose.erl
parent0aeaa178ac05d927862a7826a1a483d1eab022e5 (diff)
Event stub
Diffstat (limited to 'src/pbx_rose.erl')
-rw-r--r--src/pbx_rose.erl36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/pbx_rose.erl b/src/pbx_rose.erl
index 73ec8b0..ab73064 100644
--- a/src/pbx_rose.erl
+++ b/src/pbx_rose.erl
@@ -1,5 +1,8 @@
-module(pbx_rose).
+-behaviour(gen_event).
+-export([init/1, handle_event/2, handle_call/2, handle_info/2,
+ terminate/2, code_change/3]).
-export([decode/1, invoke/2]).
-include("opcodes.hrl").
@@ -74,3 +77,36 @@ decode(#'ReturnResult_result'{opcode = Op, result = Data}) ->
decode(<<Data/binary>>) ->
{ok, Pdu} = 'Remote-Operations-Generic-ROS-PDUs':decode('ROS', Data),
decode(Pdu).
+
+%%%
+
+init(_Args) ->
+ io:format("Init rose~n"),
+ {ok, []}.
+
+handle_event({invoke, Invoke = #'Invoke'{}}, State) ->
+ io:format("Invoke ~p~n", [Invoke]),
+ {ok, State};
+handle_event({returnResult, ReturnResult = #'ReturnResult'{}}, State) ->
+ io:format("ReturnResult ~p~n", [ReturnResult]),
+ {ok, State};
+handle_event({returnError, ReturnError = #'ReturnError'{}}, State) ->
+ io:format("ReturnError ~p~n", [ReturnError]),
+ {ok, State};
+handle_event({reject, Reject = #'Reject'{}}, State) ->
+ io:format("Reject ~p~n", [Reject]),
+ {ok, State};
+handle_event(_Event, State) ->
+ {ok, State}.
+
+handle_call(_Request, State) ->
+ {ok, ok, State}.
+
+handle_info(_Info, State) ->
+ {ok, State}.
+
+terminate(_Reason, _State) ->
+ ok.
+
+code_change(_OldVsn, State, _Extra) ->
+ {ok, State}.