static int ps2GetId( int fd, bool verbose ) { unsigned char c; if ( ps2WriteChar(fd, PS2_SEND_ID, verbose) < 0 ) return PS2_Iprintf; read( fd, &c, 1 ); return( c ); }
static int ps2GetId( int fd, bool verbose ) { unsigned char c; int res; if ( ps2WriteChar(fd, PS2_SEND_ID, verbose) < 0 ) return PS2_ID_ERROR; res = read( fd, &c, 1 ); (void)res; return( c ); }
static int ps2Write( int fd, const unsigned char *priv, size_t len, bool verbose) { size_t i; int error = 0; for ( i = 0; i < len; i++ ) { if ( ps2WriteChar(fd, priv[i], verbose) < 0 ) { if ( verbose ) error++; } } if ( error && verbose ) printf( "DirectFB/PS2Mouse: missed %i ack's!\n", error); return( error ); }
static int ps2Write( int fd, const unsigned char *data, size_t len, bool verbose) { size_t i; int error = 0; for ( i = 0; i < len; i++ ) { if ( ps2WriteChar(fd, data[i], verbose) < 0 ) { if ( verbose ) D_ERROR( "DirectFB/PS2Mouse: error @byte %zu\n", i ); error++; } } if ( error && verbose ) D_ERROR( "DirectFB/PS2Mouse: missed %i ack's!\n", error); return( error ); }