PModem Class Reference

A class representing a modem attached to a serial port. More...

`#include <modem.h>`

Inheritance diagram for PModem:

## Public Types

enum | Status { Unopened, Uninitialised, Initialising, Initialised, InitialiseFailed, Dialling, DialFailed, AwaitingResponse, LineBusy, NoCarrier, Connected, HangingUp, HangUpFailed, Deinitialising, DeinitialiseFailed, SendingUserCommand, NumStatuses }
Public Types inherited from PSerialChannel
enum | Parity { DefaultParity, NoParity, EvenParity, OddParity, MarkParity, SpaceParity }
| Configuration of serial port parity options. More...
enum | FlowControl { DefaultFlowControl, NoFlowControl, XonXoff, RtsCts }
| Configuration of serial port flow control options. More...
Public Types inherited from PChannel
enum | PXBlockType { PXReadBlock, PXWriteBlock, PXAcceptBlock, PXConnectBlock }
enum | ShutdownValue { ShutdownRead = 0, ShutdownWrite = 1, ShutdownReadAndWrite = 2 }
enum | Errors { NoError, NotFound, FileExists, DiskFull, AccessDenied, DeviceInUse, BadParameter, NoMemory, NotOpen, Timeout, Interrupted, BufferTooSmall, Miscellaneous, ProtocolFailure, NumNormalisedErrors }
| Normalised error codes. More...
enum | ErrorGroup { LastReadError, LastWriteError, LastGeneralError, NumErrorGroups }
| Error groups. More...
typedef std::vector< Slice > | VectorOfSlice
Public Types inherited from PObject
enum | Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
| Result of the comparison operation performed by the `Compare()` function. More...

## Public Member Functions

