Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

BOOL PSerialChannel::Open ( const PString port,
DWORD  speed = 0,
BYTE  data = 0,
Parity  parity = DefaultParity,
BYTE  stop = 0,
FlowControl  inputFlow = DefaultFlowControl,
FlowControl  outputFlow = DefaultFlowControl 
) [virtual]

Open a serial channal. The channel is opened it on the specified port and with the specified attributes.

Parameters:
portThe name of the serial port to connect to. This is a platform dependent string and woiuld rarely be a literal. The static function GetPortNames()# can be used to find the platforms serial ports.
speedSerial port speed or baud rate. The actual values possible here are platform dependent, but the standard value of 300, 1200, 2400, 4800, 9600, 19200, 38400 always be legal.
dataNumber of data bits for serial port. The actual values possible here are platform dependent, but 7 and 8 should always be legal.
parityParity for serial port. The actual values possible here are platform dependent, but NoParity#, OddParity# and EvenParity# should always be legal.
stopNumber of stop bits for serial port. The actual values possible here are platform dependent, but 1 and 2 should always be legal.
inputFlowFlow control for data from the remote system into this conputer.
outputFlowFlow control for data from this conputer out to remote system.

Reimplemented in PModem.

Definition at line 310 of file msdos.cxx.

References Close(), PString::Left(), and PChannel::os_handle.

Referenced by PModem::Open(), Open(), and PSerialChannel().

{
  Close();

  os_handle = -1;
  if (PCaselessString("COM") != port.Left(3) &&
                                              port[3] >= '1' && port[3] <= '4')
    return FALSE;
  os_handle = port[3] - '1';
  return SetCommsParam(speed, data, parity, stop, inputFlow, outputFlow);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index