comp.lang.ada
 help / color / mirror / Atom feed
From: "Alex Mentis" <foo@invalid.invalid>
Subject: Re: GNAT.Serial_Communications
Date: Thu, 14 Apr 2011 13:15:29 +0000 (UTC)
Date: 2011-04-14T13:15:29+00:00	[thread overview]
Message-ID: <io6s1g$t4v$1@dont-email.me> (raw)
In-Reply-To: da0564e5-e856-4080-970a-329d066563d6@f31g2000pri.googlegroups.com

tonyg wrote:

> Its actually blocking on top of the write. Also I've discovered after
> much experimentation that the writes are not doing the job when it
> does not block up. Usually it blocks up after 3-4 write attempts. I
> expect I need to discover what is happening at the other end of the
> wire, but its my first experience of using a serial port for anything.
> 
> I suspect there is an option I am not engaging in the setting up of
> the port. I am using the gpl version so I was thinking there could be
> a bug that is not in the gnat pro version, but I don't want to be a
> bad craftsman :) and gnat are usually pretty much on top of stuff like
> that from previous experience, but then again its a relatively new
> addition to the gnat compiler and no ones perfect. But.... its usually
> me.....
> 
> Saying that though I am successfully reading from the port the
> incoming messages although they do appear in sections and I have to
> keep re reading the port to get the full message...

I'm not exactly sure what you mean by "blocking on top of the write,"
but if I understand correctly, your calls to Write are outputting the
data correctly up to a point. You're just missing the tail end of the
data, right?

If my understanding is correct, I suspect that you are sending the data
faster than it is being read by the destination, causing the input
buffer to fill up. Once it is full, all the new data will just be
ignored. When you finally get around to reading the data from the port,
the only data available for you to read is that which is in the buffer.
While Write did actually send everything as it should have, some of it
got discarded for lack of buffer space. Since you haven't received all
the data you expected, though, it appears like Write stopped working.

Your statement that the "writes are not doing their job when it does
not block" suggests to me that your "electronics" are not actually
taking the data out of the input buffer and using it, resulting in both
the discarding of input described above and lack of action on the data
actually received. You are using a USB port, and I understand that USB
transmission is relatively harder than RS-232/UART transmission (which
is what I was doing with my Bluetooth transceiver). It may be that you
need to make a call to the device driver for the receiving device,
telling it that data is available to read, in order to cause it to read
the data, but I'm just guessing now.

HTH, and good luck! I'd be interested to hear what the solution is when
you do get it figured out.

Alex



  reply	other threads:[~2011-04-14 13:15 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-11 10:26 GNAT.Serial_Communications tonyg
2011-04-11 11:11 ` GNAT.Serial_Communications Brian Drummond
2011-04-13  7:49   ` GNAT.Serial_Communications tonyg
2011-04-13 14:12     ` GNAT.Serial_Communications Alex Mentis
2011-04-13 21:12       ` GNAT.Serial_Communications tonyg
2011-04-14 13:15         ` Alex Mentis [this message]
2011-04-14 17:52         ` GNAT.Serial_Communications Chris Moore
2011-04-15 13:58           ` GNAT.Serial_Communications tonyg
2011-04-15 16:32             ` GNAT.Serial_Communications tonyg
2011-04-15 17:12               ` GNAT.Serial_Communications Simon Clubley
2011-04-15 17:32                 ` GNAT.Serial_Communications tonyg
2011-04-15 18:49                   ` GNAT.Serial_Communications Simon Clubley
2011-04-16  0:07                     ` GNAT.Serial_Communications tonyg
2011-04-16  8:29                       ` GNAT.Serial_Communications Simon Clubley
2011-04-16 10:19                         ` GNAT.Serial_Communications tonyg
2011-04-16 10:33                           ` GNAT.Serial_Communications tonyg
2011-04-16 11:15                             ` GNAT.Serial_Communications Brian Drummond
2011-04-16 12:03                               ` GNAT.Serial_Communications tonyg
2011-04-16 15:12                                 ` GNAT.Serial_Communications Simon Clubley
2011-04-18 20:31                                   ` GNAT.Serial_Communications tonyg
2011-04-18 20:43                                   ` GNAT.Serial_Communications tonyg
2011-04-19 11:46                                     ` GNAT.Serial_Communications tonyg
2011-04-19 12:09                                       ` GNAT.Serial_Communications Ludovic Brenta
2011-04-19 13:53                                         ` GNAT.Serial_Communications tonyg
2011-04-19 19:06                                           ` GNAT.Serial_Communications Ludovic Brenta
2011-04-19 19:57                                         ` GNAT.Serial_Communications Alex Mentis
2011-04-20 11:37                                           ` GNAT.Serial_Communications tonyg
2011-04-20 14:22                                             ` GNAT.Serial_Communications Alex Mentis
2011-04-21  9:00                                               ` GNAT.Serial_Communications tonyg
2011-04-21 13:28                                                 ` GNAT.Serial_Communications Alex Mentis
2011-04-22 13:55                                                 ` GNAT.Serial_Communications Alex Mentis
2011-04-22 15:52                                                   ` GNAT.Serial_Communications Brian Drummond
2011-04-19 13:32                                       ` GNAT.Serial_Communications Simon Clubley
2011-04-19 16:59                                         ` GNAT.Serial_Communications Simon Clubley
2011-04-20 10:17                                         ` GNAT.Serial_Communications Brian Drummond
2011-04-20 20:46                                         ` GNAT.Serial_Communications Brian Drummond
2011-04-21  4:28                                           ` GNAT.Serial_Communications Simon Wright
2011-04-21  9:12                                             ` GNAT.Serial_Communications tonyg
2011-04-21 10:14                                               ` GNAT.Serial_Communications tonyg
2011-04-22 15:54                                             ` GNAT.Serial_Communications Brian Drummond
2011-04-22 16:14                                               ` GNAT.Serial_Communications Simon Wright
2011-04-21 11:56                                           ` GNAT.Serial_Communications Simon Clubley
2011-04-15 18:01               ` GNAT.Serial_Communications Jeffrey Carter
2011-04-16 10:21                 ` GNAT.Serial_Communications tonyg
2016-12-01 19:58 ` GNAT.Serial_Communications mario.blunk.gplus
2017-03-20 15:20   ` GNAT.Serial_Communications Jacob Sparre Andersen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox