This interface provides a wrapper around the C++ library for use in C and other languages.
More...
|
|
typedef void * | FiuClientHandle |
| | FIU client handle.
|
|
| FIU_API unsigned int | FiuClient_Version () |
| | Get the version of the library as an unsigned base 10 integer.
|
| FIU_API const char * | FiuClient_ErrorMessage (int error) |
| | Get a message describing an error code returned by the library.
|
| FIU_API int | FiuClient_Init (FiuClientHandle *handle_out) |
| | Initialize an FIU client.
|
| FIU_API void | FiuClient_Destroy (FiuClientHandle *handle) |
| | Destroy an FIU client.
|
| FIU_API int | FiuClient_Open (FiuClientHandle handle, const char *port) |
| | Open a serial connection to the FIU.
|
| FIU_API int | FiuClient_Close (FiuClientHandle handle) |
| | Close the serial port.
|
| FIU_API int | FiuClient_SetBoxID (FiuClientHandle handle, uint8_t box_id) |
| | Set the target box ID.
|
| FIU_API int | FiuClient_GetBoxID (FiuClientHandle handle, uint8_t *box_id_out) |
| | Get the target box ID.
|
| FIU_API int | FiuClient_SetChannelState (FiuClientHandle handle, unsigned int channel, uint8_t state) |
| | Set the state of a channel.
|
| FIU_API int | FiuClient_SetAllChannelStates (FiuClientHandle handle, uint8_t state) |
| | Set the state of all channels.
|
| FIU_API int | FiuClient_GetChannelStates (FiuClientHandle handle, uint8_t states_out[], unsigned int states_len) |
| | Get the states of all 24 channels.
|
| FIU_API int | FiuClient_GetFirmwareVersion (FiuClientHandle handle, FiuFirmwareVersion *version_out) |
| | Get the firmware version loaded onto the FIU.
|
| FIU_API int | FiuClient_SetSoftwareInterlock (FiuClientHandle handle, bool en) |
| | Set the state of the software interlock.
|
| FIU_API int | FiuClient_GetInterlockState (FiuClientHandle handle, bool *interlock_out) |
| | Get the system interlock state.
|
This interface provides a wrapper around the C++ library for use in C and other languages.
◆ FiuClient_Close()
Close the serial port.
- Note
- This does not destroy the client.
- Parameters
-
- Returns
- 0 on success or a negative error code.
◆ FiuClient_Destroy()
Destroy an FIU client.
- Parameters
-
| [in,out] | handle | pointer to a handle to destroy |
◆ FiuClient_ErrorMessage()
| FIU_API const char * FiuClient_ErrorMessage |
( |
int | error | ) |
|
Get a message describing an error code returned by the library.
- Note
- This function never returns a null pointer.
- Parameters
-
- Returns
- A null-terminated error message.
◆ FiuClient_GetBoxID()
| FIU_API int FiuClient_GetBoxID |
( |
FiuClientHandle | handle, |
|
|
uint8_t * | box_id_out ) |
Get the target box ID.
- Parameters
-
| [in] | handle | FIU client |
| [out] | box_id_out | address of an integer to store the box ID |
- Returns
- 0 on success or a negative error code.
◆ FiuClient_GetChannelStates()
| FIU_API int FiuClient_GetChannelStates |
( |
FiuClientHandle | handle, |
|
|
uint8_t | states_out[], |
|
|
unsigned int | states_len ) |
Get the states of all 24 channels.
- Parameters
-
| [in] | handle | FIU client |
| [out] | states_out | array to store states in |
| [in] | states_len | length of states_out |
- Returns
- 0 on success or a negative error code.
◆ FiuClient_GetFirmwareVersion()
Get the firmware version loaded onto the FIU.
- Parameters
-
| [in] | handle | FIU client |
| [out] | version_out | address of a firmware version structure to store the result |
- Returns
- 0 on success or a negative error code.
◆ FiuClient_GetInterlockState()
| FIU_API int FiuClient_GetInterlockState |
( |
FiuClientHandle | handle, |
|
|
bool * | interlock_out ) |
Get the system interlock state.
- Parameters
-
| [in] | handle | FIU client |
| [out] | interlock_out | address of a bool to store the interlock state |
- Returns
- 0 on success or a negative error code.
◆ FiuClient_Init()
Initialize an FIU client.
- Note
- The caller must destroy the client with FiuClient_Destroy() when it is no longer needed.
- Parameters
-
| [out] | handle_out | pointer to a handle to initialize (handle should be zeroed) |
- Returns
- 0 on success or a negative error code.
◆ FiuClient_Open()
Open a serial connection to the FIU.
- Parameters
-
| [in] | handle | FIU client |
| [in] | port | serial port to open (e.g., COM4) |
- Returns
- 0 on success or a negative error code.
◆ FiuClient_SetAllChannelStates()
| FIU_API int FiuClient_SetAllChannelStates |
( |
FiuClientHandle | handle, |
|
|
uint8_t | state ) |
Set the state of all channels.
This function can only be used with the connected and disconnected states, as the others require the use of shared resources.
- Parameters
-
| [in] | handle | FIU client |
| [in] | state | desired channel state (see Channel States) |
- Returns
- 0 on success or a negative error code.
◆ FiuClient_SetBoxID()
Set the target box ID.
This can be changed on the fly to target multiple devices on the same bus.
- Parameters
-
| [in] | handle | FIU client |
| [in] | box_id | new target box ID, 0-6 |
- Returns
- 0 on success or a negative error code.
◆ FiuClient_SetChannelState()
| FIU_API int FiuClient_SetChannelState |
( |
FiuClientHandle | handle, |
|
|
unsigned int | channel, |
|
|
uint8_t | state ) |
Set the state of a channel.
- Parameters
-
| [in] | handle | FIU client |
| [in] | channel | target channel, 0-23 |
| [in] | state | desired channel state (see Channel States) |
- Returns
- 0 on success or a negative error code.
◆ FiuClient_SetSoftwareInterlock()
| FIU_API int FiuClient_SetSoftwareInterlock |
( |
FiuClientHandle | handle, |
|
|
bool | en ) |
Set the state of the software interlock.
- Parameters
-
| [in] | handle | FIU client |
| [in] | en | whether to enable the software interlock |
- Returns
- 0 on success or a negative error code.
◆ FiuClient_Version()
| FIU_API unsigned int FiuClient_Version |
( |
| ) |
|
Get the version of the library as an unsigned base 10 integer.
For example, version 1.2.3 would return 10203.
This is intended to be used to check for the existence of certain functionality based on library version, particularly in wrappers (such as Python).
- Returns
- The library version.