~vibhavp/ubuntu/saucy/urg/merge-from-debian

« back to all changes in this revision

Viewing changes to src/cpp/connection/SerialDevice.h

  • Committer: Bazaar Package Importer
  • Author(s): Albert Huang
  • Date: 2011-05-20 11:33:03 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110520113303-u8niofzwzcea0osk
Tags: 0.8.12-1
* New upstream release (closes: #624987)
* Add debian/watch file
* Bump standards-version to 3.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
  \author Satofumi KAMIMURA
9
9
 
10
 
  $Id: SerialDevice.h 1428 2009-10-20 05:08:16Z satofumi $
 
10
  $Id: SerialDevice.h 1811 2010-04-30 16:12:05Z satofumi $
11
11
*/
12
12
 
13
13
#include "Connection.h"
16
16
 
17
17
namespace qrk
18
18
{
19
 
  /*!
20
 
    \brief �V���A���ʐM�N���X
21
 
  */
22
 
  class SerialDevice : public Connection
23
 
  {
24
 
  public:
25
 
    enum {
26
 
      DefaultBaudrate = 115200,
 
19
    //! �V���A���ʐM�N���X
 
20
    class SerialDevice : public Connection
 
21
    {
 
22
    public:
 
23
        enum {
 
24
            DefaultBaudrate = 115200,
 
25
        };
 
26
        SerialDevice(void);
 
27
        ~SerialDevice(void);
 
28
 
 
29
        const char* what(void) const;
 
30
 
 
31
        bool connect(const char* device, long baudrate = DefaultBaudrate);
 
32
        void disconnect(void);
 
33
        bool setBaudrate(long baudrate);
 
34
        long baudrate(void) const;
 
35
        bool isConnected(void) const;
 
36
        int send(const char* data, size_t count);
 
37
        int receive(char* data, size_t count, int timeout);
 
38
        size_t size(void) const;
 
39
        void flush(void);
 
40
        void clear(void);
 
41
        void ungetc(const char ch);
 
42
 
 
43
    private:
 
44
        SerialDevice(const SerialDevice& rhs);
 
45
        SerialDevice& operator = (const SerialDevice& rhs);
 
46
 
 
47
        struct pImpl;
 
48
        const std::auto_ptr<pImpl> pimpl;
27
49
    };
28
 
    SerialDevice(void);
29
 
    ~SerialDevice(void);
30
 
 
31
 
    const char* what(void) const;
32
 
 
33
 
    bool connect(const char* device, long baudrate = DefaultBaudrate);
34
 
    void disconnect(void);
35
 
    bool setBaudrate(long baudrate);
36
 
    long baudrate(void) const;
37
 
    bool isConnected(void) const;
38
 
    int send(const char* data, size_t count);
39
 
    int receive(char* data, size_t count, int timeout);
40
 
    size_t size(void) const;
41
 
    void flush(void);
42
 
    void clear(void);
43
 
    void ungetc(const char ch);
44
 
 
45
 
  private:
46
 
    SerialDevice(const SerialDevice& rhs);
47
 
    SerialDevice& operator = (const SerialDevice& rhs);
48
 
 
49
 
    struct pImpl;
50
 
    const std::auto_ptr<pImpl> pimpl;
51
 
  };
52
50
}
53
51
 
54
52
#endif /* !QRK_SERIAL_DEVICE_H */