HILFE !! Serielle Schnittstelle; Problem mit Linefeed

Software besorgen und anwenden
Post Reply
Message
Author
macke_a

HILFE !! Serielle Schnittstelle; Problem mit Linefeed

#1 Post by macke_a »

Hallo !
Folgendes Problem:
Ich möchte gerne Daten über ein Terminal Programm an meine Linux-Betriebssystem senden. Allerdings will ich nur reine Netto Daten ohne Line Feed (LF) auswerten!
Ich habe bis jetzt noch keine Möglichkeiten gefunden, diese Problem zu umgehen!
Hat jemand von Euch ne Lösung ?
Anbei meine Quellcode:

bool SerialConfigurePort( int aFile, speed_t aSpeed ) {

struct termios ti;
unsigned long arg = 0;

tcflush( aFile, TCIOFLUSH );

if( tcgetattr( aFile, &ti ) >= 0 ){
cfmakeraw(&ti);

ti.c_cflag |= CLOCAL;
ti.c_cflag &= ~CRTSCTS;
ti.c_cflag &= ~PARENB;
ti.c_cflag &= ~PARODD;
ti.c_cflag &= ~CSIZE;
ti.c_cflag |= CS8;
ti.c_cflag &= ~CSTOPB;

ti.c_iflag |= (IGNPAR | ICRNL );

ti.c_cc[ VMIN ] = 1;
ti.c_cc[ VTIME ] = 0;

cfsetspeed( &ti, aSpeed );

if( tcsetattr( aFile, TCSANOW, &ti ) >= 0 ) {
arg = fcntl( aFile, F_GETFL, 0 );
arg |= O_NONBLOCK;

if( fcntl( aFile, F_SETFL, arg ) >= 0 ) {
return true; } }
}
return false; }


Mfg macke_a

Post Reply