From c58f93dd8397a36552fde99781c22e8aeeeb2121 Mon Sep 17 00:00:00 2001 From: Kristian Lauszus Date: Sun, 24 Nov 2013 15:23:41 +0100 Subject: [PATCH] Check if Bluetooth address is set before returning true to a PS3 controller --- BTD.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BTD.h b/BTD.h index a2e3d62d..4bfed08a 100755 --- a/BTD.h +++ b/BTD.h @@ -219,7 +219,13 @@ public: * @return Returns true if the device's VID and PID matches this driver. */ virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) { - return ((vid == PS3_VID || vid == IOGEAR_GBU521_VID) && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID || pid == IOGEAR_GBU521_PID)); + if (vid == IOGEAR_GBU521_VID && pid == IOGEAR_GBU521_PID) + return true; + if (my_bdaddr[0] != 0x00 || my_bdaddr[1] != 0x00 || my_bdaddr[2] != 0x00 || my_bdaddr[3] != 0x00 || my_bdaddr[4] != 0x00 || my_bdaddr[5] != 0x00) { // Check if Bluetooth address is set + if (vid == PS3_VID && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID)) + return true; + } + return false; }; /**@}*/