summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/serial/serial.h
blob: 439ce3f1ad8b4fcc16eb687beec53276e8dfddc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef serial_h
#define serial_h
// serial.h
// buzz - Programme du robot Efrei Robotique I1-I2 2003
// Copyright (C) 2003 Nicolas Schodet

#include <unistd.h>
#include <termios.h>

class Serial
{
    struct termios m_old;
    int m_fd;
  public:
    // Constructeur.
    Serial (const char *name);
    // Destructeur.
    ~Serial (void);
    // Lit un caract�re, ou -1.
    int getchar (void);
    // Ecrit un bloc.
    ssize_t write (const void *buf, size_t size);
};

#endif // serial_h