Commit ce24174e authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

first step towards supporting wiimote plus (does not work yet but at least it is being recognized).

parent 732450e7
......@@ -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;
}
......
......@@ -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
......
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment