User's Manual

needed in order to maintain the communication active. The function returns a "handle" (very similar to the handles
used in managing files) that have to be used in any subsequent function calls relative to that reader. At the end of the
operation, a call to the CAENRFID_End function permits to close the communication link and to free the internal data
structures.
Return data mechanism
As seen in the Error Handling paragraph, all the C functions return a numeric error codes. Due to that reason, functions
that need to return data to the caller use output parameters. Output parameters for the C functions are highlighted in
this reference manual by the underlined name in the formal parameter list.
Java and .NET languages use exception for the error handling so, typically, the data is returned to the caller using the
return value of the methods.
Passing parameters to methods and functions
There are differences in the parameters' lists between Java/.NET methods and C functions. Many of those differences
are due to the implicit reference of the methods to their objects. This characteristic of object oriented languages is
emulated in C functions using an additional explicit parameter. Methods belonging to CAENRFIDLogicalSource objects,
for example, are emulated in C functions that accept SourceName parameters.
Other differences are due to the better handling of complex data types in Java and .NET languages. Arrays, for
example, have implicit size in Java/.NET that permit to pass a single parameter to methods requiring this data type. In C
functions, passing an array as a parameter, need to specify both the memory address of the array and its size explicitly.
CAEN RFID API – Reference Manual 9