From 5a6df738a3019b34f2f47c8da7db6f84994570cd Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 30 Oct 2015 12:24:12 +0100 Subject: Use macros --- src/tda.erl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/tda.erl') diff --git a/src/tda.erl b/src/tda.erl index 9cac6f7..5fe8bf8 100644 --- a/src/tda.erl +++ b/src/tda.erl @@ -3,6 +3,8 @@ -export([start/0, client/1, stop/0]). -export([ext/0, co/0, snapshot/1]). +-include("opcodes.hrl"). + -define(TIMEOUT, 300000). -define(CONNECT_TIMEOUT, 3000). -define(HOST, "192.168.240.20"). @@ -16,13 +18,13 @@ stop() -> tdaPid ! acse:release(). ext() -> - tdaPid ! rose:invoke({local, 51}, escape:lines(ext)). + tdaPid ! rose:invoke(?ESCAPE, escape:lines(ext)). co() -> - tdaPid ! rose:invoke({local, 51}, escape:lines(co)). + tdaPid ! rose:invoke(?ESCAPE, escape:lines(co)). snapshot(Device) -> - tdaPid ! rose:invoke({local, 74}, snapshot:encode(Device)). + tdaPid ! rose:invoke(?SNAPSHOT, snapshot:encode(Device)). client({dial, Host, Port}) -> io:format("Dial ~p:~p~n", [Host, Port]), -- cgit v1.2.3