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

Modem Functions

6.1.12modem_reset()

This function resets the modem.

Syntax

void modem_reset(int unit)

where:

unit

is the interface unit number.

Return value

None.

Usage

The modem_reset() function is called to re-initialize the dial and initialization strings for the modem from the values read from NVRAM, and calls uart_reset() to reset the modem hardware.

6-14

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

ARM DUI 0079B

Modem Functions

6.1.13modem_speed()

This function returns the baud rate value extracted from the last CONNECT string.

Syntax

long modem_speed(int unit)

where:

unit

is the interface unit number.

Return value

Returns the last known baud rate.

Note

The return value may not relate to the actual transmission speed between this modem and the remote unit at all. Some modems report the connection speed between the UART and the modem, rather than the line speed between the modems.

ARM DUI 0079B

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

6-15

Modem Functions

6.1.14modem_state()

This function obtains a string describing the state of the modem.

Syntax

char *modem_state()

Return value

Returns a pointer to a static read-only string containing a description of the current status.

6-16

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

ARM DUI 0079B

Modem Functions

6.1.15modem_write()

This function sends several characters to the modem.

Syntax

int modem_write(int unit, char *buf, int len)

where:

 

unit

is the interface unit number.

buf

is the pointer to the characters to be sent.

len

is the number of characters to send.

Return value

Returns one of the following:

0

if successful.

–1

if timeout occurs while waiting to send.

Usage

The modem_write() function sends len characters of data from buf to the modem. This function is not actually used by the current PPP stack. It is included to accommodate future releases of PPP.

ARM DUI 0079B

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

6-17