AGHAF
4.5.1
Annecy electronique Generic Hardware Access Framework
|
API to interrogate AEDS about connected devices. More...
enum | AGHAF_BOOL { AGHAF_FALSE = 0 , AGHAF_TRUE = 1 } |
enumerator to get a bool definition More... | |
enum | AGHAF_Status { AGHAF_STATUS_OK = 0 , AGHAF_ERROR_PARAM , AGHAF_ERROR_NOT_ENOUGH_MEMORY , AGHAF_ERROR_OUT_OF_MEMORY , AGHAF_ERROR_NOT_IMPLEMENTED , AGHAF_ERROR_END_REACHED , AGHAF_INTERNAL_ERROR , AGHAF_ERROR_CONNECTION , AGHAF_ERROR_BUS_NOT_FOUND , AGHAF_ERROR_PENDING , AGHAF_ERROR_WRONG_STATE , AGHAF_ERROR_NOT_ENOUGH_BUS , AGHAF_WRONG_SERVICE_VERSION , AGHAF_TIMEOUT_COM , AGHAF_DEPRECATED , AGHAF_ERROR_SEQUENCE , AGHAF_ERROR_FIFOFULL , AGHAF_ERROR_ALREADY_OPEN , AGHAF_ERROR_BUSY , AGHAF_ERROR_NOMORECHANNEL , AGHAF_ERROR_UNKNOWN , AGHAF_ERROR_WRONG_SESSION_TYPE , AGHAF_ERROR_NO_DATA = 0xff } |
enumerator to define the error type in aghaf functions More... | |
enum | AGHAF_ConnectionMode { AGHAF_OFFLINE , AGHAF_USB , AGHAF_ETH } |
deprecated More... | |
enum | AGHAF_DeviceEvent { AGHAF_Device_noEvent , AGHAF_Device_Arrival , AGHAF_Device_Leave , AGHAF_Device_Present } |
device event fot hotplug management More... | |
enum | AGHAF_TypeEvent { AGHAF_TypeNoEvent , AGHAF_TypeDeviceEvent , AGHAF_TypeEthernetEvent , AGHAF_TypeCanEvent , AGHAF_TypeDoCanEvent } |
type of event received in a callback More... | |
enum | AGHAF_DeviceState { AGHAF_DeviceState_error = 0 , AGHAF_DeviceState_boot , AGHAF_DeviceState_ready } |
current state of the device (in the boot or in the application part of the firmware) More... | |
typedef void * | AGHAF_Device |
handle on an exxotest device | |
typedef void * | AGHAF_Event |
Typedef of a native event handle that can be used to wait for events. | |
typedef void(* | AGHAF_Callback) (AGHAF_Event event, void *userContext) |
callback for the devices hotplug management More... | |
typedef enum AGHAF_DeviceState | AGHAF_DeviceState |
current state of the device (in the boot or in the application part of the firmware) | |
typedef struct AGHAF_DeviceInfo | AGHAF_DeviceInfo |
structure containing the informtions about a device | |
typedef struct AGHAF_EventInfo | AGHAF_EventInfo |
generic stucture to read an event in a callback | |
uint32_t | AGHAF_getVersion () |
Return the version from Aghaf. More... | |
uint32_t | AGHAF_getServiceVersion () |
Return the version from aeds. More... | |
char const * | AGHAF_getVersionString () |
Return the version from Aghaf. More... | |
AGHAF_BOOL | AGHAF_isServiceRunning () |
Inform if ghaston is running or not. More... | |
char const * | AGHAF_DeviceEvent_getProductName (AGHAF_Event event) |
return the product name from the device which emitted the device event More... | |
char const * | AGHAF_DeviceEvent_getProductNumber (AGHAF_Event event) |
return the product number from the device which emitted the device event More... | |
char const * | AGHAF_DeviceEvent_getSerialNumber (AGHAF_Event event) |
return the serial number from the device which emitted the device event More... | |
uint8_t const * | AGHAF_DeviceEvent_getHardwareUniqueId (AGHAF_Event event) |
return the hardware unique id from the device which emitted the device event More... | |
uint32_t | AGHAF_getDeviceCount () |
Return the number of devices onnected. More... | |
AGHAF_Status | AGHAF_getDeviceList (AGHAF_DeviceInfo **devices, uint32_t *size) |
Provide the list of devices connected. More... | |
void | AGHAF_freeDeviceList (AGHAF_DeviceInfo *devices) |
Free the memory allocated with AGHAF_getDeviceList. More... | |
AGHAF_Status | AGHAF_refreshDeviceList () |
Call the device event callbacks with the devices connected. More... | |
AGHAF_Device | AGHAF_getDeviceBySN (const char *productNumber, const char *serialNumber) |
Return the handle on the specified device. More... | |
AGHAF_Device | AGHAF_getDeviceByHardID (uint8_t const *hardwareID) |
AGHAF_getDeviceByHardID. More... | |
AGHAF_Status | AGHAF_getDeviceInfo (AGHAF_Device device, AGHAF_DeviceInfo *deviceInfo) |
Return the informations from a device. More... | |
AGHAF_ConnectionMode | AGHAF_Device_getConnectionMode (AGHAF_Device device) |
AGHAF_Device_getConnectionMode. More... | |
void | AGHAF_Device_getFriendlyNameEthCard (AGHAF_Device device, char **name) |
AGHAF_Device_getFriendlyNameEthCard. More... | |
void | AGHAF_Device_freeFriendlyName (char *friendlyName) |
Free the memory allocated with AGHAF_Device_getFriendlyNameEthCard. More... | |
AGHAF_Status | AGHAF_Device_getUsbInfo (AGHAF_Device device, uint16_t *vid, uint16_t *pid, uint16_t *rev) |
AGHAF_Device_getUsbInfo. More... | |
AGHAF_Status | AGHAF_openDevice (AGHAF_Device device) |
Open a device. More... | |
AGHAF_Status | AGHAF_closeDevice (AGHAF_Device device) |
close the device More... | |
AGHAF_Status | AGHAF_Device_getTimestamp (AGHAF_Device device, uint64_t *timestamp) |
Return the current timestamp on the device. More... | |
AGHAF_Status | AGHAF_Event_getInfo (AGHAF_Event event, AGHAF_EventInfo *info) |
AGHAF_Event_getInfo. More... | |
void | AGHAF_registerCallback (AGHAF_Callback callback, void *userContext) |
Register a callback for the device event. More... | |
void | AGHAF_deregisterCallback (AGHAF_Callback callback) |
Deregister a callback. More... | |
API to interrogate AEDS about connected devices.
AGHAF_Callback |
callback for the devices hotplug management
event | handle on the event |
userContext | context given in AGHAF_registerCallback |
enum AGHAF_BOOL |
enum AGHAF_ConnectionMode |
enum AGHAF_DeviceEvent |
enum AGHAF_DeviceState |
enum AGHAF_Status |
enumerator to define the error type in aghaf functions
Enumerator | |
---|---|
AGHAF_STATUS_OK | The operation succeeded. |
AGHAF_ERROR_PARAM | One or more parameters are invalid. |
AGHAF_ERROR_NOT_ENOUGH_MEMORY | Not enough memory. Generally means that the output buffer of a function is too small to hold all the data. |
AGHAF_ERROR_OUT_OF_MEMORY | This is an internal error meaning that the library or its underlying elements have run out of memory. |
AGHAF_ERROR_NOT_IMPLEMENTED | The function is not yet implemented. This error probably means that you are using an unstable development version. Please contact software support to get the latest stable version. |
AGHAF_ERROR_END_REACHED | There was not enough elements left and the end has been reached. This error happens when trying to access at least 1 element after the end, i.e. reading the last element does not trigger this error. |
AGHAF_INTERNAL_ERROR | There was an error in internal object management. |
AGHAF_ERROR_CONNECTION | This error happens when communication with service is lost. |
AGHAF_ERROR_BUS_NOT_FOUND | This error happens when trying to access a bus or device with a invalid handle. |
AGHAF_ERROR_PENDING | Internal use only. |
AGHAF_ERROR_WRONG_STATE | This error happens when user call function in wrong state. |
AGHAF_ERROR_NOT_ENOUGH_BUS | This error happens when user try to access a wrong AGHAF_DoCAN_Bus. |
AGHAF_WRONG_SERVICE_VERSION | This error happens when the service is not compatible with the version of this library. |
AGHAF_TIMEOUT_COM | This error happens when service take too long time to response. |
AGHAF_DEPRECATED | This error happens when a function is deprecated. |
AGHAF_ERROR_SEQUENCE | sequence of function call is wrong |
AGHAF_ERROR_FIFOFULL | intern fifo if full |
AGHAF_ERROR_ALREADY_OPEN | device already opened |
AGHAF_ERROR_BUSY | busy |
AGHAF_ERROR_NOMORECHANNEL | no more do can channels are available |
AGHAF_ERROR_UNKNOWN | unknown error, contact your provider |
AGHAF_ERROR_WRONG_SESSION_TYPE | the type of the session does not match the function called |
AGHAF_ERROR_NO_DATA | This error happens when a problem occur between this library and service. |
enum AGHAF_TypeEvent |
AGHAF_Status AGHAF_closeDevice | ( | AGHAF_Device | device | ) |
close the device
device | handle on the device |
void AGHAF_deregisterCallback | ( | AGHAF_Callback | callback | ) |
void AGHAF_Device_freeFriendlyName | ( | char * | friendlyName | ) |
Free the memory allocated with AGHAF_Device_getFriendlyNameEthCard.
friendlyName | name to free |
AGHAF_ConnectionMode AGHAF_Device_getConnectionMode | ( | AGHAF_Device | device | ) |
AGHAF_Device_getConnectionMode.
device |
void AGHAF_Device_getFriendlyNameEthCard | ( | AGHAF_Device | device, |
char ** | name | ||
) |
AGHAF_Device_getFriendlyNameEthCard.
device | |
name |
AGHAF_Status AGHAF_Device_getTimestamp | ( | AGHAF_Device | device, |
uint64_t * | timestamp | ||
) |
Return the current timestamp on the device.
device | handle on the device |
timestamp | will be filled with the timestamp if request success |
AGHAF_Status AGHAF_Device_getUsbInfo | ( | AGHAF_Device | device, |
uint16_t * | vid, | ||
uint16_t * | pid, | ||
uint16_t * | rev | ||
) |
AGHAF_Device_getUsbInfo.
device | |
vid | |
pid | |
rev |
uint8_t const* AGHAF_DeviceEvent_getHardwareUniqueId | ( | AGHAF_Event | event | ) |
return the hardware unique id from the device which emitted the device event
event |
char const* AGHAF_DeviceEvent_getProductName | ( | AGHAF_Event | event | ) |
return the product name from the device which emitted the device event
event |
char const* AGHAF_DeviceEvent_getProductNumber | ( | AGHAF_Event | event | ) |
return the product number from the device which emitted the device event
event |
char const* AGHAF_DeviceEvent_getSerialNumber | ( | AGHAF_Event | event | ) |
return the serial number from the device which emitted the device event
event |
AGHAF_Status AGHAF_Event_getInfo | ( | AGHAF_Event | event, |
AGHAF_EventInfo * | info | ||
) |
AGHAF_Event_getInfo.
event | |
info |
void AGHAF_freeDeviceList | ( | AGHAF_DeviceInfo * | devices | ) |
Free the memory allocated with AGHAF_getDeviceList.
devices | array to free |
AGHAF_Device AGHAF_getDeviceByHardID | ( | uint8_t const * | hardwareID | ) |
AGHAF_getDeviceByHardID.
hardwareID |
AGHAF_Device AGHAF_getDeviceBySN | ( | const char * | productNumber, |
const char * | serialNumber | ||
) |
Return the handle on the specified device.
productNumber | product number of the device |
serialNumber | serial number of the device |
uint32_t AGHAF_getDeviceCount | ( | void | ) |
Return the number of devices onnected.
AGHAF_Status AGHAF_getDeviceInfo | ( | AGHAF_Device | device, |
AGHAF_DeviceInfo * | deviceInfo | ||
) |
Return the informations from a device.
device | handle on the device |
deviceInfo | pointer to fill with the data |
AGHAF_Status AGHAF_getDeviceList | ( | AGHAF_DeviceInfo ** | devices, |
uint32_t * | size | ||
) |
Provide the list of devices connected.
devices | pointer to fill with devices |
size | number of devices in devices |
uint32_t AGHAF_getServiceVersion | ( | void | ) |
Return the version from aeds.
uint32_t AGHAF_getVersion | ( | void | ) |
Return the version from Aghaf.
char const* AGHAF_getVersionString | ( | void | ) |
Return the version from Aghaf.
AGHAF_BOOL AGHAF_isServiceRunning | ( | void | ) |
Inform if ghaston is running or not.
AGHAF_Status AGHAF_openDevice | ( | AGHAF_Device | device | ) |
Open a device.
device | handle on the device |
AGHAF_Status AGHAF_refreshDeviceList | ( | void | ) |
Call the device event callbacks with the devices connected.
void AGHAF_registerCallback | ( | AGHAF_Callback | callback, |
void * | userContext | ||
) |
Register a callback for the device event.
callback | |
userContext |