Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!uw-beaver!microsoft!danno From: danno@microsoft.UUCP (Daniel A. Norton) Newsgroups: comp.sys.ibm.pc Subject: Re: Help sending text to com2: Summary: \n sends CR-LF in text mode Message-ID: <1715@microsoft.UUCP> Date: 11 Aug 88 20:20:57 GMT References: <3012@homxc.UUCP> Organization: Microsoft Corp. Lines: 30 In article <3012@homxc.UUCP>, mlm@homxc.UUCP (M.MILLIMAN) writes: > ... The following program > goes off-hook then on-hook when the program terminates, but does not dial the > number. . . . > fprintf(modem,"ATDT %s\n", phno); You've opened up file 'modem' in text mode. The 'fprintf' function doesn't know that the modem knows the difference between CR and CR/LF, so it's sending CR/LF, since you're in text mode. Change your open mode on the 'fopen' from "w" to "wb", and change the above line to: fprintf(modem,"ATDT %s\r", phno); Otherwise, it would end the line in LF (you probably want CR). Why does the phone go off hook but it does not dial? Well, the modem sees your command, followed by the CR, starts its dialing procedure and then sees the LF come by. You may already know that the SmartModem aborts its dialing procedure whenever it sees anything come from the terminal. I presume you've already intialized the port with the DOS "MODE" command, otherwise the modem would not have gone off hook. -- Any opinions expressed are mine, not my employer's. nortond@microsof.beaver.washington.EDU nortond%microsof@uw-beaver.ARPA {decvax,decwrl,sco,sun,trsvax,uunet,uw-beaver}!microsof!nortond