<div dir="ltr"><br><div class="gmail_quote"><br><div dir="ltr"><div>tried it but does not seem to make a difference .<br></div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">    % Create a message.<span class="gmail-"><br>    Msg1 = erl8583_message:new(),<br>    Msg2 = erl8583_message:set(0, "0200", Msg1),<br>    Msg3 = erl8583_message:set(2, "5234567890123456", Msg2),  <br></span>    AsciiMessage =erl8583_marshaller_ascii:<wbr>marshal(Msg3),<br></blockquote><div><br></div><div>error message below<br><br><blockquote>terminate reason: {function_clause,<br>                      [{erl8583_marshaller_ascii,marshal_data_element,<br>                           [{n,fixed,4},<<"0200">>],<br>                           [{file,"src/erl8583_marshaller_ascii.erl"},<br>                            {line,168}]},<br>                       {erl8583_marshaller,marshal,2,<br>                           [{file,"src/erl8583_marshaller.erl"},{line,108}]},<br></blockquote><br></div><div> <br></div></div><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 24, 2016 at 1:24 AM, Hernando Gisinger <span dir="ltr"><<a target="_blank" href="mailto:hgisinger@gmail.com">hgisinger@gmail.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div dir="ltr">Maybe ?<span><br><br>Msg1 = erl8583_message:new(),<br>Msg2 = erl8583_message:set(0, "0200", Msg1),<br></span>Msg3 = erl8583_message:set(2, "5234567890123456", Msg2),  %% Here is Msg2, not Msg1<br>AsciiMessage =erl8583_marshaller_ascii:mars<wbr>hal(Msg3),<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>2016-09-23 21:29 GMT-03:00 Nuku Ameyibor <span dir="ltr"><<a target="_blank" href="mailto:nayibor@gmail.com">nayibor@gmail.com</a>></span>:<br></div></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div><div><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><div>Dear List ,<br><br></div>I am writing a program where i need to pack/unpack iso messages .<br></div><div>i am using the <a target="_blank" href="https://github.com/mgwidmann/erl8583">erl8583</a> application but i am getting some errors using the packing and unpacking functions of the library .<br></div><div>
i run the  <a target="_blank" href="https://github.com/mgwidmann/erl8583/blob/master/test/test_all.erl">test_all.erl</a>  test script which runs the eunit scripts but got some errors .<br>
i scaled it down and run the test_asci_marshaller.erl eunit test .<br></div><div>below is part of the output below <br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><pre><code>eunit:test(test_ascii_marshall<wbr>er).          
test_ascii_marshaller: pan_test...*failed*
in function erl8583_marshaller_ascii:marsh<wbr>al_data_element/2 (src/erl8583_marshaller_ascii.<wbr>erl, line 168)
  called as marshal_data_element({n,fixed,<wbr>4},<<"0200">>)
in call from erl8583_marshaller:marshal/2 (src/erl8583_marshaller.erl, line 108)
in call from test_ascii_marshaller:pan_test<wbr>/0 (test/<a target="_blank" href="http://test_ascii_marshaller.er">test_ascii_marshaller.er</a><wbr>l, line 43)
**error:function_clause
  output:<<"">>

test_ascii_marshaller: proc_code_test...*failed*
in function erl8583_marshaller_ascii:marsh<wbr>al_data_element/2 (src/erl8583_marshaller_ascii.<wbr>erl, line 168)
  called as marshal_data_element({n,fixed,<wbr>4},<<"0100">>)
in call from erl8583_marshaller:marshal/2 (src/erl8583_marshaller.erl, line 108)
in call from test_ascii_marshaller:proc_cod<wbr>e_test/0 (test/<a target="_blank" href="http://test_ascii_marshaller.er">test_ascii_marshaller.er</a><wbr>l, line 49)
**error:function_clause
  output:<<"">>

test_ascii_marshaller: amount_tran_test...*failed*
in function erl8583_marshaller_ascii:marsh<wbr>al_data_element/2 (src/erl8583_marshaller_ascii.<wbr>erl, line 168)
  called as marshal_data_element({n,fixed,<wbr>4},<<"0200">>)
in call from erl8583_marshaller:marshal/2 (src/erl8583_marshaller.erl, line 108)
in call from test_ascii_marshaller:amount_t<wbr>ran_test/0 (test/<a target="_blank" href="http://test_ascii_marshaller.er">test_ascii_marshaller.er</a><wbr>l, line 55)
**error:function_clause
  output:<<"">></code></pre></blockquote><br><p>i traced it down to  this line in this line in erl8583_marshaller_ascii.erl</p><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><pre><code>marshal_data_element({n, fixed, Length}, FieldValue) when length(FieldValue) =< Length ->
IntValue = list_to_integer(FieldValue),
erl8583_convert:integer_to_str<wbr>ing(IntValue, Length);</code></pre></blockquote><div><br>i may be wrong but seems the length(FieldValue) is being passed a binary string instead of as string ??<br></div><div>running some of the functions in the application eg . below<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">    Msg1 = erl8583_message:new(),<br>    Msg2 = erl8583_message:set(0, "0200", Msg1),<br>    Msg3 = erl8583_message:set(2, "5234567890123456", Msg1),<br>    AsciiMessage =erl8583_marshaller_ascii:mars<wbr>hal(Msg3),<br></blockquote><br></div><div>gives the below error <br></div><div> a similar example is included in the test cases and i am assuming its supposed to work .<br></div><div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">terminate reason: {undef,<br>                      [{undefined,get_encoding,[2],[<wbr>]},<br>                       {erl8583_marshaller_ascii,mars<wbr>hal_field,3,<br>                           [{file,"src/erl8583_marshaller<wbr>_ascii.erl"},<br>                            {line,109}]},<br>                       {erl8583_marshaller,encode,6,<br>                           [{file,"src/erl8583_marshaller<wbr>.erl"},{line,238}]},<br>                       {erl8583_marshaller,marshal,2,<br>                           [{file,"src/erl8583_marshaller<wbr>.erl"},{line,112}]},<br></blockquote><br></div><div><br></div><div><br></div><div><br></div><div>Anyone have any experience with using this library and can help  point out what i may be doing wrong .<br></div><div>Also are there any other libraries out there for packing and unpacking iso 8583 messages in erlang .<br></div><div>searched on github but dont seem to find anything except erl8583 and some forks of it  .<br></div><div>Are there other alternative approaches for this like the use of ports  to help with the packing/unpacking ?<br></div><p><br></p><br><br></div><div><br><br></div></div>
</div><br></div>
<br></div></div>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a target="_blank" rel="noreferrer" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/list<wbr>info/erlang-questions</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></div><br></div>