> Have you tried using the gpio-event user app? > > When using the driver, there are 2 modes, binary and ASCII. By default > it's in ASCII mode and when you read it sends up strings. > > There is an ioctl to put it into binary mode. In binary mode you would > declare a variable of type GPIO_EventMonitor_t and do > > GPIO_EventMonitor_t event; > > read( fd, &event, sizeof( event )); > > For ASCII mode, I normally do: > > char eventStr[ 60 ]; > > fgets( eventStr, sizeof(eventStr), fs ); > > It may be that reading 1 byte at a time is causing problems. > > Dave Hylands
You were right. Reading 1 byte was indeed the problem. Now reading with sizeof() it works perferctly.