Tutorial   Class/Enum List   File List   Compound Members  

KDjKernel Class Reference

A base class for realtime i/o communication with KDJ devices. More...

#include <KontrolDj.h>

Inheritance diagram for KDjKernel:

KDjExtended List of all members.

Public Member Functions

 KDjKernel ()
 Default constructor.
 ~KDjKernel ()
 The destructor closes any open device connections.
void openDevice (unsigned int deviceNumber=0)
 Open a device connection.
void closeDevice (void)
 Close an open device connection (if one exists).
unsigned int getDeviceCount (void)
 Return the number of available devices.
std::string getDeviceName (unsigned int deviceNumber)
 Return a string identifier for the specified device number.
void sendMessage (std::vector< unsigned char > *message)
 Send a message to the device.
void getMessage (std::vector< unsigned char > *message)
 Fill the user-provided vector with the data bytes received from the device.

Protected Member Functions

void error (KDjError::Type type)

Protected Attributes

void * apiData_
bool connected_
std::string errorString_

Detailed Description

A base class for realtime i/o communication with KDJ devices.

This class implements some common functionality for the realtime extended i/o subclass KDjExtended.

This class provides a common, platform-independent API for realtime low level i/o communication with KDJ devices. It allows one to probe available KDJ devices, to connect to one such device, and to send and receive messages over the connection.

Definition at line 121 of file KontrolDj.h.


Constructor & Destructor Documentation

KDjKernel::KDjKernel  ) 
 

Default constructor.

An exception will be thrown if a system initialization error occurs.

KDjKernel::~KDjKernel  ) 
 

The destructor closes any open device connections.


Member Function Documentation

void KDjKernel::openDevice unsigned int  deviceNumber = 0  ) 
 

Open a device connection.

An optional device number greater than 0 can be specified. Otherwise, the default or first device found is opened. An exception is thrown if an error occurs while attempting to make the device connection or an device connection was previously established.

void KDjKernel::closeDevice void   ) 
 

Close an open device connection (if one exists).

unsigned int KDjKernel::getDeviceCount void   ) 
 

Return the number of available devices.

An exception is thrown if an error occurs while attempting to get the number of avaliable devices.

std::string KDjKernel::getDeviceName unsigned int  deviceNumber  ) 
 

Return a string identifier for the specified device number.

An exception is thrown if an error occurs while attempting to get the device name or an invalid device specifier is provided.

void KDjKernel::sendMessage std::vector< unsigned char > *  message  ) 
 

Send a message to the device.

This function does not return until a message has been send or when the write timeout timer expires. The size of the message must be 8 bytes. An exception is thrown if an error occurs during output or an device connection was not previously established.

void KDjKernel::getMessage std::vector< unsigned char > *  message  ) 
 

Fill the user-provided vector with the data bytes received from the device.

This function does not return until a message has been read or when the read timeout timer expires. If a message is available it is copied to the user-provided std::vector<unsigned char> container. When no message is available, the function returns an empty container. An exception is thrown if an error occurs during message retrieval or an device connection was not previously established.

void KDjKernel::error KDjError::Type  type  )  [protected]
 


Member Data Documentation

void* KDjKernel::apiData_ [protected]
 

Definition at line 188 of file KontrolDj.h.

bool KDjKernel::connected_ [protected]
 

Definition at line 189 of file KontrolDj.h.

std::string KDjKernel::errorString_ [protected]
 

Definition at line 190 of file KontrolDj.h.


The documentation for this class was generated from the following file:
Copyright © 2005 by LSD Software. All Rights Reserved.
Maintained by LSD, info at kontrol-dj.com