Class TVSSComm32 (unit VSSComm32) |
TComponent
Constructors |
used as a check if file is assigned (******************************************************************************) TVSSComm32 PUBLIC METHODS (
Functions |
TVSSComm32.
Properties |
Events |
Variables |
Constructors |
Public declarations
used as a check if file is assigned (******************************************************************************) TVSSComm32 PUBLIC METHODS (
Functions |
FCommsLogFileName := '';
FUNCTION: StartComm // PURPOSE: Starts communications over the comm port. // PARAMETERS: hNewCommFile - This is the COMM File handle to communicate with. This handle is obtained from TAPI. // RETURN VALUE: TRUE if able to setup the communications. // COMMENTS: // StartComm makes sure there isn't communication in progress already, creates a Comm file, and creates the read and write threads. It also configures the hNewCommFile for the appropriate COMM settings. // If StartComm fails for any reason, it's up to the calling application to close the Comm file handle. // //
TVSSComm32.StartComm} // // FUNCTION: StopComm // // PURPOSE: Stop and end all communication threads. // // PARAMETERS: // none // // RETURN VALUE: // none // // COMMENTS: // // Tries to gracefully signal all communication threads to // close, but terminates them if it has to. // //
TVSSComm32.StopComm} // // FUNCTION: WriteCommData(PChar, Word) // // PURPOSE: Send a String to the Write Thread to be written to the Comm. // // PARAMETERS: // pszStringToWrite - String to Write to Comm port. // nSizeofStringToWrite - length of pszStringToWrite. // // RETURN VALUE: // Returns TRUE if the PostMessage is successful. // Returns FALSE if PostMessage fails or Write thread doesn't exist. // // COMMENTS: // // This is a wrapper function so that other modules don't care that // Comm writing is done via PostMessage to a Write thread. Note that // using PostMessage speeds up response to the UI (very little delay to // 'write' a string) and provides a natural buffer if the comm is slow // (ie: the messages just pile up in the message queue). // // Note that it is assumed that pszStringToWrite is allocated with // LocalAlloc, and that if WriteCommData succeeds, its the job of the // Write thread to LocalFree it. If WriteCommData fails, then its // the job of the calling function to free the string. // //
Protected declarations
TVSSComm32.WriteCommData} (******************************************************************************) // TVSSComm32 PROTECTED METHODS (******************************************************************************) // // FUNCTION: CloseReadThread // // PURPOSE: Close the Read Thread. // // PARAMETERS: // none // // RETURN VALUE: // none // // COMMENTS: // // Closes the Read thread by signaling the CloseEvent. // Purges any outstanding reads on the comm port. // // Note that terminating a thread leaks memory. // Besides the normal leak incurred, there is an event object // that doesn't get closed. This isn't worth worrying about // since it shouldn't happen anyway. // //
TVSSComm32.CloseReadThread} // // FUNCTION: CloseWriteThread // // PURPOSE: Closes the Write Thread. // // PARAMETERS: // none // // RETURN VALUE: // none // // COMMENTS: // // Closes the write thread by signaling the CloseEvent. // Purges any outstanding writes on the comm port. // // Note that terminating a thread leaks memory. // Besides the normal leak incurred, there is an event object // that doesn't get closed. This isn't worth worrying about // since it shouldn't happen anyway. // //
TVSSComm32.CloseWriteThread
FCommsLogFileName := LogFileName;
*****************************************************************************) // TVSSComm32 PRIVATE METHODS (
Properties |
Published declarations
Events |
property CommPort: string read FCommPort write FCommPort;} { property CommsLogFileName: string read FCommsLogFileName write SetCommsLogFileName;
Variables |
Private declarations