Application Programming Interface



Definitions





AHid_Init()



AHid_Init() has to be called first. It initializes the driver and sets the windows handle of the window that implements the Windows Message Queue to receive message notifications.

Besides it removes all present pipes previously registered with AHid_Register().



AHid_Register()



AHid_Register() adds a new data pipe to AHid.dll that can be used for data transfers. The parameters VID and PID are vendor specific. The Interface ID is only used with composite devices where it correlates to suchlike.

The values for Report ID, Report Size and Report Type are fundamental for the data transfer. These parameters are device specific. There is more information in the fundamentals.

AHid.dll only sends and receives reports of a fixed size. This fixed size is equal to Report Size or a multiple of it.
So, if you want to send data with AHid_Write() or read data with AHid_Read(), the number of bytes to transfer must always match this value (or a multiple of it). This is a small limitation that you have to keep in mind when developping your HID device and using it with AHid.dll.



AHid_Deregister()



You can remove a registered pipe by a call to AHid_Deregister().



AHid_Read()



AHid_Read() reads data from your device. The amount of requested bytes must be equal to (or a multiple of) the Report Size passed to AHid_Register().



AHid_Write()



AHid_Write() writes data to your device. The amount of written bytes must be equal to (or a multiple of) the Report Size passed to AHid_Register().



AHid_Find()



The function searches the HID device on USB.



AHid_Identify()



USB device can be identified by their device path. The device path is a string value defined by the USB device's parameters and the USB port used on your PC. The device path is a unique value.

Use AHid_Identify() to read the device path.



AHid_Request()



Feature reports have to be requested from the HID device. This function exactly is doing so. The returned Feature Report can then be read by AHid_Read().



AHid_Info()



AHid_Info() shows a message box with the version number.