Send a command meta-string. A meta-string is a string of characters that may contain escaped commands. The escape command is the \ as in the C language.
The escape commands are: {description} [# #] alert (ascii value 7) [# #] backspace (ascii value 8) [##] formfeed (ascii value 12) [#
Definition at line 590 of file pchannel.cxx. References PThread::Current(), PChannel::ReadChar(), PChannel::ReadCharWithTimeout(), PChannel::SetReadTimeout(), PChannel::SetWriteTimeout(), PThread::Sleep(), and PChannel::WriteChar(). Referenced by PModem::Deinitialise(), PModem::Dial(), PModem::HangUp(), PModem::Initialise(), and PModem::SendUser(). { abortCommandString = FALSE; int nextChar; PINDEX sendPosition = 0; PTimeInterval timeout; SetWriteTimeout(10000); while (!abortCommandString) { // not aborted nextChar = GetNextChar(command, sendPosition, &timeout); switch (nextChar) { default : if (!WriteChar(nextChar)) return FALSE; break; case NextCharEndOfString : return TRUE; // Success!! case NextCharSend : break; case NextCharDelay : // Delay in send PThread::Current()->Sleep(timeout); break; case NextCharWait : // Wait for reply PINDEX receivePosition = sendPosition; if (GetNextChar(command, receivePosition) < 0) { SetReadTimeout(timeout); while (ReadChar() >= 0) if (abortCommandString) // aborted return FALSE; } else { receivePosition = sendPosition; do { if (abortCommandString) // aborted return FALSE; if ((nextChar = ReadCharWithTimeout(timeout)) < 0) return FALSE; } while (!ReceiveCommandString(nextChar, command, receivePosition, sendPosition)); // nextChar = GetNextChar(command, receivePosition); sendPosition = receivePosition; } } } return FALSE; }
|