Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!cornell!batcomputer!dyon From: dyon@batcomputer.TN.CORNELL.EDU (Dyon Anniballi) Newsgroups: net.micro.amiga Subject: sending mult chars out Serial port Message-ID: <811@batcomputer.TN.CORNELL.EDU> Date: Sat, 2-Aug-86 02:30:42 EDT Article-I.D.: batcompu.811 Posted: Sat Aug 2 02:30:42 1986 Date-Received: Tue, 5-Aug-86 06:01:52 EDT Organization: Theory Center, Cornell U., Ithaca NY Lines: 40 Keywords: Serial string problems Hello again, As readers here might have noticed, we (hsgj and I) have detected some "irregularities" with the Amiga Kernel while writing our applications. This time, the trouble is with writing to the serial port. First, for your enjoyment, some code right from the RKM: WriteSer(io,data,length) struct IOExtSer *io; char *data; int length; { io->IOSer.io_Data = (APTR)data; /* Abridged version */ io->IOSer.io_Length = length; /* to speed typing */ io->IOSer.io_Command = CMD_WRITE; return(DoIO(io)); } Ok, this function works perfectly if "length = 1", ie if you are only writing one character out the port. However, if we are writing a known length string out the port, say "char data[5] = {'h','e','l','l','o'} " and we give data = &data[0] and length = 5, then we get maybe the first two characters received by the serial listener fine, but the rest is random garbage chars. By the way, this occurs at Baud rates as slow as 300, and with parity, stop bits, write bits identical on both ends of the serial port. At first I thought it was overwriting an output buffer, but I guess "data" points to the output buffer. So we can't figure out why we can't send the string. Our temporary solution has been to do a for loop and just send each individual char out with length = 1; this works fine. But this is not very nice at high bauds, so if anyone has any clues as to our problem, it would be appreciated. Note that this symptom appeared in Workbench v1.1. We upgraded to V1.2 beta 4 recently, but the problem still persists. Thanks much, -- JR UUCP: ihnp4!cornell!batcomputer!dyon ARPA: dyon%batcomputer@cu-arpa.ccs.cornell.edu