FIX/FAST decode/encode facility
Erlang Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
doc
ebin
include
src
templates
LICENSE
Makefile
README.mediawiki
TODO
rebar
run_tests

README.mediawiki

FAST decoding/encoding library

MICEX FAST decoding

Use ebin/decode_micexff script

Example of usage

decode_one_message() ->

   % create context. Assume FAST templates are saved into templates.xml file
   {ok, Context} = erlang_fast:create_context({file, "templates.xml"}, [use_id], fun logger/2),

   % read FAST encoded data from data.fast
   {ok, Data} = file:read_file("data.fast"),

   % Context1 and Data1 shall be used for decoding next messages, if needed
   {Msg, Data1, Context1} = erlang_fast:decode(Data, Context),
   io:format("Decoded message is ~p~n", [Msg]).

encode_one_message() ->

   % create context. Assume FAST templates are saved into templates.xml file
   {ok, Context} = erlang_fast:create_context({file, "templates.xml"}, [use_id], fun logger/2),

   % Msg is in format of previously decoded message
   {Data, Context1} = erlang_fast:encode(Msg, Context),

   io:format("Encoded data: ~p", [Data]).

logger([], _) ->

   ok;

logger(Err, Val) ->

   io:format("~p: ~p~n", [Err, Val]).