flush serial port during init of led class

This commit is contained in:
Andreas Frisch 2016-06-02 17:00:13 +02:00
parent a751a991d2
commit eb7fa7347a
2 changed files with 3 additions and 1 deletions

View file

@ -79,6 +79,7 @@ static void photo_booth_led_init (PhotoBoothLed *led)
tty.c_lflag |= ICANON;
tty.c_oflag &= ~OPOST;
tcsetattr(led->fd, TCSANOW, &tty);
tcsetattr(led->fd, TCSAFLUSH, &tty);
char tempbuf[32];
int n = read (led->fd, tempbuf, sizeof(tempbuf)-1);
GST_WARNING_OBJECT(led, "read %i bytes: '%s'", n, tempbuf);

View file

@ -16,6 +16,7 @@
#ifndef __PHOTO_BOOTH_LED_H__
#define __PHOTO_BOOTH_LED_H__
#include <glib-object.h>
#include <glib.h>
#define LED_BLACK 'b'
@ -42,7 +43,7 @@ struct _PhotoBoothLed
struct _PhotoBoothLedClass
{
GtkApplicationClass parent_class;
GObjectClass parent_class;
};
GType photo_booth_led_get_type (void);