home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 21877 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  1.8 KB

  1. Path: sparky!uunet!usc!nic.csu.net!csus.edu!netcom.com!edan
  2. Newsgroups: comp.sys.mac.programmer
  3. Subject: Re: Serial Drivers -- Please Help
  4. Message-ID: <1993Jan21.090812.12059@netcom.com>
  5. From: edan@netcom.com (Edan Shalev)
  6. Date: Thu, 21 Jan 1993 09:08:12 GMT
  7. References: <1993Jan20.043451.26994@murdoch.acc.Virginia.EDU>
  8. Organization: Netcom Online Communications Services (408-241-9760 login: guest)
  9. Lines: 53
  10.  
  11. well I just wrote a program using the serial driver (yes i know its out
  12. dated, but the CTB was making my life hell) I have basically the same
  13. setup as you do, so it should work fine.. this is copied and pasted right
  14. out of my code..
  15.  
  16. OSErr serialinit()
  17. {
  18.     OSErr     err;
  19.     SerShk flags;
  20.  
  21.     if ((err = RAMSDOpen(sPortA))) return err;
  22.     if ( (err = SerReset( ainRefNum,baud2400 + data8 + stop10 +noParity)))
  23.     {    RAMSDClose(sPortA);
  24.         return err;
  25.     }
  26.     
  27. /* give the serial manager a SERBUFSIZ buffer */
  28.     if (! (sermgrbuf = (char *)NewPtr (SERBUFSIZ))) {
  29.         err = SerSetBuf(ainRefNum, sermgrbuf, SERBUFSIZ);
  30.     }
  31.     if ( (err = SerReset( aoutRefNum,baud2400 + data8 + stop10 +noParity)))
  32.     {    RAMSDClose(sPortA);
  33.         return err;
  34.     }
  35.     
  36. /* set handshaking */
  37.     flags.fXOn = TRUE;
  38.     flags.fInX = TRUE;
  39.     flags.xOn = XONCHAR;
  40.     flags.xOff = XOFFCHAR;
  41.     if (( err = SerHShake(ainRefNum,&flags))){
  42.         RAMSDClose(sPortA);
  43.         return err;
  44.     }
  45.     
  46.     if (!( inbuf = (char *) NewPtr(SERBUFSIZ))) return MemError();
  47.     return 0; 
  48. }
  49.  
  50. im surprised it still supported, but it works.. im using THINK w/sys 7 also..
  51.  
  52. anyway hope it helps!
  53.  
  54. since im already posting somthing.. I might as well ask a question..
  55. Im using TE functions to process incoming data, and i find it is very slow!
  56. (i kinda didnt want to have to write all the copy/selection/paste/scroll
  57. routines, so i tried text edit) but it is too slow, is there any trick
  58. to TE? it looks like im at 300 baud (when running at 2400) 
  59.  
  60. thanks
  61.  
  62.     edan
  63.  
  64.