hi leute!
======

ich ich habe mir den asuro roboter gekauft nun bin ich vor einiger zeit draufgekommen(durch hilfe dieses forums) dass der sender meines ir transresivers nicht funkt und bis der USB transresiver vom conrad kommt wollte ich noch ein programm schreiben dass signale von meinem ir transresiver entgegennimmt und auf dem bildschirm ausgibt!(das funkt auch schon mit minicom immer waenn ich mit der fernbedienung auf eine taste druecke kommt was an bei minicom!) hier mal mein programm:
Code:
/*ledController whith FERNBEDIENUNG!
 *(C) by linuxuser
 *e-mail: unix4ever@gmx.net
 */

#include <sys/ioctl.h>
#include <sys/kd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>

#define INDEVICE "/dev/ttyS0"
#define OUTDEVICE "/dev/tty1"

#define BLOCKSIZE 8

int main(void){
    int readBytes;
    int input;
    int output;
    
    char buffer[BLOCKSIZE];

    /*open the input device*/
    input = open(INDEVICE, O_RDONLY|O_NOCTTY|O_NONBLOCK);    

    /*open the output device*/
    output = open(OUTDEVICE, O_WRONLY);

    if(input == -1 || output == -1){
        fprintf(stderr, "ERROR konnte die Devices nicht oeffnen");
        return 1;
    }/*end if*/
    
    while(1){
        printf("hallo\n");
        readBytes = read(input, buffer, BLOCKSIZE);
        perror("Fehler ");
        printf("%s,%d, - %d\n", buffer, buffer, readBytes);
    }

    return 0;
}/*end main*/
aber irgendwie funkt es nicht so richtig als ausgabe bekomme ich(diese natuerlich oefter da O_NONBLOCK und endlosschleife):
Code:
hallo
Fehler : Resource temporarily unavailable
,-1080603244, - -1
koennte mir vielleicht einer sagen was ich falsch mache/vergesse?
DANKE das waere super
mfg
linuxuser