From: Jan Kiszka <jan.kiszka@domain.hid>
To: Everett Wang <everteq@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] error on rt_dev_read, code Success, what does it mean?
Date: Sat, 12 Jun 2010 12:45:44 +0200 [thread overview]
Message-ID: <4C136558.4070002@domain.hid> (raw)
In-Reply-To: <AANLkTik39wezPyRC-myOQi_etA5EPAg-LgzSqyO40IX7@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2073 bytes --]
Everett Wang wrote:
> Thanks. I looked my code again, which is modified from example
> cross-link.c. The section looks like:
>
> ...
> irq_time = rx_event.rxpend_timestamp;
> read = rt_dev_read(read_fd, &write_time, sz);
> if (read == sz) {
> read_time = rt_timer_read();
> printf("%3d |%16llu |%16llu |%16llu\n", nr,
> irq_time - write_time,
> read_time - irq_time,
> read_time - write_time);
> nr++;
> } else if (read < 0 ) {
> printf(RTASK_PREFIX "error on rt_dev_read, code %s\n",
> strerror(-err)); <<<<<<<===========
> break;
> } else {
> printf(RTASK_PREFIX "only %d / %d byte received \n",
> read, sz);
> break;
> }
> ...
> I guess I should change the strerror(-err) to strerror(-read).
Indeed, the example suffers from some copy&paste mistakes. Same for the
write path. And closing in a loop is no longer required. A cleanup is
needed.
> If I do
> that, I some
> times get a " code input/output error". That is better. What can cause
> input/output error?
Try RTSER_RTIOC_GET_STATUS to learn more.
> I get my serial port in that state consistently
> when I
> finish running my GPS program. I can reset it to a usable serial port
> again by remove and re-load xeno-16550A module.
Re-opening the rtser port, ie. restarting your program doesn't help?
Does re-plugging the GPS mouse change the picture? If yes, you may have
to reset its hardware somehow. If no, there might be a sticky state in
our serial driver, ie. a bug.
> But setserial -G can't
> see anything unusual. Could it be some unclosed serial port?
>
> My simple code is attached.
>
> Thanks,
>
> Everett
>
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2010-06-12 10:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-12 4:09 [Xenomai-help] error on rt_dev_read, code Success, what does it mean? Everett Wang
2010-06-12 9:31 ` Gilles Chanteperdrix
2010-06-12 10:13 ` Everett Wang
2010-06-12 10:45 ` Jan Kiszka [this message]
2010-06-12 17:14 ` Everett Wang
2010-06-14 20:03 ` Jan Kiszka
2010-06-14 14:53 ` Luc ANTOLINOS
2010-06-15 0:45 ` Everett Wang
2010-06-15 9:27 ` Luc ANTOLINOS
2010-06-17 7:49 ` Everett Wang
2010-06-17 8:48 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C136558.4070002@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=everteq@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.