ApparatusFramework::ConsoleDevice Class Reference
[Device Services]

#include <DeviceServices/common/current/include/ConsoleDevice.h>

Inheritance diagram for ApparatusFramework::ConsoleDevice:
ApparatusFramework::CharDevice

List of all members.

Public Member Functions

 ConsoleDevice ()
 ~ConsoleDevice ()
int32 open (void *arg)
int32 close ()
int32 read (uint8 *buffer, const int32 count)
int32 write (uint8 *buffer, const int32 count)
int32 ioCtl (uint32 cmd, void *arg)
int32 seek (uint32 offset, SeekWhenceEnum whence)
void flush ()

Detailed Description

ConsoleDevice Console implementation of the CharDevice interface. The class uses the keyboard as input channel and the screen as output channel

Definition at line 65 of file ConsoleDevice.h.


Constructor & Destructor Documentation

ApparatusFramework::ConsoleDevice::ConsoleDevice (  ) 

constructors, destructors ConsoleDevice Constructor.

ApparatusFramework::ConsoleDevice::~ConsoleDevice (  ) 

Destructor.


Member Function Documentation

int32 ApparatusFramework::ConsoleDevice::close (  )  [virtual]

Closes the device, releases resources used for the operation. After a subsequent open, the device is ready for communication again.

Returns:
Status of the method. See CharDeviceRetVal

Implements ApparatusFramework::CharDevice.

void ApparatusFramework::ConsoleDevice::flush (  )  [virtual]

Writes all internally buffered data onto the device and clears the send and receive buffers.

Implements ApparatusFramework::CharDevice.

int32 ApparatusFramework::ConsoleDevice::ioCtl ( uint32  cmd,
void *  arg 
) [virtual]

Universal method that may be used to configure the device and implement functionality not provided by the interface. The meaning of the different commands executed by this function is entirely device dependent (cmd 1 on device A may be something completely different on device B).

Parameters:
cmd A command that specifies the function to be executed by the method
arg A pointer to an argument passed to the function to be executed
Returns:
Status of the method. See CharDeviceRetVal

Implements ApparatusFramework::CharDevice.

int32 ApparatusFramework::ConsoleDevice::open ( void *  arg  )  [virtual]

Interface Opens a character device. First method to be called after the instantiation. If this method returns successfully, the device is ready to use.

Parameters:
arg A void pointer that can be used for whatever one one choses (default = null).
Returns:
Status of the method. See CharDeviceRetVal

Implements ApparatusFramework::CharDevice.

int32 ApparatusFramework::ConsoleDevice::read ( uint8 buffer,
const int32  count 
) [virtual]

Reads a specified number of characters from the device into a provided buffer. This read method for a device is usually implemented blocking (blocks the calling client).

Parameters:
buffer Pointer to a character buffer. Its the buffer that read will use to fill in the fetched data.
count Number of characters to be read (does not necessarily correspond with the return value).
Returns:
Status of the method.

Implements ApparatusFramework::CharDevice.

int32 ApparatusFramework::ConsoleDevice::seek ( uint32  offset,
SeekWhenceEnum  whence 
) [virtual]

Allows to jump onto a certain position. Seek uses an offset that specifies the location from a certain starting point. (e.g. used in files to write onto a specified position). seek may also be used to find the size of a file (return value of seek(0, SEEK_END)).

Parameters:
offset A number that specifies the amount of chars the wanted position is away from a given starting position (whence defines that).
whence Defines the starting position or how the given index should be interpreted. See SeekWhenceEnum
Returns:
Status of the method.

Implements ApparatusFramework::CharDevice.

int32 ApparatusFramework::ConsoleDevice::write ( uint8 buffer,
const int32  count 
) [virtual]

Writes a specified number of characters from a buffer onto the device.

Parameters:
buffer Pointer to a character buffer. Its the buffer that write takes as data source.
count Number of characters to be taken out of the buffer onto the device.
Returns:
Status of the method.

Implements ApparatusFramework::CharDevice.

© 2004-2010 bbv Software Services AG / Apparatus Services