ION GETTING STARTED WITH C
- Ion Technical Information Manual
39
/* Close the connection */
ret = caenrfid_close(&handle);
if (ret < 0)
fprintf(stderr, "improper caenrfidlib closure!\n");
return 0;
}
Note that this time the
caenrfid_old.h
file is no longer needed.
To compile the code, you can use the
make
command:
develop@ion:~# make inv_test
cc inv_test.c -lcaenrfid -o inv_test
When the compile operation is finished you can test the program from your virtual machine:
develop@ion:~# ./inv_test <ion reader address>
cae000000000000000000002 Source_0 Ant0 3
cae000000000000000000003 Source_0 Ant0 3
cae000000000000000000007 Source_0 Ant0 3
cae00000000000000000000a Source_0 Ant0 3
Where
<ion reader address>
is the address of your Ion reader (by default equal to 192.168.0.1).
To run the same program directly on the RFID reader, first transfer it to the Ion:
develop@ion:~# scp ./inv_test <ion reader_address>:
and then execute it with the following command:
root@ion:~# ./inv_test 127.0.0.1
cae000000000000000000002 Source_0 Ant0 3
cae000000000000000000003 Source_0 Ant0 3
cae000000000000000000007 Source_0 Ant0 3
cae00000000000000000000a Source_0 Ant0 3