Show
Ignore:
Timestamp:
08/15/07 04:06:03 (5 years ago)
Author:
dsmith <dsmith@…>
git-author:
L. Donnie Smith <donnie.smith@gatech.edu> / 2007-08-15T04:06:03Z+0000
Parents:
7e5f213decff36c62421b1b3d02d02b3037c79a2
Children:
1f9dd8c8de2bc38d5c4869baf313a732feb248ad
git-committer:
dsmith <dsmith@918edb2d-ff29-0410-9de2-eb38e7f22bc7> / 2007-08-15T04:06:03Z+0000
Message:

stifled cwiid_connect errors on wminput reconnect

git-svn-id: http://abstrakraft.org/cwiid/svn/trunk@143 918edb2d-ff29-0410-9de2-eb38e7f22bc7

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wminput/main.c

    r7e5f213 r3c99e2c  
    6565#endif 
    6666 
     67#include <errno.h> 
    6768#include <stdint.h> 
    6869#include <stdio.h> 
     
    114115        printf("\t-d, --daemon\t\tImplies -q, -r, and -w.\n"); 
    115116        printf("\t-q, --quiet\t\tReduce output to errors\n"); 
    116         printf("\t-r, --reconnect [wait]\t\tAutomatically try reconnect after wiimote disconnect.\n"); 
     117        printf("\t-r, --reconnect [wait]\tAutomatically try reconnect after wiimote disconnect.\n"); 
    117118        printf("\t-w, --wait\t\tWait indefinitely for wiimote to connect.\n"); 
     119} 
     120 
     121void cwiid_err_connect(struct wiimote *wiimote, const char *str, va_list ap) 
     122{ 
     123        /* TODO: temporary kludge to stifle error messages from cwiid_open */ 
     124        if (errno != EHOSTDOWN) { 
     125                vfprintf(stderr, str, ap); 
     126                fprintf(stderr, "\n"); 
     127        } 
    118128} 
    119129 
     
    279289                        } 
    280290                        /* TODO: avoid continuously calling cwiid_open */ 
    281                         /* TODO: kill error messages on failed cwiid_open calls */ 
     291                        cwiid_set_err(cwiid_err_connect); 
    282292                        while (!(wiimote = cwiid_open(&current_bdaddr, CWIID_FLAG_MESG_IFC))); 
     293                        cwiid_set_err(cwiid_err_default); 
    283294                } 
    284295                else {