Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition
My Carrier: 00201003883386

How to disable buffer while writing to Bluetooth ? to send a

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?

When you are young, work to learn. Not to earn !
Contributor
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition
My Carrier: 00201003883386

Re: How to disable buffer while writing to Bluetooth ? to send a

any help
When you are young, work to learn. Not to earn !
Contributor
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition
My Carrier: 00201003883386

Re: How to disable buffer while writing to Bluetooth ? to send a

any reply Smiley Sad
When you are young, work to learn. Not to earn !
Highlighted
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: How to disable buffer while writing to Bluetooth ? to send a

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? 

Contributor
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition
My Carrier: 00201003883386

Re: How to disable buffer while writing to Bluetooth ? to send a

sppDataThread is a thread used to handle bluetooth connection

QString msg1="msg1";
When you are young, work to learn. Not to earn !
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: How to disable buffer while writing to Bluetooth ? to send a

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?

Contributor
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition
My Carrier: 00201003883386

Re: How to disable buffer while writing to Bluetooth ? to send a

I am sorry I didnt get your point. I answered your questions

the issue is. bluetooth buffer a block then flush it. I want to disable that flush by block and I want it to be flush by line
When you are young, work to learn. Not to earn !
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: How to disable buffer while writing to Bluetooth ? to send a

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( )
Contributor
Posts: 45
Registered: ‎04-11-2012
My Device: Z10 Limited Edition
My Carrier: 00201003883386

Re: How to disable buffer while writing to Bluetooth ? to send a

Smiley Happy
No that is not the issue

actually the original code is :a method that is called when user presses on a button

when user clicks the button and waits for 400 millisecond between clicks--> no issue happens

when user clicks the button and waits less than 400 millisecond between clicks--> the issue happens


I just wrote msg1,msg2,msg3 to describe my issue

When you are young, work to learn. Not to earn !
Retired
Posts: 4
Registered: ‎12-07-2012
My Device: BB10
My Carrier: Rogers

Re: How to disable buffer while writing to Bluetooth ? to send a

To hishamBakr

 

 

Could you show the code of all the functions where msg, msg1,msg2,msg3 are involved?

 

Ilya