cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

qiko_3575871
New Contributor

Could somebody give me a help.

I want to know if it will trigger an event when there is  data to read?

Or if I can set a callback function, when there is data to read, it will call the callback function.

I have a usb device, and it will send data to PC at any time. So I need a event to notify the host that there is data to read. Or I can set a callback function.

Thanks!

0 Likes
1 Solution
Hemanth
Moderator
Moderator

Hi,

I think your query is on the Host Application implementation (which is using cyapi library).

Please know that there are no such callbacks possible.

One option is that you can wait indefinitely for the device to send data after you call transfer function for the data.

The other is: You would have to set a timeout for your transfer function. If timeout occurred without any data, then you need to call the transfer function again. This is the polling method but the timeout value you set can be based on how frequently your data transfers the data.

Regards,

Hemanth.

Hemanth

View solution in original post

0 Likes
2 Replies
Hemanth
Moderator
Moderator

Hi,

I think your query is on the Host Application implementation (which is using cyapi library).

Please know that there are no such callbacks possible.

One option is that you can wait indefinitely for the device to send data after you call transfer function for the data.

The other is: You would have to set a timeout for your transfer function. If timeout occurred without any data, then you need to call the transfer function again. This is the polling method but the timeout value you set can be based on how frequently your data transfers the data.

Regards,

Hemanth.

Hemanth

View solution in original post

0 Likes
qiko_3575871
New Contributor

OK. Thanks!

0 Likes