C
code
Hi folks,
I would like to read and write to a ISO-Reader card (RFID) connected to
/dev/ttyS0 (COM1). Writing works fine, all commands I write to the
device will be executed.
To every command there is a response. For example:
#001 LED 1 1 CR (command led1=1)
the response should be:
but there's only gibberish in the read buffer.
there's some source code:
printf("Trying to open COM1 ... ");
fp = open(DEVICE, O_RDWR | O_NOCTTY);
if(fp == -1) {
perror("failed.\n");
return IOCTL_FAIL;
} else {
printf("success.\n");
return fp;
}
send_data(fp,"#001LED10");
read(fp,rxbuf,1024);
printf("%s",rxbuf);
any suggestions?
Btw. There's something about FIFO Buffering in the documentation ...
Anybody know what this is and how I turn it off?
thanks a lot
I would like to read and write to a ISO-Reader card (RFID) connected to
/dev/ttyS0 (COM1). Writing works fine, all commands I write to the
device will be executed.
To every command there is a response. For example:
#001 LED 1 1 CR (command led1=1)
the response should be:
001 01h 00h CR
but there's only gibberish in the read buffer.
there's some source code:
printf("Trying to open COM1 ... ");
fp = open(DEVICE, O_RDWR | O_NOCTTY);
if(fp == -1) {
perror("failed.\n");
return IOCTL_FAIL;
} else {
printf("success.\n");
return fp;
}
send_data(fp,"#001LED10");
read(fp,rxbuf,1024);
printf("%s",rxbuf);
any suggestions?
Btw. There's something about FIFO Buffering in the documentation ...
Anybody know what this is and how I turn it off?
thanks a lot