[VB.NET] Bluetooth Setup
Moderator: MaxCoderz Staff
- thegamefreak0134
- Extreme Poster
- Posts: 455
- Joined: Mon 23 Jan, 2006 10:09 pm
- Location: In front of a Computer, coding
- Contact:
[VB.NET] Bluetooth Setup
I'll be blunt about this. I want to be able to access and controll/update the wiimote with the bluetooth device on my computer.
I use VB.NET for all of my PC developing. I did some basic searches and I'm not quite sure where to start. If I can get my program to send and recieve reports from the Wiimote, I can run from there. So here is what I need to know:
I can already pair with a bluetooth device, I have a program that does that for me. I need to know how (using VB.NET) to access the list of available bluetooth devices on the computer. I then need to know how to send and recieve packets to and from the device. Once I have it doing this (and have a nice event set up for handling recieved packets) I should be able to work out the logic of handling the remote relatively easily, thanks to the wealth of information on the subject.
Can someone help me out with this "should-be-so-simple" operation? Thanks!
-thegamefreak0134
I use VB.NET for all of my PC developing. I did some basic searches and I'm not quite sure where to start. If I can get my program to send and recieve reports from the Wiimote, I can run from there. So here is what I need to know:
I can already pair with a bluetooth device, I have a program that does that for me. I need to know how (using VB.NET) to access the list of available bluetooth devices on the computer. I then need to know how to send and recieve packets to and from the device. Once I have it doing this (and have a nice event set up for handling recieved packets) I should be able to work out the logic of handling the remote relatively easily, thanks to the wealth of information on the subject.
Can someone help me out with this "should-be-so-simple" operation? Thanks!
-thegamefreak0134
- benryves
- Maxcoderz Staff
- Posts: 3089
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
It's probably easier to download the Windows joystick driver and treat the controller as a standard joystick.
I can't recommend any Bluetooth libraries for .NET. This one looks good, but $99 is probably a bit much.
I can't recommend any Bluetooth libraries for .NET. This one looks good, but $99 is probably a bit much.
What do you mean by that? Windows manages Bluetooth devices itself - do you mean that?I can already pair with a bluetooth device, I have a program that does that for me.
- thegamefreak0134
- Extreme Poster
- Posts: 455
- Joined: Mon 23 Jan, 2006 10:09 pm
- Location: In front of a Computer, coding
- Contact:
No, I mean I use a program (the one that came with my bluetooth adapter) instead. The windows drivers aren't fully compatable with the wiimote for some odd reason...
Anywho, I need a library? Darnation. OK, I will look into that. I will also need to figure out (once and for all, since I have never known) how to actually install and use libraries.
I will get back to you on which driver I am using. The tutorials I have (for the wiimote implementation) mention a lot about sending "reports" to and from the device. I can only assume this means sending packets that are specially formatted, but if a "report" is a bluetooth specific thing I would need to know that.
I can get some limited functionality with GlovePIE to use it as a joystick. However, I need full low level access to do other things, such as read the memory on the wiimote (to get at mii data) and to play sound through the speaker.
-thegamefreak
Anywho, I need a library? Darnation. OK, I will look into that. I will also need to figure out (once and for all, since I have never known) how to actually install and use libraries.
I will get back to you on which driver I am using. The tutorials I have (for the wiimote implementation) mention a lot about sending "reports" to and from the device. I can only assume this means sending packets that are specially formatted, but if a "report" is a bluetooth specific thing I would need to know that.
I can get some limited functionality with GlovePIE to use it as a joystick. However, I need full low level access to do other things, such as read the memory on the wiimote (to get at mii data) and to play sound through the speaker.
-thegamefreak
- benryves
- Maxcoderz Staff
- Posts: 3089
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
Probably because it's not intended to be used with anything besides the PC. I wouldn't expect any help on this project, for that reason alone... Sorry.thegamefreak0134 wrote:No, I mean I use a program (the one that came with my bluetooth adapter) instead. The windows drivers aren't fully compatable with the wiimote for some odd reason...
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
maybe this (http://szymonbanka.com/~kari/) could help you
- thegamefreak0134
- Extreme Poster
- Posts: 455
- Joined: Mon 23 Jan, 2006 10:09 pm
- Location: In front of a Computer, coding
- Contact:
OK, ok, so he used a "HID" library. I've seen references to this kind of thing before, and it appears to simply be a .dll file that I could problably use.
Does anyone have more information on HID? These kinds of programs written to convert the wiimote to axis and things are nice, but I need to be able to access it directly, as I've stated. The best I will be able to do with a wrapper is map the wiimote to the axis of an emulated joystick and read them from VB.NET. Not alltogether a bad idea I suppose, but it (unless this program is different, and I will look more into it when I get home with my wiimote again) doesn't let me do things like read out the memory and play with sound and such.
-thegamefreak
PS: HID apparently is able to access devices from within VB.NET, which is a plus. (I sorta figured it was a C thing, which I can do as well, sort of.)
Does anyone have more information on HID? These kinds of programs written to convert the wiimote to axis and things are nice, but I need to be able to access it directly, as I've stated. The best I will be able to do with a wrapper is map the wiimote to the axis of an emulated joystick and read them from VB.NET. Not alltogether a bad idea I suppose, but it (unless this program is different, and I will look more into it when I get home with my wiimote again) doesn't let me do things like read out the memory and play with sound and such.
-thegamefreak
PS: HID apparently is able to access devices from within VB.NET, which is a plus. (I sorta figured it was a C thing, which I can do as well, sort of.)
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
- benryves
- Maxcoderz Staff
- Posts: 3089
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
You could either write a C++/CLI class library that handled the interop for you, or the requisite DllImport signatures in VB. It's usually pretty straight-forwards - article on P/Invoke.
- thegamefreak0134
- Extreme Poster
- Posts: 455
- Joined: Mon 23 Jan, 2006 10:09 pm
- Location: In front of a Computer, coding
- Contact:
Wow ben, I didn't know you spoke greek...
Well, I apparently am going to have to find some time to dive headfirst into code to understand any of this at all... I'm relatively certain that what I need is a Bluetooth HID (not the USB one, but I think I do have that .dll file) and a way to access it. I believe it has .NET compatibility, so I ask this simple question:
How on earth does one access the functions in a dll file? Better yet, how does one figute out what all is in a dll file in the first place?
I know, I know, I look really stupid right now. Thing is, you don't generally have to use dlls and libraries and things for programming contests (which is what I usually study for) so I am limited in a lot of knowledge.
Thanks again. BTW, (just saw this) congrats on all your MCF awards ben.
-thegamefreak
Well, I apparently am going to have to find some time to dive headfirst into code to understand any of this at all... I'm relatively certain that what I need is a Bluetooth HID (not the USB one, but I think I do have that .dll file) and a way to access it. I believe it has .NET compatibility, so I ask this simple question:
How on earth does one access the functions in a dll file? Better yet, how does one figute out what all is in a dll file in the first place?
I know, I know, I look really stupid right now. Thing is, you don't generally have to use dlls and libraries and things for programming contests (which is what I usually study for) so I am limited in a lot of knowledge.
Thanks again. BTW, (just saw this) congrats on all your MCF awards ben.
-thegamefreak
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am