| Description | The modem_hangup function disconnects the modem connection. The function: - sends an escape sequence to the modem and activates modem command mode
- sends a hangup command to the modem
- waits for further calls if TCPnet is in listening mode.
The modem_hangup function for the null modem is in the RL-TCPnet library. The prototype is defined in net_config.h. If you want to use a standard modem connection, you must copy std_modem.c into your project directory. note - The TcpNet system calls modem_hangup when it wants to disconnect the serial modem connection either from client mode or from server mode.
- The modem_hangup function sends commands to the local modem to perform the steps needed to disconnect. If the local modem does not respond with the message "OK", the function resends the commands a few times before giving up on trying to get disconnected. If the modem does not respond correctly to the hangup command, the modem driver tries to reset the local modem.
- The modem driver functions must not use waiting loops because loops block the TCPnet system.
|