| PModem ()
| Create a modem object on the serial port specified. More...
| PModem (const PString &port, DWORD speed=0, BYTE data=0, Parity parity=DefaultParity, BYTE stop=0, FlowControl inputFlow=DefaultFlowControl, FlowControl outputFlow=DefaultFlowControl)
| PModem (PConfig &cfg)
| Open the modem serial channel obtaining the parameters from standard variables in the configuration file. More...
virtual PBoolean | Close ()
| Close the channel, shutting down the link to the data source. More...
virtual PBoolean | Open (const PString &port, DWORD speed=0, BYTE data=0, Parity parity=DefaultParity, BYTE stop=0, FlowControl inputFlow=DefaultFlowControl, FlowControl outputFlow=DefaultFlowControl)
| Open the modem serial channel on the specified port. More...
virtual PBoolean | Open (PConfig &cfg)
| Open the modem serial port obtaining the parameters from standard variables in the configuration file. More...
virtual void | SaveSettings (PConfig &cfg)
| Save the current port settings into the configuration file. More...
void | SetInitString (const PString &str)
| Set the modem initialisation meta-command string. More...
PString | GetInitString () const
| Get the modem initialisation meta-command string. More...
PBoolean | CanInitialise () const
| The modem is in a state that allows the initialise to start. More...
PBoolean | Initialise ()
| Send the initialisation meta-command string to the modem. More...
void | SetDeinitString (const PString &str)
| Set the modem de-initialisation meta-command string. More...
PString | GetDeinitString () const
| Get the modem de-initialisation meta-command string. More...
PBoolean | CanDeinitialise () const
| The modem is in a state that allows the de-initialise to start. More...
PBoolean | Deinitialise ()
| Send the de-initialisation meta-command string to the modem. More...
void | SetPreDialString (const PString &str)
| Set the modem pre-dial meta-command string. More...
PString | GetPreDialString () const
| Get the modem pre-dial meta-command string. More...
void | SetPostDialString (const PString &str)
| Set the modem post-dial meta-command string. More...
PString | GetPostDialString () const
| Get the modem post-dial meta-command string. More...
void | SetBusyString (const PString &str)
| Set the modem busy response meta-command string. More...
PString | GetBusyString () const
| Get the modem busy response meta-command string. More...
void | SetNoCarrierString (const PString &str)
| Set the modem no carrier response meta-command string. More...
PString | GetNoCarrierString () const
| Get the modem no carrier response meta-command string. More...
void | SetConnectString (const PString &str)
| Set the modem connect response meta-command string. More...
PString | GetConnectString () const
| Get the modem connect response meta-command string. More...
PBoolean | CanDial () const
| The modem is in a state that allows the dial to start. More...
PBoolean | Dial (const PString &number)
| Send the dial meta-command strings to the modem. More...
void | SetHangUpString (const PString &str)
| Set the modem hang up meta-command string. More...
PString | GetHangUpString () const
| Get the modem hang up meta-command string. More...
PBoolean | CanHangUp () const
| The modem is in a state that allows the hang up to start. More...
PBoolean | HangUp ()
| Send the hang up meta-command string to the modem. More...
PBoolean | CanSendUser () const
| The modem is in a state that allows the user command to start. More...
PBoolean | SendUser (const PString &str)
| Send an arbitrary user meta-command string to the modem. More...
void | Abort ()
PBoolean | CanRead () const
| The modem is in a state that allows the user application to read from the channel. More...
Status | GetStatus () const
| Get the modem objects current state. More...
Public Member Functions inherited from PSerialChannel
PBoolean | SetSpeed (DWORD speed)
| Set the speed (baud rate) of the serial channel. More...
DWORD | GetSpeed () const
| Get the speed (baud rate) of the serial channel. More...
PBoolean | SetDataBits (BYTE data)
| Set the data bits (5, 6, 7 or 8) of the serial port. More...
BYTE | GetDataBits () const
| Get the data bits (5, 6, 7 or 8) of the serial port. More...
PBoolean | SetParity (Parity parity)
| Set the parity of the serial port. More...
Parity | GetParity () const
| Get the parity of the serial port. More...
PBoolean | SetStopBits (BYTE stop)
| Set the stop bits (1 or 2) of the serial port. More...
BYTE | GetStopBits () const
| Get the stop bits (1 or 2) of the serial port. More...
PBoolean | SetInputFlowControl (FlowControl flowControl)
| Set the flow control (handshaking) protocol of the input to the serial port. More...
FlowControl | GetInputFlowControl () const
| Get the flow control (handshaking) protocol of the input to the serial port. More...
PBoolean | SetOutputFlowControl (FlowControl flowControl)
| Set the flow control (handshaking) protocol of the output to the serial port. More...
FlowControl | GetOutputFlowControl () const
| Get the flow control (handshaking) protocol of the output from the serial port. More...
void | SetDTR (PBoolean state=true)
| Set the Data Terminal Ready signal of the serial port. More...
void | ClearDTR ()
| Clear the Data Terminal Ready signal of the serial port. More...
void | SetRTS (PBoolean state=true)
| Set the Request To Send signal of the serial port. More...
void | ClearRTS ()
| Clear the Request To Send signal of the serial port. More...
void | SetBreak (PBoolean state=true)
| Set the break condition of the serial port. More...
void | ClearBreak ()
| Clear the break condition of the serial port. More...
PBoolean | GetCTS ()
| Get the Clear To Send signal of the serial port. More...
PBoolean | GetDSR ()
| Get the Data Set Ready signal of the serial port. More...
PBoolean | GetDCD ()
| Get the Data Carrier Detect signal of the serial port. More...
PBoolean | GetRing ()
| Get the Ring Indicator signal of the serial port. More...
| PSerialChannel ()
| Create a new serial channel object, but do not open it. More...
| PSerialChannel (const PString &port, DWORD speed=0, BYTE data=0, Parity parity=DefaultParity, BYTE stop=0, FlowControl inputFlow=DefaultFlowControl, FlowControl outputFlow=DefaultFlowControl)
| Create a serial channal. More...
| PSerialChannel (PConfig &cfg)
| Create a serial channal. More...
| ~PSerialChannel ()
| Close the serial channel on destruction. More...
Public Member Functions inherited from PChannel
PBoolean | SetErrorValues (Errors errorCode, int osError, ErrorGroup group=LastGeneralError)
| Set error values to those specified. More...
| PChannel ()
| Create the channel. More...
| ~PChannel ()
| Close down the channel. More...
virtual Comparison | Compare (const PObject &obj) const
| Get the relative rank of the two strings. More...
virtual PINDEX | HashFunction () const
| Calculate a hash value for use in sets and dictionaries. More...
virtual PBoolean | IsOpen () const
| Determine if the channel is currently open. More...
virtual PString | GetName () const
| Get the platform and I/O channel type name of the channel. More...
int | GetHandle () const
| Get the integer operating system handle for the channel. More...
virtual PChannel * | GetBaseReadChannel () const
| Get the base channel of channel indirection using PIndirectChannel. More...
virtual PChannel * | GetBaseWriteChannel () const
| Get the base channel of channel indirection using PIndirectChannel. More...
void | SetReadTimeout (const PTimeInterval &time)
| Set the timeout for read operations. More...
PTimeInterval | GetReadTimeout () const
| Get the timeout for read operations. More...
virtual PBoolean | Read (void *buf, PINDEX len)
| Low level read from the channel. More...
virtual PINDEX | GetLastReadCount () const
| Get the number of bytes read by the last Read() call. More...
virtual int | ReadChar ()
| Read a single 8 bit byte from the channel. More...
PBoolean | ReadBlock (void *buf, PINDEX len)
| Read len bytes into the buffer from the channel. More...
PString | ReadString (PINDEX len)
| Read `len` character into a string from the channel. More...
virtual PBoolean | ReadAsync (void *buf, PINDEX len)
| Begin an asynchronous read from channel. More...
virtual void | OnReadComplete (void *buf, PINDEX len)
| User callback function for when a `ReadAsync()` call has completed or timed out. More...
void | SetWriteTimeout (const PTimeInterval &time)
| Set the timeout for write operations to complete. More...
PTimeInterval | GetWriteTimeout () const
| Get the timeout for write operations to complete. More...
virtual PBoolean | Write (const void *buf, PINDEX len)
| Low level write to the channel. More...
virtual PBoolean | Write (const void *buf, PINDEX len, const void *mark)
| Low level write to the channel with marker. More...
virtual PINDEX | GetLastWriteCount () const
| Get the number of bytes written by the last Write() call. More...
PBoolean | WriteChar (int c)
| Write a single character to the channel. More...
PBoolean | WriteString (const PString &str)
| Write a string to the channel. More...
virtual PBoolean | WriteAsync (const void *buf, PINDEX len)
| Begin an asynchronous write from channel. More...
virtual void | OnWriteComplete (const void *buf, PINDEX len)
| User callback function for when a WriteAsync() call has completed or timed out. More...
virtual PBoolean | Shutdown (ShutdownValue option)
| Close one or both of the data streams associated with a channel. More...
virtual bool | SetLocalEcho (bool localEcho)
| Set local echo mode. More...
virtual bool | FlowControl (const void *flowData)
| Flow Control information Pass data to the channel for flowControl determination. More...
PBoolean | SetBufferSize (PINDEX newSize)
| Set the iostream buffer size for reads and writes. More...
PBoolean | SendCommandString (const PString &command)
| Send a command meta-string. More...
void | AbortCommandString ()
| Abort a command string that is in progress. More...
Errors | GetErrorCode (ErrorGroup group=NumErrorGroups) const
| Get normalised error code. More...
int | GetErrorNumber (ErrorGroup group=NumErrorGroups) const
| Get OS errro code. More...
virtual PString | GetErrorText (ErrorGroup group=NumErrorGroups) const
| Get error message description. More...
virtual PBoolean | Read (const VectorOfSlice &slices)
| Low level scattered read from the channel. More...
virtual PBoolean | Write (const VectorOfSlice &slices)
| Low level scattered write to the channel. More...
Public Member Functions inherited from PObject
virtual | ~PObject ()
virtual PObject * | Clone () const
| Create a copy of the class on the heap. More...
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const
| Determine the byte wise comparison of two objects. More...
bool | operator== (const PObject &obj) const
| Compare the two objects. More...
bool | operator!= (const PObject &obj) const
| Compare the two objects. More...
bool | operator< (const PObject &obj) const
| Compare the two objects. More...
bool | operator> (const PObject &obj) const
| Compare the two objects. More...
bool | operator<= (const PObject &obj) const
| Compare the two objects. More...
bool | operator>= (const PObject &obj) const
| Compare the two objects. More...
virtual const char * | GetClass (unsigned ancestor=0) const
| Get the current dynamic type of the object instance. More...
PBoolean | IsClass (const char *cls) const
virtual PBoolean | InternalIsDescendant (const char *clsName) const
| Determine if the dynamic type of the current instance is a descendent of the specified class. More...
virtual void | PrintOn (ostream &strm) const
| Output the contents of the object to the stream. More...
virtual void | ReadFrom (istream &strm)
| Input the contents of the object from the stream. More...

## Protected Attributes

PString | initCmd
PString | deinitCmd
PString | preDialCmd
PString | postDialCmd
PString | busyReply
PString | noCarrierReply
PString | connectReply
PString | hangUpCmd
Status | status
Protected Attributes inherited from PChannel
int | os_handle
| The operating system file handle return by standard open() function. More...
Errors | lastErrorCode [NumErrorGroups+1]
| The platform independant error code. More...
int | lastErrorNumber [NumErrorGroups+1]
| The operating system error number (eg as returned by errno). More...
PINDEX | lastReadCount
| Number of byte last read by the Read() function. More...
PINDEX | lastWriteCount
| Number of byte last written by the Write() function. More...
PTimeInterval | readTimeout
| Timeout for read operations. More...
PTimeInterval | writeTimeout
| Timeout for write operations. More...
PString | channelName
PMutex | px_threadMutex
PXBlockType | px_lastBlockType
PThread * | px_readThread
PThread * | px_writeThread
PMutex | px_writeMutex
PThread * | px_selectThread [3]
PMutex | px_selectMutex [3]

## Additional Inherited Members

Static Public Member Functions inherited from PSerialChannel
static PStringList | GetPortNames ()
| Get a list of the available serial ports. More...
Static Public Member Functions inherited from PChannel
static PBoolean | ConvertOSError (int libcReturnValue, Errors &lastError, int &osError)
| Convert an operating system error into platform independent error. More...
static PString | GetErrorText (Errors lastError, int osError=0)
| Get error message description. More...
Static Public Member Functions inherited from PObject
static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
| Internal function caled from CompareObjectMemoryDirect() More...
static const char * | Class ()
| Get the name of the class as a C string. More...
Protected Member Functions inherited from PChannel
| PChannel (const PChannel &)
PChannel & | operator= (const PChannel &)
virtual PBoolean | ConvertOSError (int libcReturnValue, ErrorGroup group=LastGeneralError)
| Convert an operating system error into platform independent error. More...
int | ReadCharWithTimeout (PTimeInterval &timeout)
| Read a character with specified timeout. More...
PBoolean | ReceiveCommandString (int nextChar, const PString &reply, PINDEX &pos, PINDEX start)
PBoolean | PXSetIOBlock (PXBlockType type, const PTimeInterval &timeout)
int | PXClose ()
Protected Member Functions inherited from PObject
| PObject ()
| Constructor for PObject, made protected so cannot ever create one on its own. More...

## Detailed Description

A class representing a modem attached to a serial port.

This adds the usual modem operations to the basic serial port.

A modem object is always in a particular state. This state determines what operations are allowed which then move the object to other states. The operations are the exchange of strings in "chat" script.

The following defaults are used for command strings: initialise `ATZ\r\w2sOK\w100m` deinitialise `\d2s+++\d2sATH0\r` pre-dial `ATDT` post-dial `\r` busy reply `BUSY` no carrier reply `NO CARRIER` connect reply `CONNECT` hang up `\d2s+++\d2sATH0\r`

## Member Enumeration Documentation

## Status

enum PModem::Status

Enumerator
Unopened | Has not been opened yet.
Uninitialised | Is open but has not yet been initialised.
Initialising | Is currently initialising the modem.
Initialised | Has been initialised but is not connected.
InitialiseFailed | Initialisation sequence failed.
Dialling | Is currently dialling.
DialFailed | Dial failed.
AwaitingResponse | Dialling in progress, awaiting connection.
LineBusy | Dial failed due to line busy.
NoCarrier | Dial failed due to no carrier.
Connected | Dial was successful and modem has connected.
HangingUp | Is currently hanging up the modem.
HangUpFailed | The hang up failed.
Deinitialising | is currently de-initialising the modem
DeinitialiseFailed | The de-initialisation failed.
SendingUserCommand | Is currently sending a user command.
NumStatuses |

## Constructor & Destructor Documentation

## PModem() [1/3]

PModem::PModem | ( |  | ) |

Create a modem object on the serial port specified.

If no port was specified do not open it. It does not initially have a valid port name.

See the PSerialChannel class for more information on the parameters.

## PModem() [2/3]

PModem::PModem | ( | const PString & | port,
|  | DWORD | speed = `0`,
|  | BYTE | data = `0`,
|  | Parity | parity = `DefaultParity`,
|  | BYTE | stop = `0`,
|  | FlowControl | inputFlow = `DefaultFlowControl`,
|  | FlowControl | outputFlow = `DefaultFlowControl`
| ) |  |

Parameters

  port | Serial port name to open.
  speed | Speed of serial port.
  data | Number of data bits for serial port.
  parity | Parity for serial port.
  stop | Number of stop bits for serial port.
  inputFlow | Input flow control.
  outputFlow | Output flow control.

