Changeset 116 for trunk/wmdemo
- Timestamp:
- 05/16/07 19:40:30 (2 years ago)
- Files:
-
- trunk/wmdemo/wmdemo.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wmdemo/wmdemo.c
r112 r116 75 75 /* Connect to the wiimote */ 76 76 printf("Put Wiimote in discoverable mode now (press 1+2)...\n"); 77 if (!(wiimote = cwiid_ connect(&bdaddr, 0))) {77 if (!(wiimote = cwiid_open(&bdaddr, 0))) { 78 78 fprintf(stderr, "Unable to connect to wiimote\n"); 79 79 return -1; … … 111 111 case '5': 112 112 toggle_bit(rumble, 1); 113 if (cwiid_ command(wiimote, CWIID_CMD_RUMBLE, rumble)) {113 if (cwiid_set_rumble(wiimote, rumble)) { 114 114 fprintf(stderr, "Error setting rumble\n"); 115 115 } … … 158 158 break; 159 159 case 'r': 160 if (cwiid_ command(wiimote, CWIID_CMD_STATUS, 0)) {160 if (cwiid_request_status(wiimote)) { 161 161 fprintf(stderr, "Error requesting status message\n"); 162 162 } … … 182 182 } 183 183 184 if (cwiid_ disconnect(wiimote)) {184 if (cwiid_close(wiimote)) { 185 185 fprintf(stderr, "Error on wiimote disconnect\n"); 186 186 return -1; … … 192 192 void set_led_state(cwiid_wiimote_t *wiimote, unsigned char led_state) 193 193 { 194 if (cwiid_ command(wiimote, CWIID_CMD_LED, led_state)) {194 if (cwiid_set_led(wiimote, led_state)) { 195 195 fprintf(stderr, "Error setting LEDs \n"); 196 196 } … … 199 199 void set_rpt_mode(cwiid_wiimote_t *wiimote, unsigned char rpt_mode) 200 200 { 201 if (cwiid_ command(wiimote, CWIID_CMD_RPT_MODE, rpt_mode)) {201 if (cwiid_set_rpt_mode(wiimote, rpt_mode)) { 202 202 fprintf(stderr, "Error setting report mode\n"); 203 203 } … … 357 357 break; 358 358 case CWIID_MESG_ERROR: 359 if (cwiid_ disconnect(wiimote)) {359 if (cwiid_close(wiimote)) { 360 360 fprintf(stderr, "Error on wiimote disconnect\n"); 361 361 exit(-1); … … 369 369 } 370 370 } 371
