Program blocks on continuous reception
Hi,
having a device that sends a data frequently, say, at minimum interval of 250 ms or going down to 10 ms, blocks after showing first few characters, and app has to be restarted.
In my case it works only when just a few bytes are send once awhile, i.e. when pressing a key on a device.
Would it be possible to handle faster transfers?
Regards, Uros
Shabat Shalom =), yes possible, I have tested 1.0.9 version on interval 50 ms(work fine) transfer from stm32F4Discovery board - but after few seconds (data also lost ~20%), every time need hit Clear button, - it's happens because UI little bit slow with big data update. and than tested with 07 ms interval(data lost ~35%)
I need research and try improve work with UI, or try to collect data into file, I think.
Now in 1.1.0 improved work with receiving data from connected device.
so long answer - I been on War in Ukraine(Ukrainian officer), Russia vs Ukraine. Now I demobilized, officially. Now I try to return in this world from hell on war =)
Hello, First of all, thank you for this valuable work. :) It's good to see that you have moved from TimerTask to Service. Yes, I was facing the same issue with your previous application. As, data comes too fast. The UI slows down and then application goes not responding. Also, the application crashed many times when I closed application, as broadcastReceiver is not unregistered.
In order to receive data at fast rate and show on screen, I tried following things.
Firstly, As I read on google that bulkTransfer is bit buggy, so I used UsbRequest to collect data. Removed TimerTask, reading the data in separate thread in continous loop. With UsbRequest I found no data loss. I have successfully received around 11500 bits per second.
In order to show the data on screen, which is not possible at that interval rate(6-7ms). I buffered the data and posted with 30fps on main UI.
So, buffering the data and posting with some good frequency might be one solution to UI update problem. Still, with 30fps garbage-collector goes weird.
So, for this kind of situation, I am looking forward to use SurfaceView. As, it can update the ui at it's own pace.
would like to hear from you.
Thank you, akash
sorry.. I don't know identation rules here...
akash.
you can create pull request for review your code, I thinking about to save both of them UsbRequest and bulkTransfer - and add option in settings for select implementation work for read data from device thanks you =)