I use the following function for sending data over Bluetooth: void Send(const TDesC8& aDesc,TUint someFlags,TRequestStatus& aStatus,TSockXfrLength& aLen);
It works just fine: aLen always have the sent length (but you should not delete the aDesc until the RunL is called), except the situations when I try sending 100 times 10 kB buffers very fast. Then on some point the Bluetooth is simply stuck - no event comes that the data is sent. And on recieving side one can see, that data was sent only partially. And nothing happens. Interesting is that when I disconnect from the recieving side, phone does recieve the Disconnect event! :-| This is a complete mistery now: when I put a 100 ms timeout with User::After(100), then I can send this data - but this is not a good solution.
What I think is there buffer overflow appears in bluetooth controller on the phone. And bluetooth transmitter stops workin, or something like that. And RunL function is being called before the data was physically sent - this is not good at all!!!
So, how can I avoid this kind of behaviour? Are there any HCI or some low-level protocol commands to verify is transmitting buffer empty or not?
Thank you in advance,