OpenZWave Library: OpenZWave::Controller Class Reference

| OpenZWave Library 1.6.0

Public Member Functions | List of all members
OpenZWave::Controller Class Referenceabstract
Platform Abstraction Support

Represents a USB Controller. More...

`#include <Controller.h>`

Inheritance diagram for OpenZWave::Controller:

## Public Member Functions
| Controller ()
virtual | ~Controller ()
void | PlayInitSequence (Driver *_driver)
virtual bool | Open (string const &_controllerName)=0
virtual bool | Close ()=0
virtual uint32 | Write (uint8 *_buffer, uint32 _length)=0
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 ()

## Additional Inherited Members
Public Types inherited from OpenZWave::Wait
enum | { Timeout_Immediate = 0 , Timeout_Infinite = -1 }
typedef void(* | pfnWaitNotification_t) (void *_context)
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 ()
virtual bool | IsSignalled ()=0
Protected Member Functions inherited from OpenZWave::Ref
virtual | ~Ref ()

## Detailed Description

Represents a USB Controller.

Controller is derived from Stream rather than containing one, so that we can use its Wait abilities without having to duplicate them here. The stream is used for input. Buffering of output is handled by the OS.

## Constructor & Destructor Documentation

## ◆ Controller()

OpenZWave::Controller::Controller | ( |  | ) |
| inline

Consructor. Creates the controller object.

## ◆ ~Controller()

virtual OpenZWave::Controller::~Controller | ( |  | ) |
| inlinevirtual

Destructor. Destroys the controller object.

## Member Function Documentation

## ◆ Close()

virtual bool OpenZWave::Controller::Close | ( |  | ) |
| pure virtual

Close a controller. Closes the controller.

Returns
  True if the controller was closed successfully, or false if the controller was already closed, or an error occurred.

See also
  Open

Implemented in OpenZWave::HidController, and OpenZWave::SerialController.

## ◆ Open()

virtual bool OpenZWave::Controller::Open | ( | string const & | _controllerName | ) |
| pure virtual

Open a controller. Attempts to open a controller and initialize it with the specified paramters.

Parameters

  _controllerName | The name of the port to open. For example, ttyS1 on Linux, or \.\COM2 in Windows.

See also
  Close, Read, Write

Implemented in OpenZWave::HidController, and OpenZWave::SerialController.

## ◆ PlayInitSequence()

void Controller::PlayInitSequence | ( | Driver * | _driver | ) |

Queues a set of Z-Wave messages in the correct order needed to initialize the Controller implementation.

Parameters

  Pointer | to the driver object that will handle the messages.

See also
  Driver::Init

## ◆ Read()

uint32 Controller::Read | ( | uint8 * | _buffer,
|  | uint32 | _length
| ) |  |

Read from a controller. Attempts to read data from an open controller.

Parameters

  _buffer | Pointer to a block of memory large enough to hold the requested data.
  _length | Length in bytes of the data to be read.

Returns
  The number of bytes read.

See also
  Write, Open, Close

## ◆ Write()

virtual uint32 OpenZWave::Controller::Write | ( | uint8 * | _buffer,
|  | uint32 | _length
| ) |  |
| pure virtual

Write to a controller. Attempts to write data to an open controller.

Parameters

  _buffer | Pointer to a block of memory containing the data to be written.
  _length | Length in bytes of the data.

Returns
  The number of bytes written.

See also
  Read, Open, Close

Implemented in OpenZWave::HidController, and OpenZWave::SerialController.

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

- Controller.h
- Controller.cpp