Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to keep reading data constantly? #63

Open
Zopenzop opened this issue May 1, 2022 · 5 comments
Open

How to keep reading data constantly? #63

Zopenzop opened this issue May 1, 2022 · 5 comments

Comments

@Zopenzop
Copy link

Zopenzop commented May 1, 2022

In my case, data is inputted erratically through the serial port to my android device, thus the bulkTransferIn function doesn't really suite my purpose. Plugins like usb_serial let you specify a function to be run whenever the android device receives any data through the serial device. Should I run the bulkTransferIn function on a loop or is there a better way to achieve my purpose using this plugin?

@Sunbreak
Copy link
Collaborator

Sunbreak commented May 5, 2022

I'm not sure about the API, could you post an example?

@Zopenzop
Copy link
Author

Zopenzop commented May 5, 2022

I was looking for something like an event, I've tried the usb_serial package and it's port object has an event that triggers a function whenever it listens to data.

	port.inputStream.listen((Uint8List event) {
		print(event);
		port.close();
	});

@Sunbreak
Copy link
Collaborator

Sunbreak commented May 6, 2022

That would be a big feature request. I'm not sure I have enough time for cross-platform implementation.

PRs welcome

@Zopenzop
Copy link
Author

Zopenzop commented May 6, 2022

Ah sure, just needed to know if there was an existing implementation for the same.

@Zopenzop Zopenzop closed this as completed May 6, 2022
@Sunbreak
Copy link
Collaborator

Sunbreak commented May 6, 2022

I'd like to leave it open for future implementation

@Sunbreak Sunbreak reopened this May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants