GEOS SDK TechDocs
|
|
4 Receiving Data
When a call has ended, the modem driver sends a pre-registered message to a specified object. (You specify both the message and the receiving object in
ModemConnect()
.)
In the MTalk example, the modem driver sends MSG_MTALK_PROCESS_CALL_ENDED to the process object when the call has ended for any reason. This message checks if the connection is still open and if it is, calls yet another message, MSG_MTALK_PROCESS_CLOSE, to close it. The handler for MSG_MTALK_PROCESS_CLOSE is shown in Ending A Serial Line Connection .
Code Display 9-4 Ending A Serial Line Connection
@method MTalkProcessClass, MSG_MTALK_PROCESS_CLOSE
{
/* close the connection */
ModemDisconnect();
/*
* Free the buffer and re-set the (global) "connection" flag
* to indicate the connection is closed.
*/
MemFree( recvBuffer );
recvBuffer = NullHandle;
ConnectionOpen = FALSE;
} /* end of MSG_MTALK_PROCESS_CLOSE */
ModemDisconnect()
, defined in modem.goc, takes care of the following:
ModemDisconnect()
takes no parameters and returns void.
GEOS SDK TechDocs
|
|
4 Receiving Data