OpenZWave Library
1.6.1914
Toggle main menu visibility
Loading...
Searching...
No Matches
cpp
src
platform
SerialController.h
Go to the documentation of this file.
1
//-----------------------------------------------------------------------------
2
//
3
// SerialController.h
4
//
5
// Cross-platform serial port handler
6
//
7
// Copyright (c) 2010 Jason Frazier <frazierjason@gmail.com>
8
//
9
// SOFTWARE NOTICE AND LICENSE
10
//
11
// This file is part of OpenZWave.
12
//
13
// OpenZWave is free software: you can redistribute it and/or modify
14
// it under the terms of the GNU Lesser General Public License as published
15
// by the Free Software Foundation, either version 3 of the License,
16
// or (at your option) any later version.
17
//
18
// OpenZWave is distributed in the hope that it will be useful,
19
// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
// GNU Lesser General Public License for more details.
22
//
23
// You should have received a copy of the GNU Lesser General Public License
24
// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
25
//
26
//-----------------------------------------------------------------------------
27
28
#ifndef _SerialController_H
29
#define _SerialController_H
30
31
#include <string>
32
#include "
Defs.h
"
33
#include "
platform/Controller.h
"
34
35
namespace
OpenZWave
36
{
37
namespace
Internal
38
{
39
namespace
Platform
40
{
41
42
// class Driver;
43
// class Msg;
44
class
SerialControllerImpl;
45
49
class
SerialController
:
public
Controller
50
{
51
friend
class
SerialControllerImpl
;
52
53
public
:
54
enum
Parity
55
{
56
Parity_None
= 0,
57
Parity_Odd
,
58
Parity_Even
,
59
Parity_Mark
,
60
Parity_Space
61
};
62
63
enum
StopBits
64
{
65
StopBits_One
= 0,
66
StopBits_OneAndAHalf
= 1,
67
StopBits_Two
= 2
68
};
69
74
SerialController
();
75
80
virtual
~SerialController
();
81
88
bool
SetBaud
(
uint32
const
_baud);
89
96
bool
SetParity
(
Parity
const
_parity);
97
104
bool
SetStopBits
(
StopBits
const
_stopBits);
105
113
bool
Open
(
string
const
& _SerialControllerName);
114
121
bool
Close
();
122
131
uint32
Write
(
uint8
* _buffer,
uint32
_length);
132
133
private
:
134
uint32
m_baud;
135
SerialController::Parity
m_parity;
136
SerialController::StopBits
m_stopBits;
137
string
m_serialControllerName;
138
139
OpenZWave::Internal::Platform::SerialControllerImpl* m_pImpl;
// Pointer to an object that encapsulates the platform-specific implementation of the serial port.
140
bool
m_bOpen;
141
};
142
}
// namespace Platform
143
}
// namespace Internal
144
}
// namespace OpenZWave
145
146
#endif
//_SerialController_H
147
Controller.h
Defs.h
uint32
unsigned int uint32
Definition
Defs.h:91
uint8
unsigned char uint8
Definition
Defs.h:85
OpenZWave::Internal::Platform::Controller::Controller
Controller()
Definition
Controller.h:66
OpenZWave::Internal::Platform::SerialController::SetBaud
bool SetBaud(uint32 const _baud)
Definition
SerialController.cpp:73
OpenZWave::Internal::Platform::SerialController::~SerialController
virtual ~SerialController()
Definition
SerialController.cpp:63
OpenZWave::Internal::Platform::SerialController::Write
uint32 Write(uint8 *_buffer, uint32 _length)
Definition
SerialController.cpp:152
OpenZWave::Internal::Platform::SerialController::SerialControllerImpl
friend class SerialControllerImpl
Definition
SerialController.h:51
OpenZWave::Internal::Platform::SerialController::SetStopBits
bool SetStopBits(StopBits const _stopBits)
Definition
SerialController.cpp:105
OpenZWave::Internal::Platform::SerialController::Close
bool Close()
Definition
SerialController.cpp:136
OpenZWave::Internal::Platform::SerialController::Parity
Parity
Definition
SerialController.h:55
OpenZWave::Internal::Platform::SerialController::Parity_Space
@ Parity_Space
Definition
SerialController.h:60
OpenZWave::Internal::Platform::SerialController::Parity_None
@ Parity_None
Definition
SerialController.h:56
OpenZWave::Internal::Platform::SerialController::Parity_Odd
@ Parity_Odd
Definition
SerialController.h:57
OpenZWave::Internal::Platform::SerialController::Parity_Mark
@ Parity_Mark
Definition
SerialController.h:59
OpenZWave::Internal::Platform::SerialController::Parity_Even
@ Parity_Even
Definition
SerialController.h:58
OpenZWave::Internal::Platform::SerialController::SerialController
SerialController()
Definition
SerialController.cpp:53
OpenZWave::Internal::Platform::SerialController::SetParity
bool SetParity(Parity const _parity)
Definition
SerialController.cpp:89
OpenZWave::Internal::Platform::SerialController::Open
bool Open(string const &_SerialControllerName)
Definition
SerialController.cpp:120
OpenZWave::Internal::Platform::SerialController::StopBits
StopBits
Definition
SerialController.h:64
OpenZWave::Internal::Platform::SerialController::StopBits_OneAndAHalf
@ StopBits_OneAndAHalf
Definition
SerialController.h:66
OpenZWave::Internal::Platform::SerialController::StopBits_One
@ StopBits_One
Definition
SerialController.h:65
OpenZWave::Internal::Platform::SerialController::StopBits_Two
@ StopBits_Two
Definition
SerialController.h:67
OpenZWave::Internal::Platform
Definition
WakeUp.h:42
OpenZWave::Internal
Definition
Bitfield.cpp:33
OpenZWave
Definition
Bitfield.cpp:31
Generated on
for OpenZWave Library by
1.17.0