How to connect to a particular Bluetooth address

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Created: mahbub_s60 (10 May 2008)
Last edited: hamishwillee (26 Jul 2012)


This code snippet shows how we can connect to a Bluetooth device over RFCOMM when we know the address. If we know the address and channel number of interested service then it can be connected directly. If we don't know the channel number then we need to find it as usual way and then we can connect.

   TBTDevAddr devAddr(MAKE_TINT64(0x0019, 0x79fa2193));
// 001979fa2193 is target BT address divided into two parts
TBTSockAddr asocket;
//Assuming the expected service is advertised on channel 5

When Channel number is not known

   TBTDevAddr devAddr(MAKE_TINT64(0x0019, 0x79fa2193));				
iState = EGettingService;
iStatus = KRequestPending;
iServiceSearcher->FindServiceL(iStatus, devAddr);
This page was last modified on 26 July 2012, at 05:39.
31 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.