1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Making programs against the TiCables library</title>
<style type="TEXT/CSS">
<!--
BODY {FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; BACKGROUND-COLOR: #FFFFFF; FONT-SIZE: 10pt}
TD {FONT-SIZE: 10pt}
H1 {FONT-SIZE: 18pt}
H3 {FONT-SIZE: 13pt}
PRE {FONT-FAMILY: Courier New; FONT-SIZE: 9pt}
CODE {FONT-FAMILY: Courier New; FONT-SIZE: 9pt}
-->
</style>
</head>
<body bgcolor="#ffffff" text="#000000" alink="#ff0000" vlink="#0000ff">
<h1> How to make a program against the ticalcs library </h1>
<hr>
<pre> <em> </em></pre>
You will find in the <i>test</i> folder of the library source archive
a test/example program which uses this library.<br>
Below is listed a light version (error management has been removed and
update functions are set to void) of this program to make it clearer:
<pre>#include <ticalcs.h><br><br>/* Cable & Calc structures */<br>TicableLinkParam lp;<br>TicableLinkCable lc;<br>TicalcFncts tc; // Functions which drive a calculator<br>TicalcInfoUpdate iu; // Functions to do the refresh of progress bar & label<br><br>/* Update functions */<br>void ilp_start() { }<br>void ilp_stop() { }<br>void ilp_refresh() { }<br>void ilp_pbar() { }<br>void ilp_label() { }<br><br>int main(int argc, char **argv)<br>{<br> int err;<br><br> /* <br> Initialize the libTIcable library <br> */<br> ticable_get_default_param(&lp);<br> lp.delay = DFLT_DELAY;<br> lp.timeout = DFLT_TIMEOUT;<br> lp.port = SERIAL_PORT_2;<br> lp.method = IOM_AUTO;<br> ticable_set_param(&lp);<br> ticable_set_cable(LINK_SER, &lc);<br><br> /* <br> Initialize the libTIcalc library <br> */<br> ticalc_set_update(&iu, ilp_start, ilp_stop, ilp_refresh, <br> ilp_pbar, ilp_label);<br><br> ticalc_set_cable(&lc);<br> ticalc_set_calc(CALC_TI89, &tc);<br> <br> // Init port<br> lc.init();<br> lc.open();<br><br> // Check ready<br> tc.isready();<br><br> // Close port<br> lc.close();<br> lc.exit();<br><br> return 0;<br>}<br></pre>
<br>
That's all !
<pre></pre>
<h3><a href="index.html">Return to the main index</a> </h3>
<br>
<br>
<br>
<br>
</body>
</html>
|