We do this within our /etc/init.d script to start xuaxrtctl on a known port as
specified by $ttyname
if [ ! "`ps -ef | grep xuartctl | grep server | grep port | grep -v grep`" ]$
# xuartctl for port 0 not running. need to start it.
#
# Ensure serial device file name is consistent
#
eval `/usr/local/bin/xuartctl --port 0 --server --speed 38400 2>&1`
sleep 1
ln -sf $ttyname /dev/xuart0
fi
Dave B
--- In "naturalwatt" <> wrote:
>
> I am just getting started with the TS7500 (but will be using the T7550 for
> production).
>
> --- In "jongsoo_k" <jongsoo.kim@> wrote:
> >
> > I am reading the example of xuartctl in software guide for TS 7550.
> >
> > It uses two RS232 port, console and xurt0.
> >
> > From console, the following command is issued so than console program is
> > connected to xurt 0.
> > # xuartctl --port 0 --server
> > # xuartctl --port 0 --server --speed 115200
> > ttyname=/dev/pts/0
> >
>
> I don't think this is right. The console and xuart0 are not the same. The
> first command and second commands are the same apart from the specification
> of the speed. Because --port and --server are both used, a pseudotty is
> allocated. If you do this early in the boot or application startup, it will
> consistently get /dev/pts/0.
>
> > I have a few questions.
> > 1) I understand since the command " xuartctl --port 0 --server" is issued
> > from the console, xuart 0 is connected with console. If a program ( not
> > console) issues this command, then xuart 0 port will be connected with the
> > program ( whatever it is). Am i correct?
>
> Again, not right. It will connect /dev/pts/0 to xuart0.
> >
> > 2)In software guide, i read below
> > [The xuartctl utility will always choose the first free device node. So,
> > there may be instances where specifying "--port 0" will result in
> > /dev/pts/1. This makes it difficult when programming for /dev/pts/0
> > specifically. One suggestion to overcome this is to create symlinks:
> > ln -s /dev/pts/1 /dev/pts/0 ]
> >
> > This makes me concerned because i need to statically assign about 5-6 xuart
> > device nodes statically to physical device ports not like choosing the
> > first free node. I am not sure if the "ln" command can do the job. I
> > appreciate any advice.
>
> If you want to use several XUART, it might be easier to run xuartctl --server
> at boot time. This will then create TCP ports at 7350 up to 7357. You could
> simply open() and read() write() these ports instead of using pseudo ttys.
> There is some subtlety in setting the buad rate, as the ioctl to set them
> doesn't work on sockets. You can either run system("xuartctl
> --speed=SOMETHING") or there is another way.
>
> If you use popen, you can create a pipe you can read and write.
> popen("xuartctl --port=0", "r+") for example.
>
> Sorry I can't give exact details at the moment. I have found Technologic
> Support helpful on matters regarding the xaurts, probably because the
> supplied documentation is a little hard to understand.
>
> Martin
> >
> > Thanks
> >
> > Jongsoo
> >
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|