Bluetooth pairing .....Scan and pair

// Expert user has replied.
V Vedsatx Saddvv 2 years 11 months ago
7 8 0

Hi , Is there anybody have a simple application for pairing any bluetooth device bu scanning/entering only MAC address and without searching ? one of our partner has already developed one for MC65 by using our scanandpair tool in EMDK but it doesn't so good if device asks for pin code? thanks

Please register or login to post a reply

8 Replies

V Vedsatx Saddvv

Hi, Thanks for all the answers. It was not for RS507 but yes the tools that you've mentioned in EMDK should work. I would appreciated if you may comment for following code which still can't pair with pin code. Thanks in advance.   {                 ScanAndPairTool scanAndPairTool = new ScanAndPairTool();                 scanAndPairTool.NotificationInfo.NotifyType = NOTIFYTYPES.BEEPER;                 scanAndPairTool.BluetoothInfo.LocalComPort = 4;                 scanAndPairTool.ScanInfo.ScanTimeout = 30000;                 ScanAndPairResults result = txtDevicePin.Text!= string.Empty ? scanAndPairTool.ScanAndPair() : scanAndPairTool.ScanAndPair( "0000");                   #region Exception Handle                switch (result)                 {                     case ScanAndPairResults.ERROR_BT_FINDDEVICEFAIL:                         SetInfo( "Error in discovering Bluetooth Device");                         break;                     case ScanAndPairResults.ERROR_BT_FINDSERVICEFAIL:                         SetInfo( "Error in performing Bluetooth service search");                         break;                     case ScanAndPairResults.ERROR_BT_INIT:                         SetInfo( "Failure in Bluetooth initialization");                         break;                      case ScanAndPairResults.ERROR_BT_INSUFFICIENTDATA:                         SetInfo( "Not enough information available to perform the bluetooth operation");                         break;                     case ScanAndPairResults.ERROR_BT_INVALIDDATA:                         SetInfo( "Invalid Bluetooth address or name provided");                         break;                     case ScanAndPairResults.ERROR_BT_NOTPAIRED:                         SetInfo( "Error in unpairing a bluetooth device that is not yet paired");                         break;                     case ScanAndPairResults.ERROR_BT_OBJECTNOTCREATED:                         SetInfo( "Error in internal bluetooth object creation");                         break;                     case ScanAndPairResults.ERROR_BT_PAIR:                         SetInfo( "Failure in bluetooth pairing");                         break;                     case ScanAndPairResults.ERROR_BT_RADIOMODE:                         SetInfo( "Error in updating bluetooth radio mode");                         break;                     case ScanAndPairResults.ERROR_BT_REGISTRY:                         SetInfo( "Failure on accessing bluetooth related registry information");                         break

P Prashanth Kadur

You are forcing sac&pair to use the localcomport to 4.  Are you sure this com port on the Motorola device is available for use?  If you don't set the localcomport, scan&pair will automatically select a comport that is available and use it for connection. When the pairing fails, what is the error Scan&Pair is returning?  What remote device are you trying to pair with? Printer? I am responsible for the EMDK products including Scan&Pair.  Please do contact me by email or phone for a faster resolution.  We can update thius thread with the resolution later.

M Marcus Kurath

Attached is a document one of my customers created for this type of pairing. As far as I know only SPP mode can make the RS507 a master which is the condition required to pair with a barcode

M Marcus Kurath

Here is the real doc I meant to attach

K Khazi-Syed Taheer Ahmed

You can Call MS BT API BthSetPin to programmatically respond to the PIN query thus suppressing the PIN dialog PS: Above API works only for MS BT stack. Taheer

P Prashanth Kadur

ScanAndPair should work. Pass the pin to the following call:
public ScanAndPairResults ScanAndPair(
   string BluetoothAuthenticationPIN
) Refer to the documentation.  Is there a reason why you can't use this call?

E Evgene Vigoutov

are you looking for something like Bt_Information applet that we have for MPA2.0? I tiwll display device BT address as barcode. We are using it for RS507 support.

V Vedsatx Saddvv

Its been a while since I last worked on bluetooth, but if you're using the MS stack, I believe there are MS registry entries for storing PIN codes that the MS Stack will supply automatically if the device requests a PIN.  With thos values set, the ScanandPair functionality in the EMDK may  work for you.

CONTACT
Can’t find what you’re looking for?