| Description | The modem_run function is the main thread that performs the command sending actions needed to dial, listen, or disconnect from the remote modem (when TCPnet and the local modem are in command mode). The modem_run function also performs the timeout delays that are necessary when waiting for a response from the local modem and when sending successive commands. The modem_run 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_run on every system timer tick interrupt, which occurs at 100 ms intervals by default. Because of this regular interval, the modem_run function can implement delays using a simple counter.
- The modem driver functions must not use waiting loops because loops block the TCPnet system. Hence, calling the modem_run function every timer tick interval is ideal.
- The functions modem_dial, modem_listen, and modem_hangup only initiate the command sending process with the modem. The modem_run function then continues the process until completion.
|