Disable encryption when checking Wiimote extension for scan.

This is for when we are checking if it is a Balance Board.
This commit is contained in:
Matthew Parlane 2013-07-03 23:05:19 +12:00
parent 998c4042c2
commit 691900aa90
1 changed files with 16 additions and 3 deletions

View File

@ -336,11 +336,26 @@ void WiimoteScanner::CheckDeviceType(std::basic_string<TCHAR> &devicepath, bool
u8 buf[MAX_PAYLOAD] = {0};
u8 const req_status_report[] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_REQUEST_STATUS, 0};
// The new way to initialize the extension is by writing 0x55 to 0x(4)A400F0, then writing 0x00 to 0x(4)A400FB
// 52 16 04 A4 00 F0 01 55
// 52 16 04 A4 00 FB 01 00
u8 const disable_enc_pt1_report[MAX_PAYLOAD] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_WRITE_DATA, 0x04, 0xa4, 0x00, 0xf0, 0x01, 0x55};
u8 const disable_enc_pt2_report[MAX_PAYLOAD] = {WM_SET_REPORT | WM_BT_OUTPUT, WM_WRITE_DATA, 0x04, 0xa4, 0x00, 0xfb, 0x01, 0x00};
rc = CheckDeviceType_Write(dev_handle,
disable_enc_pt1_report,
sizeof(disable_enc_pt1_report),
1);
rc = CheckDeviceType_Write(dev_handle,
disable_enc_pt2_report,
sizeof(disable_enc_pt2_report),
1);
rc = CheckDeviceType_Write(dev_handle,
req_status_report,
sizeof(req_status_report),
1);
while (rc > 0 && --max_cycles > 0)
{
if ((rc = CheckDeviceType_Read(dev_handle, buf, 1)) <= 0)
@ -397,9 +412,7 @@ void WiimoteScanner::CheckDeviceType(std::basic_string<TCHAR> &devicepath, bool
// DEBUG_LOG(WIIMOTE,
// "CheckDeviceType: GOT EXT TYPE %llX",
// ext_type);
is_bb = (ext_type == 0x020420A40000ULL) ||
((ext_type & 0xf00000000000ULL) &&
ext_type != 0xffffffffffffULL);
is_bb = (ext_type == 0x020420A40000ULL);
}
else
{