-
Notifications
You must be signed in to change notification settings - Fork 35
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
Read data from serial #7
Comments
How about just giving the port.read() method a fixed buffer? Or we specify the buffersize via param.
|
I studied the source code of this project a little bit and it looks like, for writing data, it just calls this:
Is it much harder to change this to 'read'? What exactly needs to be done to support reading from serial? |
Hi guys, have anyone implemented it already? I'm willing to pay for it if needed. |
Hey, yeah, we have a working fork for reading data. Nothing pretty, but it gets the job done: |
Hey @GreenGI thank you.
|
Basically - yes. This is how I use it on a component after mounting it: componentWillMount() {
this.getDeviceAsync().then(device => {
if (device) {
DeviceEventEmitter.addListener('newData', (e) => {
console.log('newData', e);
});
this.readDevice(device.id);
}
});
}
getDeviceListAsync = () => {
return UsbSerialModule.getDeviceListAsync();
};
readDevice = (id) => {
UsbSerialModule.readDeviceAsync(id);
}; |
Hi @GreenGI ! |
Hello,
Are you planning on implementing serial read as well? It would make the library extremely useful and complete.
Thanks for your great work
The text was updated successfully, but these errors were encountered: