From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bluetooth pairing

Solved!
Go to solution

Okay, attached my VI and the .NET dll.

 

This VI I want to use for discovering all bluetooth devices and selecting the one with which the pairing should be done.

Anybody suggestions how to solve it in a way that the bluetooth devices connects (and stays connected) and opens a virtual serial port?

 

 

Download All
0 Kudos
Message 11 of 24
(3,965 Views)

Hello thls.

 

Thanks for the code.

 

Based on the previous posts it seems like the main issue is the detection of the gsm.

 

I did some tests at my side with my cell phone and just made some relatively simple code that just slowly increases the detection time until you detect the cell phone.

 

I also saw that 4 to 5 seconds detection time always seems to be enough.

This is comparable to the amount of time Windows would take the first time it would try to detect your phone.

 

Can you try this and let me know if it resolves your Bluetooth detection issues?

 

The attached Code is provided As Is.  It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments.  You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 12 of 24
(3,949 Views)

Thanks for the quick response.......and hopefully the sollution, how ease can it be?

But can add the VI saved in Labview 2011?

I can't open it.

 

 

0 Kudos
Message 13 of 24
(3,942 Views)

Here's the 2011 version.

 

Please let me know if something is unclear.

 

The attached Code is provided As Is.  It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments.  You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 14 of 24
(3,938 Views)

So far, so good!

That's clear, but what about the rest of the proces?

When the discovering is done, I have to pair and init the serialport "service"

 

Do I have to put that part at the point which I marked in the attachement?

Because when I enter the BT Close reference I have to start over again.

 

Thanks!


Keep you updated!

0 Kudos
Message 15 of 24
(3,931 Views)

Hello thls,

 

You should indeed put this before the closing of your references.

I adapted the example and added documentation with the reasons also.

 

Basically what you should use as reference material are these pages and the linked pages from over there:

http://32feet.codeplex.com/documentation?referringTitle=Home

http://32feet.codeplex.com/wikipage?title=Bluetooth%20Serial%20Ports&referringTitle=Documentation

http://inthehand.com/library/32feet/

 

PS: It is totally not yet perfect code (probably also some Rube Goldbergs in there), but I just wanted to explain the concept a bit.

 

The attached Code is provided As Is.  It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments.  You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 16 of 24
(3,911 Views)
Solution
Accepted by topic author thls

And here the 2011 code.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 17 of 24
(3,910 Views)

For anyone interested in this example.

 

Please also take a look at the following simple class API example/"starting point":

https://decibel.ni.com/content/docs/DOC-31353

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 18 of 24
(3,880 Views)

Hi,

 

request window.PNG

when pairing,windows 7 will appear below windows,is there any way to disable this,or progammaticly click next button?tks

 

0 Kudos
Message 19 of 24
(3,164 Views)

Hello,

 

 

Can someone can tell me some info about the pairing?

 

evenif i set pin 0000,however device and PC still will popup dialog with random number as above pic?

 

any ideas is appreciated.

 

 

0 Kudos
Message 20 of 24
(3,121 Views)