User manual

144
Setup parameters pass to the CHAPI serial line via
set_extra_command(void * extra_command, int arg)
as a NULL TERMINATED string and arg must be
EXTRA_LINE_SETUP
.
For example:
- to pass setup option to
CHAPI serial line mapped to COM port we must call:
line[0]->set_extra_command(“com=1”, EXTRA_LINE_SETUP);
- to pass setup option to
CHAPI serial line mapped to NPort5210 we must call:
line[7]->set_extra_command(“ip=192.168.127.254 port=1”, EXTRA_LINE_SETUP);
- to pass setup option to
CHAPI serial line mapped to TCP/IP protocol we must call:
line[3]->set_extra_command(“port=10020 application=txa0.ht”, EXTRA_LINE_SETUP);
Note about implemented CHAPI serial lines:
-
should avoid calling line[x]->do_tx(…) before line calls tx_done(…) from the previous
calling line[x]->do_tx(…)
-
it is recommended to transmit characters to the line one by one, because it is
closer to the behaviour of the real serial line controllers
-
if CHAPI serial line XON/XOFF flow control enable and CHAPI serial line controller
sends XOFF (via TX buffer or as control character) , line[x]->get_rx_char(…) will return
(-1), until XON will be sent or XON/XOFF flow control disable
-
line[x]->set_tx_disable(…) and line[x]->set_tx_enable(…) means nothing
5.2.3 Library usage examples
Library usage example can be found in CHAPI_DLV11 source C++ code.
5.3 Storage I/O CHAPI support library
5.3.1 Library files
Storage I/O CHAPI support library consists of: