Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ARM).Porting TCP-IP programmer's guide.Ver 1.4.pdf
Скачиваний:
31
Добавлен:
23.08.2013
Размер:
2.79 Mб
Скачать

Modem Functions

6.3mdmport.c

The functions in mdmport.c are the glue layer functions that are specific to porting the modem control module to other platforms. The functions are:

dial_delay() on page 6-25

hangup() on page 6-26

modem_clr_dtr() and modem_set_dtr() on page 6-27

modem_DCD() on page 6-28

modem_portstat() on page 6-29.

6-24

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

ARM DUI 0079B

Modem Functions

6.3.1dial_delay()

This function causes a delay by allowing the task loop to spin.

Syntax

void dial_delay(unsigned long ticks)

where:

ticks is the number of clock ticks to delay for.

Return value

None.

Usage

The dial_delay() function is called to allow the task loop to spin for ticks clock ticks without re-entering dialer code. This function calls YIELD() repeatedly until the requisite number of clock ticks have passed.

ARM DUI 0079B

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

6-25

Modem Functions

6.3.2hangup()

This function hangs up the modem (used by the Menus demonstration, as documented in menus on page 12-6).

Syntax

int hangup(void)

Return value

The hangup() function returns the same values as modem_hangup() (see modem_hangup() on page 6-10).

Usage

The hangup() function is used by the Menus demonstration application to force a hangup of the modem. It calls modem_hangup() with the default modem unit number.

6-26

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

ARM DUI 0079B

Modem Functions

6.3.3modem_clr_dtr() and modem_set_dtr()

These functions control the Data Terminal Ready (DTR) signal to the modem.

Syntax

void modem_clr_dtr(int unit)

void modem_set_dtr(int unit)

where:

unit

is the interface unit number.

Return value

None.

Usage

The modem_clr_dtr() function is used to drop the DTR signal to the modem, and the modem_set_dtr() function is used to assert the DTR signal. The action of dropping the DTR signal will usually cause the modem to hangup the line, if it is connected, and to return to command mode when the DTR signal is asserted again.

ARM DUI 0079B

Copyright © 1998 and 1999 ARM Limited. All rights reserved.

6-27