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.
Return Value
The modem_hangup function does not return any value.
void modem_hangup (void) {
/* This function clears DTR to force the modem to hang up if */
/* it was on line and/or make the modem to go to command mode. */
step = 0;
proc_hangup ();
}
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.