From: hackbard Date: Tue, 11 Feb 2003 06:05:02 +0000 (+0000) Subject: read support tests X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=47eeeaf31e9ffc066a7282fc85e216e544a3612e;p=sound-tools%2Fossmidi.git read support tests --- diff --git a/midiio.c b/midiio.c index 06f547c..dc4cd78 100644 --- a/midiio.c +++ b/midiio.c @@ -64,12 +64,19 @@ int note_off(int fd,int chan,int note,int vel) { return 0; } +int midi_read_msg(int fd,char *buf) { + int bytes_read; + bytes_read=read(fd,buf,10); + return bytes_read; +} + #ifdef TEST_API /* test the io api ... */ int main(int argc,char **argv) { - int note,channel,i; + int note,channel,i,j; + char my_buf[10]="MIDIMIDI"; if(argc>1) { note=atoi(argv[2]); @@ -78,11 +85,18 @@ int main(int argc,char **argv) { midi_fd=open("/dev/sound/midi",O_RDWR); + printf("reading ...\n"); + i=midi_read_msg(midi_fd,my_buf); + for(j=0;j