Modified SerialPort methods, since they clash with UNIX functions with

the same purpose (open, close, etc).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1461 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2008-04-09 17:19:16 +00:00
parent f7d58c7d48
commit e28bb7b889
4 changed files with 22 additions and 35 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: AtariVox.cxx,v 1.9 2008-04-02 01:54:31 stephena Exp $
// $Id: AtariVox.cxx,v 1.10 2008-04-09 17:19:15 stephena Exp $
//============================================================================
#ifdef SPEAKJET_EMULATION
@ -175,7 +175,7 @@ void AtariVox::shiftIn(bool value)
#ifdef SPEAKJET_EMULATION
mySpeakJet->write(data);
#endif
mySerialPort->write(data);
mySerialPort->writeByte(data);
}
myShiftRegister = 0;
}

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: SerialPort.hxx,v 1.1 2008-03-31 00:59:30 stephena Exp $
// $Id: SerialPort.hxx,v 1.2 2008-04-09 17:19:15 stephena Exp $
//============================================================================
#ifndef SERIALPORT_HXX
@ -27,7 +27,7 @@
but it may be used for other devices in the future.
@author Stephen Anthony
@version $Id: SerialPort.hxx,v 1.1 2008-03-31 00:59:30 stephena Exp $
@version $Id: SerialPort.hxx,v 1.2 2008-04-09 17:19:15 stephena Exp $
*/
class SerialPort
{
@ -46,13 +46,13 @@ class SerialPort
@return False on any errors, else true
*/
virtual bool open(const string& device, int baud, int data,
virtual bool openPort(const string& device, int baud, int data,
int stop, int parity) { return false; }
/**
Close a previously opened serial port.
*/
virtual void close() { }
virtual void closePort() { }
/**
Read a byte from the serial port.
@ -60,7 +60,7 @@ class SerialPort
@param data Destination for the byte read from the port
@return True if a byte was read, else false
*/
virtual bool read(uInt8& data) { return false; }
virtual bool readByte(uInt8& data) { return false; }
/**
Write a byte to the serial port.
@ -68,7 +68,7 @@ class SerialPort
@param data The byte to write to the port
@return True if a byte was written, else false
*/
virtual bool write(const uInt8 data) { return false; }
virtual bool writeByte(const uInt8 data) { return false; }
};
#endif

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: SerialPortUNIX.cxx,v 1.1 2008-03-31 00:59:30 stephena Exp $
// $Id: SerialPortUNIX.cxx,v 1.2 2008-04-09 17:19:15 stephena Exp $
//============================================================================
#include "SerialPortUNIX.hxx"
@ -30,26 +30,20 @@ SerialPortUNIX::~SerialPortUNIX()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool SerialPortUNIX::open(const string& device, int baud, int data,
bool SerialPortUNIX::openPort(const string& device, int baud, int data,
int stop, int parity)
{
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SerialPortUNIX::close()
void SerialPortUNIX::closePort()
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool SerialPortUNIX::read(uInt8& data)
bool SerialPortUNIX::writeByte(const uInt8 data)
{
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool SerialPortUNIX::write(const uInt8 data)
{
cerr << "SerialPortUNIX::write " << (int)data << endl;
cerr << "SerialPortUNIX::writeByte " << (int)data << endl;
return false;
}

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: SerialPortUNIX.hxx,v 1.1 2008-03-31 00:59:30 stephena Exp $
// $Id: SerialPortUNIX.hxx,v 1.2 2008-04-09 17:19:16 stephena Exp $
//============================================================================
#ifndef SERIALPORT_UNIX_HXX
@ -22,10 +22,11 @@
#include "SerialPort.hxx"
/**
Implement reading and writing from a serial port under UNIX.
Implement reading and writing from a serial port under UNIX. For now,
it seems to be Linux-only, and reading isn't actually supported at all.
@author Stephen Anthony
@version $Id: SerialPortUNIX.hxx,v 1.1 2008-03-31 00:59:30 stephena Exp $
@version $Id: SerialPortUNIX.hxx,v 1.2 2008-04-09 17:19:16 stephena Exp $
*/
class SerialPortUNIX : public SerialPort
{
@ -44,20 +45,12 @@ class SerialPortUNIX : public SerialPort
@return False on any errors, else true
*/
bool open(const string& device, int baud, int data, int stop, int parity);
bool openPort(const string& device, int baud, int data, int stop, int parity);
/**
Close a previously opened serial port.
*/
void close();
/**
Read a byte from the serial port.
@param data Destination for the byte read from the port
@return True if a byte was read, else false
*/
bool read(uInt8& data);
void closePort();
/**
Write a byte to the serial port.
@ -65,7 +58,7 @@ class SerialPortUNIX : public SerialPort
@param data The byte to write to the port
@return True if a byte was written, else false
*/
bool write(const uInt8 data);
bool writeByte(const uInt8 data);
};
#endif