| View previous topic :: View next topic |
| Author |
Message |
TDM
Joined: 28 May 2007 Posts: 23
Digg It |
Posted: Thu Sep 20, 2007 12:36 pm Post subject: Wii Remote AutoConnect for MS Stack |
|
|
Hey ppl,
Well, the bluetooth stick i had died so with the one i got I'm stuck with the ms stack for now so heres a quick attempt at getting the wii remotes to auto connect to the pc, try it and see!
It needs Windows XP sp2 (thats all ive tested it on) and the Microsoft bluetooth stack + .net 2.0.
http://localhostr.com/files/1adbcd/AutoConnect.zip
The source code is included as well so you can mess around with it and automate it better. you might need the bluetooth lib at http://inthehand.com/files/ (v2.0.60828) if it doesnt work with the libs in the folder. It you want to do it autoconnect without .net it can be done in c/c++ using the windows bluetooth api.
p.s. anyone know any good places to upload files?
Last edited by TDM on Sun Jan 27, 2008 10:16 am; edited 1 time in total |
|
| Back to top |
|
 |
TiagoTiago
Joined: 20 Jan 2007 Posts: 710 Location: Brasil
Digg It |
Posted: Wed Sep 26, 2007 8:25 pm Post subject: |
|
|
any such trick for widdcomm stack? _________________ please put the scripts on the wiki so they dont get lost as new stuff is posted!
phpBB doesnt like me,somtimes it will forget to warn me about new replies to threads I asked it to,if you see a thread I should have responded, could please email me? |
|
| Back to top |
|
 |
TDM
Joined: 28 May 2007 Posts: 23
Digg It |
Posted: Thu Sep 27, 2007 7:32 am Post subject: |
|
|
I'm not sure, i couldnt find a way to get it a wii remote to show up in device manager using the widdcomm api.
But it does give you the ability to search and connect to a wii remote/s using l2cap connections, but it doesnt show up in device manager so is only available to the programs that used the api (if you know what i mean).
So if you wanted to autoconnect any remote to glovepie you would need to add support for widdcomm stack in glovepie. |
|
| Back to top |
|
 |
speaker219
Joined: 28 Jan 2007 Posts: 187 Location: New York
Digg It |
Posted: Sat Oct 06, 2007 11:34 pm Post subject: |
|
|
Hey, here's a good place to upload files (they give you a direct link, so no waiting!)
http://localhostr.com/
For the record, i have no affiliation with this site, just think its good. :p |
|
| Back to top |
|
 |
The-Kevster
Joined: 26 Jan 2008 Posts: 1
Digg It |
Posted: Sat Jan 26, 2008 8:44 pm Post subject: |
|
|
Hi TDM
I'm trying to do the same thing. I can connect the device initially by calling
WiiMoteDevice.SetServiceState(ServiceName, True)
And Windows installs the device. I then disconnect the device with
WiiMoteDevice.SetServiceState(ServiceName, False)
From here I can't get it to connect again without removing the device.
Hopefully you can help. I'd like to download the source code you uploaded but it's not available.
Thanks! |
|
| Back to top |
|
 |
TDM
Joined: 28 May 2007 Posts: 23
Digg It |
Posted: Sun Jan 27, 2008 10:25 am Post subject: |
|
|
Hey ive uploaded it again:
http://localhostr.com/files/1adbcd/AutoConnect.zip
Yeh gettting it to connect again was a real pain, so the only way that worked was to remove the device (in software)
This is the bit you need to do
BluetoothSecurity.RemoveDevice(DeviceAddress)
After that WiiMoteDevice.SetServiceState(ServiceName, True) should work
| Code: |
Private Sub SearchAndConnect()
Dim client As BluetoothClient = New BluetoothClient
Dim devices() As BluetoothDeviceInfo
UpdateStatus("Discovering Devices ...")
devices = client.DiscoverDevices()
UpdateStatus("Discovery Complete")
ListDevicesFound(devices)
lstConnected.Items.Clear()
UpdateStatus("Connecting")
For i As Integer = 0 To devices.Length - 1
If (devices(i).DeviceName.CompareTo("Nintendo RVL-CNT-01") = 0) Then 'If Found one
If (devices(i).Connected) Then
AddConnectedDevice(devices(i))
Else
UpdateStatus("Connecting to Wii Remote:" & devices(i).DeviceAddress.ToString)
If (devices(i).InstalledServices.Length = 0) Then 'If not installed its quick
devices(i).SetServiceState(BluetoothService.HumanInterfaceDevice, True) 'Should be connected now
AddConnectedDevice(devices(i))
Else 'If already installed, need to uninstall it then intall it again to get it to connect
UpdateStatus("Uninstalling Wii Remote:" & devices(i).DeviceAddress.ToString)
BluetoothSecurity.RemoveDevice(devices(i).DeviceAddress)
UpdateStatus("Connecting to Wii Remote:" & devices(i).DeviceAddress.ToString)
devices(i).SetServiceState(BluetoothService.HumanInterfaceDevice, True) 'Should Connect properly now
AddConnectedDevice(devices(i))
End If
End If
End If
' Non wii Devices here
Next
UpdateStatus("Connection(s) Complete")
End Sub
|
|
|
| Back to top |
|
 |
ravins
Joined: 03 May 2008 Posts: 2
Digg It |
Posted: Sat May 03, 2008 8:17 pm Post subject: Use this on widcomm device!! |
|
|
i got a Broadcom 2045 usb bluetooth dongle, since widcomm cant autoconnect, i tricked windows stack so im now using the windows stack on my Broadcom 2045 device. And it works perfect with your application, thanks alot!!
To do this I modified the file c:\windows\inf\bth.inf
To this :
[Broadcom.NT.5.1]
Blutonium BCM2045 Bluetooth 2.4 GHz Single Chip Transceiver= BthUsb, USB\VID_0A5C&PID_200A
Broadcom 2045 Bluetooth 2.0 USB Device= BthUsb, USB\VID_0A5C&PID_2101
You get the hardware VID and PID from devicemanager if you righclick your device using the broadcom drivers. After this is done, disable the device.
Now you MUST delete/move the broadcom drivers away from windows plugnplay inspection. I did a search in c:\windows and moved all files named btw*.* to c:\temp. Press ctrl alt del and get the task manager up, close all bluetooth software running, that is bt_server, bttray etc..and move c:\program\widcomm directory to c:\temp.
Right click the device in device manager and make a driverupdate.
choose from list and select microsoft version instead of broadcom.
NOTE! you cannot do this from a new install, only driverupdate from broadcom to microsoft! It seems like the broadcom drivers enables the device first.
Thanks alot for this autoconnect tool, I really HATE to manually connect every time. |
|
| Back to top |
|
 |
|