mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
Implemented Auto-Unpair (MS bluetooth stack). For those people, who are tired of removing the batteries after they were finished playing around with dolphin, to avoid battery drain. It's switchable via checkbox within the wiimote gui. This will simply remove valid wiimote pairings on Exit/Close.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5373 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -619,7 +619,7 @@ THREAD_RETURN SafeCloseReadWiimote_ThreadFunc(void* arg)
|
||||
}
|
||||
// WiiMote Pair-Up
|
||||
#ifdef WIN32
|
||||
int WiimotePairUp(void)
|
||||
int WiimotePairUp(bool unpair)
|
||||
{
|
||||
HANDLE hRadios[256];
|
||||
int nRadios;
|
||||
@ -683,7 +683,7 @@ int WiimotePairUp(void)
|
||||
|
||||
do
|
||||
{
|
||||
if ((!wcscmp(btdi.szName, L"Nintendo RVL-WBC-01") || !wcscmp(btdi.szName, L"Nintendo RVL-CNT-01")) && !btdi.fConnected)
|
||||
if ((!wcscmp(btdi.szName, L"Nintendo RVL-WBC-01") || !wcscmp(btdi.szName, L"Nintendo RVL-CNT-01")) && !btdi.fConnected && !unpair)
|
||||
{
|
||||
//TODO: improve the readd of the BT driver, esp. when batteries of the wiimote are removed while beeing fConnected
|
||||
if (btdi.fRemembered)
|
||||
@ -706,6 +706,13 @@ int WiimotePairUp(void)
|
||||
ERROR_LOG(WIIMOTE, "Pair-Up: BluetoothSetServiceState() returned %08x", hr);
|
||||
}
|
||||
}
|
||||
else if ((!wcscmp(btdi.szName, L"Nintendo RVL-WBC-01") || !wcscmp(btdi.szName, L"Nintendo RVL-CNT-01")) && unpair)
|
||||
{
|
||||
|
||||
BluetoothRemoveDevice(&btdi.Address);
|
||||
NOTICE_LOG(WIIMOTE, "Pair-Up: Automatically removed BT Device on shutdown: %08x", GetLastError());
|
||||
|
||||
}
|
||||
} while (BluetoothFindNextDevice(hFind, &btdi));
|
||||
BluetoothFindRadioClose(hFind);
|
||||
}
|
||||
|
Reference in New Issue
Block a user