OpenZWave Library  1.4.3190
Public Types | Public Member Functions | Friends | List of all members
OpenZWave::SerialController Class Reference

#include <SerialController.h>

+ Inheritance diagram for OpenZWave::SerialController:
+ Collaboration diagram for OpenZWave::SerialController:

Public Types

enum  Parity {
  Parity_None = 0, Parity_Odd, Parity_Even, Parity_Mark,
  Parity_Space
}
 
enum  StopBits { StopBits_One = 0, StopBits_OneAndAHalf = 1, StopBits_Two = 2 }
 
- Public Types inherited from OpenZWave::Wait
enum  { Timeout_Immediate = 0, Timeout_Infinite = -1 }
 
typedef void(* pfnWaitNotification_t) (void *_context)
 

Public Member Functions

 SerialController ()
 
virtual ~SerialController ()
 
bool SetBaud (uint32 const _baud)
 
bool SetParity (Parity const _parity)
 
bool SetStopBits (StopBits const _stopBits)
 
bool Open (string const &_SerialControllerName)
 
bool Close ()
 
uint32 Write (uint8 *_buffer, uint32 _length)
 
- Public Member Functions inherited from OpenZWave::Controller
 Controller ()
 
virtual ~Controller ()
 
void PlayInitSequence (Driver *_driver)
 
uint32 Read (uint8 *_buffer, uint32 _length)
 
- Public Member Functions inherited from OpenZWave::Stream
 Stream (uint32 _bufferSize)
 
void SetSignalThreshold (uint32 _size)
 
bool Get (uint8 *_buffer, uint32 _size)
 
bool Put (uint8 *_buffer, uint32 _size)
 
uint32 GetDataSize () const
 
void Purge ()
 
- Public Member Functions inherited from OpenZWave::Wait
void AddWatcher (pfnWaitNotification_t _callback, void *_context)
 
void RemoveWatcher (pfnWaitNotification_t _callback, void *_context)
 
- Public Member Functions inherited from OpenZWave::Ref
 Ref ()
 
void AddRef ()
 
int32 Release ()
 

Friends

class SerialControllerImpl
 

Additional Inherited Members

- Static Public Member Functions inherited from OpenZWave::Wait
static int32 Single (Wait *_object, int32 _timeout=-1)
 
static int32 Multiple (Wait **_objects, uint32 _numObjects, int32 _timeout=-1)
 
- Protected Member Functions inherited from OpenZWave::Stream
void LogData (uint8 *_buffer, uint32 _size, const string &_function)
 
virtual bool IsSignalled ()
 
 ~Stream ()
 
- Protected Member Functions inherited from OpenZWave::Wait
 Wait ()
 
virtual ~Wait ()
 
void Notify ()
 
- Protected Member Functions inherited from OpenZWave::Ref
virtual ~Ref ()
 

Member Enumeration Documentation

Enumerator
Parity_None 
Parity_Odd 
Parity_Even 
Parity_Mark 
Parity_Space 
Enumerator
StopBits_One 
StopBits_OneAndAHalf 
StopBits_Two 

Constructor & Destructor Documentation

SerialController::SerialController ( )

Constructor. Creates an object that represents a serial port.

SerialController::~SerialController ( )
virtual

Destructor. Destroys the serial port object.

Member Function Documentation

bool SerialController::Close ( )
virtual

Close a serial port. Closes the serial port.

Returns
True if the port was closed successfully, or false if the port was already closed, or an error occurred.
See also
Open

Implements OpenZWave::Controller.

bool SerialController::Open ( string const &  _SerialControllerName)
virtual

Open a serial port. Attempts to open a serial port and initialize it with the specified parameters.

Parameters
_SerialControllerNameThe name of the port to open. For example, ttyS1 on Linux, or \. in Windows.
Returns
True if the port was opened and configured successfully.
See also
Close, Read, Write

Implements OpenZWave::Controller.

bool SerialController::SetBaud ( uint32 const  _baud)

Set the serial port baud rate. The serial port must be closed for the setting to be accepted.

Parameters
_baudInteger containing the expected baud-rate of the serial connection. Most Z-Wave interfaces run at 115200 baud.
Returns
True if the baud value was accepted.
See also
Open, Close
bool SerialController::SetParity ( Parity const  _parity)

Set the serial port parity. The serial port must be closed for the setting to be accepted.

Parameters
_parityParity enum value indicating the serial data's expected type of parity bits, if any.
Returns
True if the parity value was accepted.
See also
Open, Close
bool SerialController::SetStopBits ( StopBits const  _stopBits)

Set the serial port stop bits. The serial port must be closed for the setting to be accepted.

Parameters
_stopBitsStopBits enum value indicating the serial data's expected number of stop-bits.
Returns
True if the stop bits value was accepted.
See also
Open, Close
uint32 SerialController::Write ( uint8 _buffer,
uint32  _length 
)
virtual

Write to a serial port. Attempts to write data to an open serial port.

Parameters
_bufferPointer to a block of memory containing the data to be written.
_lengthLength in bytes of the data.
Returns
The number of bytes written.
See also
Read, Open, Close

Implements OpenZWave::Controller.

Friends And Related Function Documentation

friend class SerialControllerImpl
friend

The documentation for this class was generated from the following files: