at first I have an external device used to listening connection from other devices for example an android phone with bluetooth (spp protocol),when connected ,It send 64 packets to other side (begin with 0xff,0xff) and one packet of second type data begin with 0xff,0xfe,per second;
and then ,in b4a I have test two kinds of method ,1,use a timer interval 1ms when begin reading set its enable=false,when reading end set its enable=true;2,use asyncstream object,but in this way,the data received event got a buffer with random length for example 6byte,12byte,18byte,24byte,30byte and so on
so the question is:how many bytes should reading per times?when I read 12 bytes the buffer will accumulate many data as time goes by will more and more,when I read 1024bytes per times,there is no data accumulate,but I can't distinguish the packet is which kind .
any idea?thanks
and then ,in b4a I have test two kinds of method ,1,use a timer interval 1ms when begin reading set its enable=false,when reading end set its enable=true;2,use asyncstream object,but in this way,the data received event got a buffer with random length for example 6byte,12byte,18byte,24byte,30byte and so on
so the question is:how many bytes should reading per times?when I read 12 bytes the buffer will accumulate many data as time goes by will more and more,when I read 1024bytes per times,there is no data accumulate,but I can't distinguish the packet is which kind .
any idea?thanks