1,105,281 Community Members

Scanning for bluetooth devices

Member Avatar
tadhg
Newbie Poster
1 post since Jun 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I am working on a project for college that involves bluetooth. I was required to use .Net. I have only programmed in C before, and therefore have started to teach myself C#. I have written all of the program already, including sending the data over a bluetooth connection. The only part I am having difficulty with is scanning for bluetooth devices in the area.

Can anyone give me any ideas on how to go about doing this or sample code.

Thanks a lot,
Tim

Member Avatar
chunguy
Newbie Poster
24 posts since Sep 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

hi hi,
sorry, i can't offer any advice on your question, but t'm interested to know how your project has gone. can you share with me what tools or informational links you used for your project.

Member Avatar
chunguy
Newbie Poster
24 posts since Sep 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

anyone else has any information on how to makeuse of bluetooth devices

Member Avatar
C#Coder
Newbie Poster
19 posts since Sep 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I haven't read through all the material, but it looks like it's specific for each blue tooth device. You'll need a BlueTooth SDK from the hardware vendor and then use PInvoke to access it's functions.

This newsgroup thread seems to be excellent.
http://dotnetjunkies.com/Newsgroups/microsoft.public.dotnet.framework.compactframework/2004/3/30/99101.aspx

Member Avatar
cosi
Junior Poster
152 posts since Aug 2004
Reputation Points: 4 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

This is absolutely not true! I haven't done bluetooth in C# before, but I've done it in C/C++ and am familiar with the bluetooth protocol. You need to just do a device inquiry over sdp (Service Discovery Protocol). This is not vendor specific---A Huge Nightmare if it was vendor specific!!! Look in your API for SDP I'm sure you'll find something. If you decided instead to run Linux and bluez then I could help you :).


Ed

it looks like it's specific for each blue tooth device. You'll need a BlueTooth SDK from the hardware vendor and then use PInvoke to access it's functions.

Member Avatar
iman
Newbie Poster
1 post since Mar 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Can you please share some of your code to how we able to read from the bluetooth device, and respond.

- Thanks.

Member Avatar
I am blue
Newbie Poster
1 post since Mar 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi, maybe late, but here is a good place where you can find example code about how to perform SDP, with microsoft's bluetooth APIs:

http://www.lenholgate.com

About data transfer between devices, I'm still working on it. I'm new to visual C++ and MFC, so I'm finding a little bit difficult to achieve the goal of creating a piconet. I think now I am close to it, and if any one knows anything about the topic of bluetooth piconets, don´t hesitate contacting me.

Member Avatar
caton
Newbie Poster
3 posts since Dec 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi Tim, I am not sure but maybe u could use OBEX to

Member Avatar
caton
Newbie Poster
3 posts since Dec 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi Tim,
I am not sure but maybe u could use OBEX to discover the Bluetooth devices around the area and connect to it?
By the way, I am interested in your application, care to talk/post your code?
I am doing a C# application to communciate between desktop and PDA.
I have problems converting the VB .NET application found at http://www.devx.com/wireless/Article/11511/0 to C# application.
Please assist
Thanks.
Clement

Member Avatar
Udara
Newbie Poster
2 posts since Mar 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I am working on a project for college that involves bluetooth. I was required to use .Net. I have only programmed in C before, and therefore have started to teach myself C#. I have written all of the program already, including sending the data over a bluetooth connection. The only part I am having difficulty with is scanning for bluetooth devices in the area.

Can anyone give me any ideas on how to go about doing this or sample code.

Thanks a lot,
Tim

I am also involved in a project where I use a bluetooth usb dongle connected to the PC(which communicates with other bluetooth devices). So can I know " what would be the most suitable programming language in developing my own application programs for that USB bluetooth dongle?". Please help me with this.

Member Avatar
caton
Newbie Poster
3 posts since Dec 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi Udara,

Hmm well first you have to understand what are u trying to achieve here.
Do you have to write a bluetooth service discovery protocol? (discovering all other bluetooth devices in the area)? I am not a expert in this area. I was just involved in some preliminary Proof of Concept hence I coded in C# which was easily to communciate with PocketPc. 1 other thing you have to understand is which USB dongle you are using, there are 2 main types of Bluetooth stack : WIDCOMM and Microsoft. Maybe you could try to search and see what other help you could get from the net. I will be pleased to assist you in any way possible if I have time to check my email. :)

Regards

Member Avatar
celikada
Newbie Poster
7 posts since Apr 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi Udara,

