diff --git a/l2ork_addons/cwiid/libcwiid/bluetooth.c b/l2ork_addons/cwiid/libcwiid/bluetooth.c index 8019d572953b5f2c731e0355ee5ce1a00b5dc9e1..ed0314165ea9d481d7fe12f3b112c8c370b8ee63 100644 --- a/l2ork_addons/cwiid/libcwiid/bluetooth.c +++ b/l2ork_addons/cwiid/libcwiid/bluetooth.c @@ -115,9 +115,12 @@ int cwiid_get_bdinfo_array(int dev_id, unsigned int timeout, int max_bdinfo, i++) { /* Filter by class */ if (!(flags & BT_NO_WIIMOTE_FILTER) && - ((dev_list[i].dev_class[0] != WIIMOTE_CLASS_0) || + (((dev_list[i].dev_class[0] != WIIMOTE_CLASS_0) || (dev_list[i].dev_class[1] != WIIMOTE_CLASS_1) || - (dev_list[i].dev_class[2] != WIIMOTE_CLASS_2))) { + (dev_list[i].dev_class[2] != WIIMOTE_CLASS_2)) && + ((dev_list[i].dev_class[0] != WIIMOTE_PLUS_CLASS_0) || + (dev_list[i].dev_class[1] != WIIMOTE_PLUS_CLASS_1) || + (dev_list[i].dev_class[2] != WIIMOTE_CLASS_2)))) { continue; } @@ -132,6 +135,7 @@ int cwiid_get_bdinfo_array(int dev_id, unsigned int timeout, int max_bdinfo, /* Filter by name */ if (!(flags & BT_NO_WIIMOTE_FILTER) && strncmp((*bdinfo)[bdinfo_count].name, WIIMOTE_NAME, BT_NAME_LEN) && + strncmp((*bdinfo)[bdinfo_count].name, WIIMOTE_PLUS_NAME, BT_NAME_LEN) && strncmp((*bdinfo)[bdinfo_count].name, WIIBALANCE_NAME, BT_NAME_LEN)) { continue; } diff --git a/l2ork_addons/cwiid/libcwiid/cwiid_internal.h b/l2ork_addons/cwiid/libcwiid/cwiid_internal.h index 52a7fc4b9ccacaa53557fd0a7873e1fcbc57dec0..fe1e96dffc05fa3a6dc1eec127e8a18fad24c49b 100644 --- a/l2ork_addons/cwiid/libcwiid/cwiid_internal.h +++ b/l2ork_addons/cwiid/libcwiid/cwiid_internal.h @@ -79,10 +79,13 @@ /* Wiimote specific magic numbers */ #define WIIMOTE_NAME "Nintendo RVL-CNT-01" +#define WIIMOTE_PLUS_NAME "Nintendo RVL-CNT-01-TR" #define WIIBALANCE_NAME "Nintendo RVL-WBC-01" #define WIIMOTE_CLASS_0 0x04 #define WIIMOTE_CLASS_1 0x25 #define WIIMOTE_CLASS_2 0x00 +#define WIIMOTE_PLUS_CLASS_0 0x08 +#define WIIMOTE_PLUS_CLASS_1 0x05 /* Wiimote port/channel/PSMs */ #define CTL_PSM 17 diff --git a/l2ork_addons/cwiid/libcwiid/process.c b/l2ork_addons/cwiid/libcwiid/process.c index 226b3c8d3401370055c3cfc2b8d8222b9d8105ab..31c8f1fd3da9487979dff17cff0cebd2bca3edb6 100644 --- a/l2ork_addons/cwiid/libcwiid/process.c +++ b/l2ork_addons/cwiid/libcwiid/process.c @@ -369,7 +369,7 @@ int process_write(struct wiimote *wiimote, unsigned char *data) struct rw_mesg rw_mesg; if (wiimote->rw_status != RW_WRITE) { - cwiid_err(wiimote, "Received unexpected write report"); + cwiid_err(wiimote, "Received unexpected write report %d", wiimote->rw_status); return -1; }