Hi, Marcob
I just read your post, and am going to test your library. I want to appreciate your work, definately! I still want to explain my project and ask some questions:
I am having an external piece of a hardware, equipped with FT232RL and a microcontroller, which is sending (continuously) packets of 581 bytes, with a about 1 msec pause between the packets. The Android app needs to receive these packets WHENEVER they arrive, without constantly polling for them (the arriving packets are like interrupting events to the software). With your library, I probably need to use a timer, which would take over once in a 10 mSec and read the incoming data (if there is data: the hardware may be switched off from time to time). In case there is a data received, it should be processed further.
I used to use UsbSerial Library from B4A (AGraham) and it uses AsyncStreams class, which uses methods like:
...astreams.Initialize(usb.GetInputStream, usb.GetOutputStream, "astreams")
...Sub Astreams_NewData (Buffer() As Byte)
...Sub Astreams_Terminated
...Sub AStreams_Error
in this implementation, the most valuable method for me is Astreams_NewData, which gives me the received data, WHENEVER it arrives
and there is no need to repeatedly poll for data.
So my questions are:
If there is no chance for you incorporate AsyncStreams to work with your library, would it be better solution for me to use a timer and repeatedly ask for data (mSerial.read(buf)) ?
Why there is a chance to have data lost? (perhaps this questions requires a long answer, so just please answer What if my packets are 581 bytes long, and would there be data lost since the USB packets are (are they?) 64 bytes long?
Thanks in advance for your answers!
I am starting tests with your library right now and will keep you informed.
Best regards: Krokiz
to Toley:
Quote: "Hi krokiz, can you tell us what do not work for you in the usbserial 2.3 library ?"
I used the UsbSerial library by AGraham, and it kept giving me an error ("Expected at least 2 bytes (IOexception.....)") when working with FT232RL, UNLIKE when using CP2102, it works perfectly with the latter chip. So I got sad, because I have used and intent to continue to use FTDI chip in my hardware. Here is why I am asking so much for this NEW FTDriver Library.
Best regards: Krokiz
I just read your post, and am going to test your library. I want to appreciate your work, definately! I still want to explain my project and ask some questions:
I am having an external piece of a hardware, equipped with FT232RL and a microcontroller, which is sending (continuously) packets of 581 bytes, with a about 1 msec pause between the packets. The Android app needs to receive these packets WHENEVER they arrive, without constantly polling for them (the arriving packets are like interrupting events to the software). With your library, I probably need to use a timer, which would take over once in a 10 mSec and read the incoming data (if there is data: the hardware may be switched off from time to time). In case there is a data received, it should be processed further.
I used to use UsbSerial Library from B4A (AGraham) and it uses AsyncStreams class, which uses methods like:
...astreams.Initialize(usb.GetInputStream, usb.GetOutputStream, "astreams")
...Sub Astreams_NewData (Buffer() As Byte)
...Sub Astreams_Terminated
...Sub AStreams_Error
in this implementation, the most valuable method for me is Astreams_NewData, which gives me the received data, WHENEVER it arrives
and there is no need to repeatedly poll for data.
So my questions are:
If there is no chance for you incorporate AsyncStreams to work with your library, would it be better solution for me to use a timer and repeatedly ask for data (mSerial.read(buf)) ?
Why there is a chance to have data lost? (perhaps this questions requires a long answer, so just please answer
Thanks in advance for your answers!
I am starting tests with your library right now and will keep you informed.
Best regards: Krokiz
to Toley:
Quote: "Hi krokiz, can you tell us what do not work for you in the usbserial 2.3 library ?"
I used the UsbSerial library by AGraham, and it kept giving me an error ("Expected at least 2 bytes (IOexception.....)") when working with FT232RL, UNLIKE when using CP2102, it works perfectly with the latter chip. So I got sad, because I have used and intent to continue to use FTDI chip in my hardware. Here is why I am asking so much for this NEW FTDriver Library.
Best regards: Krokiz