Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!rochester!uhura.cc.rochester.edu!joker!mcli From: mcli@joker (Maurice Ling) Newsgroups: comp.sys.mac.programmer Subject: Programming the SCC Keywords: how to send/receive data Message-ID: <2286@ur-cc.UUCP> Date: 16 Jun 89 13:49:31 GMT Sender: news@uhura.cc.rochester.edu Reply-To: mcli@joker (Maurice Ling) Organization: The Institute of Optics, University of Rochester Lines: 65 Hell you all, I'm a relatively novice Mac Programmer and I would like to send and receive simple ascii codes through the SCC port A using THINK's Lightspeed C. I've tried many things already and the program below gives me "Pascal argument wrong size" error. Anyways, All I need to do is send commands like "EX" or "BY1000" to a scanner. I have the "inside Macintosh" Manuals, but the examples are all in Pascal code. Send mail if this topic has been discussed to death. Thanks a bunch. ---------------------------------------------------------------------------- #include #include #include #include #include main() { sendinfo(); } sendinfo() { int setup,stuff, err; long int count = 1L; char message; char *ptr; SerShk flags; flags.fXOn = 1; flags.fCTS = 1; message = 't'; ptr = &message; err = RAMSDOpen(sPortA); printf("%d\n",err); if (!err) { stuff = SerHShake (-7,flags); setup = baud300+data8+stop10+noParity; printf("%d\n",SerReset(-7,setup)); stuff = FSWrite ( -7, count, ptr); printf("%d\n",stuff); printf("%ld\n",count); } RAMSDClose(sPortA); printf("%d\n",err); } ------------------------------------------------------------------------------ ************************************************************************ * * * Optics... The wave of the future ** ** ** * * * * * * * * * * BITNET : MCLI_SS@UORDBV, MCLISS@UORVM * * * * * UUCP : ...rochester!uhura!mcli ** ** ** * * Internet: mcli@uhura.cc.rochester.edu *** *** *** * * ***** ***** ***** * ************************************************************************ ************************************************************************ * * * Optics... The wave of the future ** ** ** *