Hallo,
I cannot use async stream library for communication with my microcontroller (MC).
if I use async stream with BT everything works fine , data flows every 300 ms from MC to android, they are in chunks but I get em kina immediatelly.
When I use same code but with wifi, it behaves quite differently, it buffers the data somehow and sometimes NEWDATA event is raised after 10 seconds and sends LOT of data.
I tried to use prefix mode which I think can resolve my problem but I cant make it work. I always get AStream_Error. I hope my data is OK , now i send from MC sequence of 142 bytes , so I substract 4 which is 138. 138 is 8A in hexa , so i sent following sequence
0000008AFE8102010200800000000000000000003C00F000000000009A006900000101012B6756CE01040100010C1739120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AA
I get the AStream_error eveytime. I do not know what I am doing wrong
Is it possible to get the source code of AsyncStream so I can modify it to serve my purposes, I can identify the header and footer of my message to parse it, or should I use RandomAcccessFile library and to do low level ReadBytes in some process and parse my message there ?
Please advice
I cannot use async stream library for communication with my microcontroller (MC).
if I use async stream with BT everything works fine , data flows every 300 ms from MC to android, they are in chunks but I get em kina immediatelly.
When I use same code but with wifi, it behaves quite differently, it buffers the data somehow and sometimes NEWDATA event is raised after 10 seconds and sends LOT of data.
I tried to use prefix mode which I think can resolve my problem but I cant make it work. I always get AStream_Error. I hope my data is OK , now i send from MC sequence of 142 bytes , so I substract 4 which is 138. 138 is 8A in hexa , so i sent following sequence
0000008AFE8102010200800000000000000000003C00F000000000009A006900000101012B6756CE01040100010C1739120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AA
I get the AStream_error eveytime. I do not know what I am doing wrong
Is it possible to get the source code of AsyncStream so I can modify it to serve my purposes, I can identify the header and footer of my message to parse it, or should I use RandomAcccessFile library and to do low level ReadBytes in some process and parse my message there ?
Please advice