12-15-2012 08:34 AM
Hi All, I am trying to send a batch of messages to PC from BB10 through Bluetooth
I use:
write( sppDataThread.getFD( ), msg1.toAscii( ), msg.size( ) ); write( sppDataThread.getFD( ), msg2.toAscii( ), msg.size( ) ); write( sppDataThread.getFD( ), msg3.toAscii( ), msg.size( ) );
I face a strange behaviour when i recieve these messages on PC.
I expect to recieve
msg1
msg2
msg3
but I recieve:
msg1
msg1msg2
msg1msg2msg3
I fixed this issue by using:
write( sppDataThread.getFD( ), msg1.toAscii( ), msg.size( ) ); sppDataThread.wait( 200 ) write( sppDataThread.getFD( ), msg2.toAscii( ), msg.size( ) ); sppDataThread.wait( 200 ) write( sppDataThread.getFD( ), msg3.toAscii( ), msg.size( ) );
But I dont want my thread to sleep . It seems that it is a caching issue. How to send messages immediattely correctly?
01-04-2013 12:27 PM
01-04-2013 12:52 PM
01-04-2013 01:09 PM
I can provide 'any' but not sure it will help you.
What is sppDataThread?
How do you declare msg, msg1, msg2 and msg3?
How do you initialize msg, msg1, msg2 and msg3?
01-04-2013 01:20 PM
01-04-2013 01:28 PM
I am not young so probably that's why I'll ask you to give all of them as well:
>How do you declare msg, msg1, msg2 and msg3?
>How do you initialize msg, msg1, msg2 and msg3?
01-04-2013 01:40 PM
01-04-2013 01:50 PM
I don't think it is 'block' issue.
What bothers me is in every wirte you use different variables to push into the socket but you have the same lengh of msg variable that is why I asked you to provide *all 4 variables declarations/initializations.
msg1.toAscii( ), msg.size( )
01-04-2013 01:59 PM
01-07-2013 04:37 PM
To hishamBakr
Could you show the code of all the functions where msg, msg1,msg2,msg3 are involved?
Ilya