Changeset d087284c9fe3be67c74edd495b443683ce4ce6af for wminput/main.c
- Timestamp:
- 07/29/07 18:08:00 (5 years ago)
- git-author:
- L. Donnie Smith <donnie.smith@gatech.edu> / 2007-07-29T18:08:00Z+0000
- Parents:
- 8dfafdd3df12e09ce36b9d0018fbf3718b14c9a5
- Children:
- f74d95ef1b141f63caaf55d5f29bd5df1ff9cdb0
- git-committer:
- dsmith <dsmith@918edb2d-ff29-0410-9de2-eb38e7f22bc7> / 2007-07-29T18:08:00Z+0000
- Files:
-
- 1 modified
-
wminput/main.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wminput/main.c
r8dfafdd rd087284 16 16 * 17 17 * ChangeLog: 18 * 2007-07-29 L. Donnie Smith <cwiid@abstrakraft.org> 19 * * fixed wait forever logic 20 * 18 21 * 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> 19 22 * * added config.h include … … 232 235 printf("Put Wiimote in discoverable mode now (press 1+2)...\n"); 233 236 if (wait_forever) { 234 if (cwiid_find_wiimote(&bdaddr, -1)) { 235 wminput_err("error finding wiimote"); 237 if (!bacmp(&bdaddr, BDADDR_ANY)) { 238 if (cwiid_find_wiimote(&bdaddr, -1)) { 239 wminput_err("error finding wiimote"); 240 conf_unload(&conf); 241 return -1; 242 } 243 } 244 /* TODO: avoid continuously calling cwiid_open */ 245 /* TODO: kill error messages on failed cwiid_open calls */ 246 while (!(wiimote = cwiid_open(&bdaddr, CWIID_FLAG_MESG_IFC))); 247 } 248 else { 249 if ((wiimote = cwiid_open(&bdaddr, CWIID_FLAG_MESG_IFC)) == NULL) { 250 wminput_err("unable to connect"); 236 251 conf_unload(&conf); 237 252 return -1; 238 253 } 239 }240 if ((wiimote = cwiid_open(&bdaddr, CWIID_FLAG_MESG_IFC)) == NULL) {241 wminput_err("unable to connect");242 conf_unload(&conf);243 return -1;244 254 } 245 255 if (cwiid_set_mesg_callback(wiimote, &cwiid_callback)) { … … 310 320 sigaddset(&sigset, SIGTERM); 311 321 sigaddset(&sigset, SIGINT); 322 sigaddset(&sigset, SIGUSR1); 312 323 sigprocmask(SIG_BLOCK, &sigset, NULL); 313 324 sigwait(&sigset, &signum); … … 388 399 break; 389 400 case CWIID_MESG_ERROR: 390 if (kill(getpid(),SIG INT)) {391 wminput_err("Error sending SIG INT");401 if (kill(getpid(),SIGUSR1)) { 402 wminput_err("Error sending SIGUSR1"); 392 403 } 393 404 break;
