Start transfer data by event or Callback function

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

cross mob
qiko_3575871
Level 3
Level 3

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
Moderator
First like given First question asked 750 replies posted

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
Moderator
First like given First question asked 750 replies posted

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
0 Likes

OK. Thanks!

0 Likes