## PModem() [3/3]

PModem::PModem | ( | PConfig & | cfg | ) |

Open the modem serial channel obtaining the parameters from standard variables in the configuration file.

Note that it assumed that the correct configuration file section is already set.

Parameters

  cfg | Configuration file to read parameters from.

## Member Function Documentation

## Abort()

void PModem::Abort | ( |  | ) |

## CanDeinitialise()

PBoolean PModem::CanDeinitialise | ( |  | ) | const

The modem is in a state that allows the de-initialise to start.

Returns
  true if the Deinitialise() function may proceeed.

## CanDial()

PBoolean PModem::CanDial | ( |  | ) | const

The modem is in a state that allows the dial to start.

Returns
  true if the Dial() function may proceeed.

## CanHangUp()

PBoolean PModem::CanHangUp | ( |  | ) | const

The modem is in a state that allows the hang up to start.

Returns
  true if the HangUp() function may proceeed.

## CanInitialise()

PBoolean PModem::CanInitialise | ( |  | ) | const

The modem is in a state that allows the initialise to start.

Returns
  true if the Initialise() function may proceeed.

## CanRead()

PBoolean PModem::CanRead | ( |  | ) | const

The modem is in a state that allows the user application to read from the channel.

Reading while this is true can interfere with the operation of the meta-string processing. This function is only usefull when multi-threading is used.

Returns
  true if Read() operations are "safe".

## CanSendUser()

PBoolean PModem::CanSendUser | ( |  | ) | const

The modem is in a state that allows the user command to start.

Returns
  true if the SendUser() function may proceeed.

## Close()

virtual PBoolean PModem::Close | ( |  | ) |

virtual

Close the channel, shutting down the link to the data source.

Returns
  true if the channel successfully closed.

Reimplemented from PSerialChannel.

## Deinitialise()

PBoolean PModem::Deinitialise | ( |  | ) |

Send the de-initialisation meta-command string to the modem.

The return value indicates that the conditions for the operation to start were met, ie the serial port was open etc and the command was successfully sent with all replies met.

Returns
  true if command string sent successfully and the objects state has changed.

## Dial()

PBoolean PModem::Dial | ( | const PString & | number | ) |

Send the dial meta-command strings to the modem.

The return value indicates that the conditions for the operation to start were met, ie the serial port was open etc and the command was successfully sent with all replies met.

The string sent to the modem is the concatenation of the pre-dial string, a `\s`, the `number` parameter and the post-dial string.

Returns
  true if command string sent successfully and the objects state has changed.

## GetBusyString()

PString PModem::GetBusyString | ( |  | ) | const

Get the modem busy response meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Returns
  string for busy response command.

## GetConnectString()

PString PModem::GetConnectString | ( |  | ) | const

Get the modem connect response meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Returns
  string for connect response command.

## GetDeinitString()

PString PModem::GetDeinitString | ( |  | ) | const

Get the modem de-initialisation meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Returns
  string for de-initialisation command.

## GetHangUpString()

PString PModem::GetHangUpString | ( |  | ) | const

Get the modem hang up meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Returns
  string for hang up command.

## GetInitString()

PString PModem::GetInitString | ( |  | ) | const

Get the modem initialisation meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Returns
  string for initialisation command.

## GetNoCarrierString()

PString PModem::GetNoCarrierString | ( |  | ) | const

Get the modem no carrier response meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Returns
  string for no carrier response command.

## GetPostDialString()

PString PModem::GetPostDialString | ( |  | ) | const

Get the modem post-dial meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Returns
  string for post-dial command.

## GetPreDialString()

PString PModem::GetPreDialString | ( |  | ) | const

Get the modem pre-dial meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Returns
  string for pre-dial command.

## GetStatus()

Status PModem::GetStatus | ( |  | ) | const

Get the modem objects current state.

Returns
  modem status.

## HangUp()

PBoolean PModem::HangUp | ( |  | ) |

Send the hang up meta-command string to the modem.

The return value indicates that the conditions for the operation to start were met, ie the serial port was open etc and the command was successfully sent with all replies met.

Returns
  true if command string sent successfully and the objects state has changed.

## Initialise()

PBoolean PModem::Initialise | ( |  | ) |

Send the initialisation meta-command string to the modem.

The return value indicates that the conditions for the operation to start were met, ie the serial port was open etc and the command was successfully sent with all replies met.

Returns
  true if command string sent successfully and the objects state has changed.

