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
New Contributor
Posts: 2
Registered: ‎09-18-2013
My Device: I'm a developer
My Carrier: none

BT connection with desktop computer.

Hello.

I'm trying to connect to the sample SPP chat application from my desktop and something goes wrong Smiley Sad.

 

What I do is the following:

 

1. Run the sample app and open an SPP server (it shows that it is waiting for a connection).

2. Call the winsock connect function with the right device address, GUID, protocol family and port set to zero... (I get the device address after succesfully paring with the device).

 

3. Try to send some text to the application...

 

Well, the problem is that I always fail in step 2....

 

WSAGetLastError returns error code 10060, which means that I've reached timout or failed connecting for some other reason...

 

Can anybody tell me what am I doing wrong?

In general, anyone can post an example of how to communicate between some desktop application and a BB device using BT?

 

Thanks,

Heinrich

 

 

Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: BT connection with desktop computer.

Hi,

 

I haven't used the windows API to make an SPP connection like this. Can you share source code so I could have a look at what's going on?

 

Thanks!

--
Rob is no longer associated with BlackBerry.
Highlighted
New Contributor
Posts: 2
Registered: ‎09-18-2013
My Device: I'm a developer
My Carrier: none

Re: BT connection with desktop computer.

Hello.

Here is the code snippet...

 

memset(&socket_addr, 0, sizeof(socket_addr));
socket_addr.addressFamily = AF_BTH;
socket_addr.btAddr = Devices[DeviceIdx].Address; // the device address is correct (I checked it manually).
socket_addr.serviceClassId = ServiceGuid; // this is actually the GUID used by the sample BT chat application...
err=connect(client_socket,(SOCKADDR *)&socket_addr,sizeof(socket_addr));

// and here I get err == SOCKET_ERROR....


err = WSAGetLastError(); // error code is 10060.

 

Thank you,

Heinrich

Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: BT connection with desktop computer.

Hi,

 

Can you try something for me? What happens if you use 0x1101 instead of the actual UUID?

 

Thanks!

--
Rob is no longer associated with BlackBerry.