Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

CYAPI - Detect if some other application is using the USB device

CYAPI - Detect if some other application is using the USB device

Anonymous
Not applicable
Question: How do I detect using the CYAPI library, if some other application is already using my USB device?

 

Answer:

The IsOpen() method can be used to check the same. This method is a member of the CCyUSBDevice class. The IsOpen( ) method returns true if CCyUSBDevice object already has a valid handle to a device attached to the CyUSB driver.

For example: 

 

if(USBDevice -> IsOpen())
{
// The device is open and is being used by another application
// This condition is also true if the current application has opened the device and has a handle
}

0 Likes
268 Views
Contributors