Controller.h
Go to the documentation of this file.
//-----------------------------------------------------------------------------
//
// Controller.h
//
// Cross-platform, hardware-abstracted controller data interface
//
// Copyright (c) 2010 Jason Frazier <frazierjason@gmail.com>
//
// SOFTWARE NOTICE AND LICENSE
//
// This file is part of OpenZWave.
//
// OpenZWave is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// OpenZWave is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
#ifndef _Controller_H
#define _Controller_H
#include <string>
#include <list>
#include "Defs.h"
#include "Driver.h"
#include "platform/Stream.h"
namespace OpenZWave
{
class Driver;
class Controller: public Stream
{
// 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.
public:
Controller():Stream( 2048 ){}
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 );
};
} // namespace OpenZWave
#endif //_Controller_H
OpenZWave::Controller::Open
virtual bool Open(string const &_controllerName)=0
OpenZWave
Definition: Bitfield.h:34
Stream.h
OpenZWave::Controller
Definition: Controller.h:41
OpenZWave::Controller::Controller
Controller()
Definition: Controller.h:52
OpenZWave::Controller::PlayInitSequence
void PlayInitSequence(Driver *_driver)
Definition: Controller.cpp:38
OpenZWave::Stream
Platform-independent definition of a circular buffer.
Definition: Stream.h:42
Defs.h
Driver.h
OpenZWave::Controller::Read
uint32 Read(uint8 *_buffer, uint32 _length)
Definition: Controller.cpp:55
OpenZWave::Driver
The Driver class handles communication between OpenZWave and a device attached via a serial port (typ...
Definition: Driver.h:58
OpenZWave::Controller::~Controller
virtual ~Controller()
Definition: Controller.h:58
uint32
unsigned int uint32
Definition: Defs.h:80
OpenZWave::Controller::Close
virtual bool Close()=0
OpenZWave::Controller::Write
virtual uint32 Write(uint8 *_buffer, uint32 _length)=0
uint8
unsigned char uint8
Definition: Defs.h:74