Bachman Kharazmi wrote:
> Now I've a modified crosslink (attached) which take argument and write
> to rtser0.
> I know it's ugly. But it's working and that's always good ;)
> 
> Anyhow. From what I've heard it will be inefficient if my java code
> would call "/usr/src/xenomai/example/crosslink string" even time a
> string should be written to serial.

Yes, it is better to avoid continuous process generations/destructions
for such kind of work, rather write a native Java binding to Xenomai in
order to talk to the serial port.

Hmm... Java... that makes me wonder again if your control loop is ought
to be closed over Java and where you got/will get the RT-capable Java
engine from. Could you tell us more about the architecture?

> 
> And as it looks now I can't even run the binary as user else than root
> (since it starts a xenmai thread?).

There is a module parameter of the nucleus called xenomai_gid. Provide a
group ID, and all users of that group will gain "Xenomai-power" (means
also the power to toast the box by spawning a CPU hog etc.). That allows
you to do at least /some/ kind of privilege separation between RT users
and root, though not a strictly secure one.

Did we already document this feature outside the code? Can't remember
right now though I hacked it... :-/

> 
> How can I as a 'user' open a device, write to it and close it without
> keeping starting processes or threads every time?
> 
> I would like to be able to do something like:
> file =  open("/dev/myTestSerialDevice");
> while (...)
> file.write(...)
> and finally close
> file.close() when there's no more to write.

You can copy this code almost unmodified into an application and compile
it against the Xenomai POSIX skin. The serial port configuration apart
(same under Linux, though), it will open "rtser<whatever>", even if
given like "/dev/rtser...", and work on that port as if it where a Linux
one. Life can be simple, sometimes.

Jan


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to