This section describes the API functions provided in the IRI host library, exposed via the iri.h header file, used to configure the IRI host and communicate with the Indy Reader Modules. The API documented within are intended to be used as is, and not modified in any way.
This section does not include API that are part of the platform ports and ipj_util example code, as those API are intended to be modified or replaced by the user.
For examples of how to use these API functions in code, see the Configuration Examples and Example Programs sections of the documentation.
This function opens the serial port and connects the Host to the IRI device.
Parameters:
- iri_device -
IRI device data structure
- reader_identifier -
Identifier associated with IRI device
- connection_type -
Type of connection (Serial/TCP/etc)
- params -
Connection parameters (baudrate/etc) (NULL==default)
Before using an IRI device, the User application must do the following: allocate or declare IRI device data structure, initialize IRI device data structure, register platform handlers, and connect to the IRI device (this function).
Return: ipj_error
This function disconnects the Host from the IRI device and closes the serial port.
Parameters:
- iri_device -
IRI device data structure
User may disconnect from the IRI device after all operations are completed.
Return: ipj_error
Note
For more details on setting and getting keys, see the Configuration Commands section.
This function sets the value of the specified key code on the IRI device.
Parameters:
- iri_device -
IRI device data structure
- key -
Key code to set
- bank_index -
Key code bank_index to set (applicable for key codes with more than one copy)
- value_index -
Key code value_index to set (applicable for key codes with lists)
- value -
Value to set
Return: ipj_error
Note
This function is a simplified version of ipj_set which assumes a bank_index and value_index of 0.
For more details on setting and getting keys, see the Configuration Commands section.
This function sets the value of the specified key code on the IRI device.
Parameters:
- iri_device -
IRI device data structure
- key -
Key code to set
- value -
Value to set
Return: ipj_error
Note
For more details on setting and getting keys, see the Configuration Commands section.
This function sets the value of the specified key codes on the IRI device.
Parameters:
- iri_device -
IRI device data structure
- key_value -
Array of key codes and values to set
- key_value_count -
Number of key codes and values to set
- key_list -
Array of key codes to set (used for key codes with lists)
- key_list_count -
Number of keys codes (with lists) to set
Return: ipj_error
Note
For more details on setting and getting keys, see the Configuration Commands section.
This function retrieves the value of the specified key code from the IRI device.
Parameters:
- iri_device -
IRI device data structure
- key -
Key code to get
- bank_index -
Key code bank_index to get (applicable if more than one copy of a key)
- value_index -
Key code value_index to get (applicable for key code with lists)
- value -
Data buffer to store retrieved value
Return: ipj_error
Note
This is a simplified version of ipj_get which assumes a bank_index and value_index of 0.
For more details on setting and getting keys, see the Configuration Commands section.
This function retrieves the value of the specified key code from the IRI device.
Parameters:
- iri_device -
IRI device data structure
- key -
Key code to get
- value -
Data buffer to store retrieved value
Return: ipj_error
Note
For more details on setting and getting keys, see the Configuration Commands section.
This function retrieves the values of the specified key codes from the IRI device.
Parameters:
- iri_device -
IRI device data structure
- key_value -
Array of key codes to retrieve
- key_value_count -
Number of key codes and values to retrieve
- key_list -
Array of key codes to retrieve (used for key codes with lists)
- key_list_count -
Number of keys codes (with lists) to retrieve
Return: ipj_error
This function retrieves information about the specified key code from the IRI device.
Parameters:
- iri_device -
IRI device data structure
- key -
Key code to get info
- key_info -
Information about the specified key code
Return: ipj_error
Note
The Configuration Examples contain a number of examples of using this API to initiate actions, including RFID, GPIO, low power mode entry, etc.
This function starts the specified action or operation on the IRI device.
Parameters:
- iri_device -
IRI device data structure
- action -
Actions or operations to start
This function is used to start inventory to read tags.
Return: ipj_error
Note
This feature is not available in this release and will return a E_IPJ_ERROR_NOT_IMPLEMENTED error code if called.
This function resumes the specified action or operation on the IRI device.
Parameters:
- iri_device -
IRI device data structure
- action -
Actions or operations to be resumed
This function is used to resume operations after the IRI device has halted.
Return: ipj_error
This function stops the specified action or operation on the IRI device.
Parameters:
- iri_device -
IRI device data structure
- action -
Actions or operations to be stopped
This function is used to stop inventory to read tags.
Return: ipj_error
Note
For more details on using this API function, see the IRI_Intro code example.
This function processes incoming reports from the IRI device.
Parameters:
- iri_device -
IRI device data structure
User calls this function to process incoming data. This function requests available data from the platform receive handler, buffers data, and checks for complete reports. This function returns immediately if there is not sufficient data for a report. Once a complete report is received, this function calls the report handler before returning.
User decides when to call this function. For example, User can poll or wait for an interrupt from the system. User responsibility to call this function to keep the receive buffer from overflowing.
Return: ipj_error
This function resets the IRI device.
Parameters:
- iri_device -
IRI device data structure
- reset_type -
Type of reset to perform
State of the IRI device is not preserved across resets.
Return: ipj_error
Note
For more details on using this API function, see the Change Baud Rate configuration example.
This function modifies the serial port baud rate used to talk to an IRI device.
Parameters:
- iri_device -
IRI device data structure
- connection_type -
Connection modification type
- params -
Connection modification parameters
Before modifying an iri connection, the user must have already successfully connected to a device.
Return: ipj_error
This function allows the user to suppress all ‘set’ and ‘bulk-set’ action responses generated by the reader.
Parameters:
- iri_device -
IRI device data structure
The user will be responsible for checking and dealing with errors on the device.
Return: ipj_error
This function allows the user to resume generation of ‘set’ action responses by the reader.
Parameters:
- iri_device -
IRI device data structure
All ‘set’ and ‘bulk-set’ actions will receive an associated response containing success/failure status of the command (This is the default)
Return: ipj_error
This function allows the user to set the amount of time the receive state machine should wait before returning a timeout error.
Parameters:
- iri_device -
IRI device data structure
- timeout_ms -
Timeout value in milliseconds
Return: ipj_error
This function returns the API version.
Return: uint32_t
This function initializes the IRI device data structure.
Parameters:
- iri_device -
IRI device data structure
Before using an IRI device, the User application must do the following: allocate or declare IRI device data structure, initialize IRI device data structure (this function), register platform handlers, and connect to the IRI device.
Return: ipj_error
This function deinitializes the IRI device data structure.
Parameters:
- iri_device -
IRI device data structure
User may deinitialize IRI device after disconnecting from the IRI device. Once the IRI device is deinitialized, the User may de-allocate the IRI device data structure.
Return: ipj_error
Note
For more details on the platform and report handlers, see the Platform and Report Handlers section.
This function registers platform and report handlers.
Parameters:
- iri_device -
IRI device data structure
- handler_type -
Type of handler to register
- handler -
Handler pointer
Before using an IRI device, the User application must do the following: allocate or declare IRI device data structure, initialize IRI device data structure, register platform handlers (this function or the _ext-suffixed version), and connect to the IRI device.
User application registers the following platform handlers: platform open port handler, platform close port handler, platform receive handler, platform transmit handler, and platform timestamp handler.
User application registers report handler to handle the following reports: tag operation report, error report, and stop report
Return: ipj_error
This function takes in an IRI_Loader chunk and processes it accordingly.
Parameters:
- iri_device -
IRI device data structure
- len -
Length of the data chunk (in bytes)
- data -
Pointer to the data chunk to be processed
Return: ipj_error
void IPJ_CLEAR_STRUCT (struct);
IPJ_CLEAR_STRUCT is a convenience macro provided to clear out IRI related structures before use.
We recommend using this macro on every data structure passed into an IRI function to ensure proper behavior.