[comp.sys.att] Using the modem on the 3B1

robert@pttesac.UUCP (Robert Rodriguez) (09/17/87)

Summary:


I'm trying to use the dial(3C) function on the 3b1
and I'm having a few problems.  Has anyone out there
used this before.  The "Interface Specification" that
came with the 3B1 says to use dial() over ioctl() calls,
but then goes on to only give an example using ioctl.

Could someone post an example ?

Thanks in advance, Robert

dave@arnold.UUCP (Dave Arnold) (09/21/87)

#include <dial.h>

main()
{
    int fd;
    int baud;
    char line[20];
    char telno[30];
    CALL call;
    struct termio tty;

    printf("Line? ");
    scanf("%s", line);
    printf("Baud? ");
    scanf("%d", &baud);
    printf("Number? ");
    scanf("%s", telno);
    ioctl(0, TCGETA, &tty);
    call.attr = &tty;
    call.baud = baud;
    call.speed = baud;
    call.line = line;
    call.telno = telno;
    call.modem = 0;
    if((fd = dial(call)) == -1)
	exit(1);
    printf("fd = %d\n", fd);
    printf("hit return to undial\n");
    scanf("%s", line);
    printf("Before undial()\n");
    undial(fd);
}


-- 
Name:		Dave Arnold
USmail:		26561 Fresno, Mission Viejo, Ca, 92691 USA
DDD:		Voice: +1 714 586 5894, Data: +1 714 458 6563 (nuucp)
UUCP:		...!uunet!ccicpg!arnold!dave