It is not a massive work to verify incoming data. Can you give a verbatim example of data received ('good' data)?
Hey Uskiara, the delimiter byte is more commonly 10 rather than 13. Since Mok has no control over what the sending device, trial and error is necessary to discover the delimiter, if indeed there is one.
However the issue is not likely to be with the device as Mok has assumed. It is highly likely that the App is not processing the data fast enough, causing an 'overlap' of data in the buffer.
Hi Chris,
Yep !!!
But, according to what he has written, any message should be ended by a \n, so by setting a \n as the stop receiving character should exit the receiving function.
- DATA1,intdata1,intdata2\n
- DATA2,intdata1,intdata2\n
But it seems that is not the case.
Perhaps he could modify the receiver: instead of waiting for a terminator character, he could wait until the buffer is completely emptied...
Anyway, I'm with you, by solving the problem why the data are corrupted would be the best solution, but since he asks for a "quick and dirt" solution...
Ciao, ugo.
Beware of CR (13). That is used mostly in Windows and devices that expect to talk to Windows.
Hi,
yes I agree with both of you but, as Chris said, if the device is sending just the CR as message terminator, Mok has no chances. So my suggestion is to wait until the transmission ends for a while and gives a breath to the app...
(probably... )
Tschuess
The device sends data very well. The problem is that you receive this data badly and process it badly, and this is where the problem arises.
So Mok
Do you want to be helped or not? If the answer is yes, upload your Project File and I will take a look at it for you. Also need to see verbatim examples of the good data the device sends.
You are right
the corrupted data(ata2\nData2 or Data1,intdata1,intd) do nothing in app even not corrupting anything, bcz runtime error proccssing not to corrupt app. it just showing "hey this app is dumb, would you turn off? (whisper or not.. )" pop-up. and users click it even tho ignore the error by clicking other space.
I guess best way to solving problem is not always honest as programmer
i guess device developer is not lying. as Chris said, app is receiving splitted at wrong length. so thought "merge 2~3 buffer at once(like CCTV saving videos) and process delayed data", but it will be make another problems. for example, my app sending 2~3 command at first open, and processing each command for sending next like TCP connection. (e.g- send me your number - here, 9999 - oh, you are 9th device.. then make you 'A' mode - ok, then i will send you A's data - thank you :))
so as i said, it will be make a lot of works. i would change whole of project pipeline
my client allowed me to showing part of blocks but guess it will be not helpful to help(?) bcz as you and Uskiara said, did all of works to waste corrupted data correctly, and if i build more to more high level filter, i will be make ton of works.
maybe i got hints from Uskiara's idea. (as honest way lol)
if there is way to hide error pop-up, it will be totally helpful
thank you always! already so helpful.
From my experience, I know that these errors that call to close the application cannot be hidden. I could only hide the errors with the numbers. If something caused similar errors, I tried to prevent them by improving the application or introducing additional filters to prevent errors from occurring.
Hi Patryk
Right, thats most correct and right way.
but i dont have much time to change whole pipeline and than the problem doing.
so if 'hide' was, it would be best way to solve.
whatever, as you are saying, seems need to improve and make additional filters is only way to solve...
thank you
I think you should find out how the end of the data is actually marked. Then in the BT settings you enter the appropriate end-of-data character and add -1 to the data download block. Then you only receive one line of data and there is no problem with split received data and with garbage. Here, even filters would not be needed and repairing it would be quick.
Horse-to-water Mok. If you don't do it right, when the App fails - who will be blamed?
Read all I have said. This is not rocket science Mok. A whole App can be defined in a day. Why would your client "allow you to show part of the blocks". That implies that the client knows how to code the App - so do you really have a client on your back or is it that you feel you might be embarrassed if we see your code? Do not worry if you have made mistakes, we all do - I am the champion mistake maker I can assure you.
I saw a similar message fragmentation error in a BlueTooth BLE app, where the programmer took the different approach of using a global variable as an input buffer, and just adding incoming text to it as it arrived, regardless of delimiters. After each text fragment arrived, it would check if the hoped for delimiter was in the global buffer variable. If found, it would clip off the front of the buffer and try to use it, leaving the remainder of the buffer (after delimiter) there for the next cycle.
That's just a handful of code.
Definitely right. So im making another filter. ofc it will be make another bug, but i know nothing to way correct except this way. (and also i must fix it someday)
And also i thought "my client blabla i cant show bla" is so rude for you bcz this ai2 is not for totally private coding system. and even i asking to solve!
But there is new technology of client(new algorithm? core function?) in here and must be secret. and if i would to capture "where the problem coming from exactly", i have to show these that he warned not to open public several times
This is why I chose the ditry way. i couldn't ask right way...
(tbh, want to show off what i made )
so, im trying to fix it but gonna be long time. like as "A+B=true" is easy but "A+B+C=true" is not easier than think ('hey, just insert C more!' ...its not, you know).
im trying similar this way. ofc not be a handful bcz of ton of disorderly function conditions tho
thank you for good scolding, Chris! Really appreciate.
ps/ this app is for 'part of literally rocket' tho.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.