Hmm well first you have to understand what are u trying to achieve here.
Do you have to write a bluetooth service discovery protocol? (discovering all other bluetooth devices in the area)? I am not a expert in this area. I was just involved in some preliminary Proof of Concept hence I coded in C# which was easily to communciate with PocketPc. 1 other thing you have to understand is which USB dongle you are using, there are 2 main types of Bluetooth stack : WIDCOMM and Microsoft. Maybe you could try to search and see what other help you could get from the net. I will be pleased to assist you in any way possible if I have time to check my email. :)

Regards

i want to discover devices wiht using c#, which is in my area. then store their mac addresses in a string array or whatever, can you help me about this topik.

i working on a scurity system and i searched some Win APIs and commands for that but i cant find enoug article about that topik

if you can help me please send me a email (celikada@hotmail.com)

thanks a lot :)

Member Avatar
celikada
Newbie Poster
7 posts since Apr 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i searched a way a lot of time to reach bluetooth devices which are in my range but i cant find an easy way. but some people wrote some dll files then they used these in a namespace for .net. but it is expensive to use just device discovery. this namespace name is franson if you pay 99$, you can easily access a remote device but i have to say that i did not try , sorry :(

Member Avatar
celikada
Newbie Poster
7 posts since Apr 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i searched a way a lot of time to reach bluetooth devices which are in my range but i cant find an easy way. but some people wrote some dll files then they used these in a namespace for .net. but it is expensive to use just device discovery. this namespace name is franson if you pay 99$, you can easily access a remote device but i have to say that i did not try , sorry :(

there is an easy way[/a]

32feet.net

free sdk for c# but but its works whit windows bluetooth stack

add your project referances InTheHand.Net.Bluetooth.dll

define libraries InTheHand.Net , InTheHand.Net.Socet

and add the code

BluetoothClient blue_client = new BluetoothClient();


BluetoothDeviceInfo[] devices = blue_client.DiscoverDevices();

bluetooth devices in the devices array

thats it:)

Member Avatar
Udara
Newbie Poster
2 posts since Mar 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks for your advice. But the thing is I was trying on the microsoft bluetooth stack, with Java (using BlueCove ), but didn't get resu;ts as there were errprs and also it requires Winows XP SP2 compatible bluetooth dongles. I don't know much about WIDCOMM stack. And also I'm free to try C++ or even C# with Microsoft Bluetooth Stack or WIDCOMM stack. So what would be the best way to go, bcos I don't have much time left for the project. And what is your opinion on my way (using Java & Bluecove on Microsoft stack)... ?
Can you pls help me on this......:confused: :confused: :confused:


Hi Udara,

Hmm well first you have to understand what are u trying to achieve here.
Do you have to write a bluetooth service discovery protocol? (discovering all other bluetooth devices in the area)? I am not a expert in this area. I was just involved in some preliminary Proof of Concept hence I coded in C# which was easily to communciate with PocketPc. 1 other thing you have to understand is which USB dongle you are using, there are 2 main types of Bluetooth stack : WIDCOMM and Microsoft. Maybe you could try to search and see what other help you could get from the net. I will be pleased to assist you in any way possible if I have time to check my email. :)

Regards

Member Avatar
asm4pic
Newbie Poster
4 posts since Jul 2006
Reputation Points: 9 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

hello
where to get WIDCOMM bluetooth SDK ?
does it implemented as c# class's or as VC++ API's ?

Member Avatar
celikada
Newbie Poster
7 posts since Apr 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

if you want to pay you can find
i cant find a free one

Member Avatar
asm4pic
Newbie Poster
4 posts since Jul 2006
Reputation Points: 9 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i have got something like http://www.broadcom.com/products/bluetooth_sdk_download.php?id=Q8Pelk1sulTFgDSrXlvdKNxe7&filename=BTW-5_0_1_901-SDK.zip
WIDCOMM Bluetooth DK
it is c++ classes only
does microsoft stack support c# ?
is it for free ?

Member Avatar
Lord Soth
Posting Whiz in Training
233 posts since Mar 2006
Reputation Points: 4 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi,

As celikada already mentioned there are different bluetooth stacks available and Microsoft hadn't provided one till XP SP2 (if I'm not mistaken) still most USB BT dongles install their own stacks either WIDCOMM or another proprietary one. I suggest too the 32feet.net 's BT classes and if it fails (in a try catch block) then this means that no MS BT stack then you check for the presence of Widcomm DLLs and use P/Invoke. Check Widcomm's site for C SDK.

Loren Soth

Member Avatar
asm4pic
Newbie Poster
4 posts since Jul 2006
Reputation Points: 9 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i found microsoft support for bluetooth on win xp sp2 in platform sdk
http://www.microsoft.com/downloads/details.aspx?FamilyID=e15438ac-60be-41bd-aa14-7f1e0f19ca0d&DisplayLang=en
it is a C APIs with headers and libraries
but no support on .NET anyway from microsoft

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article