## Open() [1/2]

virtual PBoolean PModem::Open | ( | const PString & | port,
|  | DWORD | speed = `0`,
|  | BYTE | data = `0`,
|  | Parity | parity = `DefaultParity`,
|  | BYTE | stop = `0`,
|  | FlowControl | inputFlow = `DefaultFlowControl`,
|  | FlowControl | outputFlow = `DefaultFlowControl`
| ) |  |

virtual

Open the modem serial channel on the specified port.

See the PSerialChannel class for more information on the parameters.

Returns
  true if the modem serial port was successfully opened.

Parameters

  port | Serial port name to open.
  speed | Speed of serial port.
  data | Number of data bits for serial port.
  parity | Parity for serial port.
  stop | Number of stop bits for serial port.
  inputFlow | Input flow control.
  outputFlow | Output flow control.

Reimplemented from PSerialChannel.

## Open() [2/2]

virtual PBoolean PModem::Open | ( | PConfig & | cfg | ) |

virtual

Open the modem serial port obtaining the parameters from standard variables in the configuration file.

Note that it assumed that the correct configuration file section is already set.

Returns
  true if the modem serial port was successfully opened.

Parameters

  cfg | Configuration file to read parameters from.

Reimplemented from PSerialChannel.

## SaveSettings()

virtual void PModem::SaveSettings | ( | PConfig & | cfg | ) |

virtual

Save the current port settings into the configuration file.

Note that it assumed that the correct configuration file section is already set.

Parameters

  cfg | Configuration file to write parameters to.

Reimplemented from PSerialChannel.

## SendUser()

PBoolean PModem::SendUser | ( | const PString & | str | ) |

Send an arbitrary user meta-command string to the modem.

The return value indicates that the conditions for the operation to start were met, ie the serial port was open etc and the command was successfully sent with all replies met.

Returns
  true if command string sent successfully.

Parameters

  str | User command string to send.

## SetBusyString()

void PModem::SetBusyString | ( | const PString & | str | ) |

Set the modem busy response meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Note there is an implied `\w120s` before the string. Also the `\s` and `\d` commands do not operate and will simply terminate the string match.

Parameters

  str | New busy response command string.

## SetConnectString()

void PModem::SetConnectString | ( | const PString & | str | ) |

Set the modem connect response meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Note there is an implied `\w120s` before the string. Also the `\s` and `\d` commands do not operate and will simply terminate the string match.

Parameters

  str | New connect response command string.

## SetDeinitString()

void PModem::SetDeinitString | ( | const PString & | str | ) |

Set the modem de-initialisation meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Note there is an implied `\s` before the string.

Parameters

  str | New de-initialisation command string.

## SetHangUpString()

void PModem::SetHangUpString | ( | const PString & | str | ) |

Set the modem hang up meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Note there is an implied `\s` before the string.

Parameters

  str | New hang up command string.

## SetInitString()

void PModem::SetInitString | ( | const PString & | str | ) |

Set the modem initialisation meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Note there is an implied `\s` before the string.

Parameters

  str | New initialisation command string.

## SetNoCarrierString()

void PModem::SetNoCarrierString | ( | const PString & | str | ) |

Set the modem no carrier response meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Note there is an implied `\w120s` before the string. Also the `\s` and `\d` commands do not operate and will simply terminate the string match.

Parameters

  str | New no carrier response command string.

## SetPostDialString()

void PModem::SetPostDialString | ( | const PString & | str | ) |

Set the modem post-dial meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Note there is not an implied `\s` before the string, unlike the pre-dial string.

Parameters

  str | New post-dial command string.

## SetPreDialString()

void PModem::SetPreDialString | ( | const PString & | str | ) |

Set the modem pre-dial meta-command string.

See the PChannel::SendCommandString() function for more information on the format of the command string.

Note there is an implied `\s` before the string.

Parameters

  str | New pre-dial command string.

## Member Data Documentation

## busyReply

PString PModem::busyReply

protected

## connectReply

PString PModem::connectReply

protected

## deinitCmd

PString PModem::deinitCmd

protected

## hangUpCmd

PString PModem::hangUpCmd

protected

## initCmd

PString PModem::initCmd

protected

## noCarrierReply

PString PModem::noCarrierReply

protected

## postDialCmd

PString PModem::postDialCmd

protected

## preDialCmd

PString PModem::preDialCmd

protected

## status

Status PModem::status

protected

The documentation for this class was generated from the following file:

- modem.h