Rodney,
I tried your suggestion and it almost works. The message gets through but
it’s garbage.
The call I had missed appears to be the PhChannelAttach() which hardly gets
mentioned in the docs. However if you do a full search on PhChannelAttach()
there are two warnings relating to the order in which you call it,
name_attach() and PtAppAddInput(). The warnings make no sense to me and you
appear to be violating them anyway:)
IMHO the major failing is the docs, but there may be some bugs. In order to
crack it we would have to exchange test programs which is not appropriate
via the newsgroups. Either I can deal with you direct or I will post a full
report via tech support (Darren Learmonth) in the UK. Let me know. My email
is jim@dramatec.co.uk
Jim Douglas
<gui@qnx.com> wrote in message news:Voyager.010228101249.581672A@rdowdall…
Hello Jim
All you should have to do is the following
Server
name_attach_t *attach
attach = name_attach (NULL, “Some_Name”, 0);
PhChannelAttach (attach->chid, -1, NULL);
PtAppAddInput (NULL, 0, input_func, NULL);
int input_func (void *data, int rcvid, void *msg, size_t size)
{
// Only have to reply because Photon does the Receive for you
MsgReply (rcvid, reply_msg, …)
return (Pt_CONTINUE);
}
Client
coid = name_open (“Some_Name”, 0);
…
MsgSend (coid, &msg, sizeof (msg), NULL, 0);
That’s pretty much all you should have to do (Depending on what you are
trying to do).
Rodney
Previously, Jim Douglas wrote in qdn.public.qnxrtp.photon:
Rodney,
Sorry, I tried this and it does not appear to work. The Nto process can
locate the Ph process and send a message to it but it is not intercepted
by
the PtAppAddInput handler. My guess is that it ends up in a queue
(channel)
waiting for a MsgReceive. Do you have a working example? Or is it a case
of
it should work but it’s broken?
Jim
gui@qnx.com> > wrote in message
news:Voyager.010226165708.1048612A@rdowdall…
Hello Jim
Check out name_open, and name_attach in the helpviewer. Your Photon
app
does the name_attach and your other process does the name_open. This
should
allow you to find your Photon app.
Thanks
Rodney
Previously, Jim Douglas wrote in qdn.public.qnxrtp.photon:
Thanks Markus,
There are a couple of examples that show how to set up the Photon
side
of
the equation which is not different from how it was in QNX4. The
trouble
is
they don’t show how the Neutrino process finds the Photon process
and
opens
a communications channel to it. In QNX4 it was simple, you just did
a
‘qnx_name_locate’ and then ‘Send’ to the PID. With Photon 2+Neutrino
life
isn’t so easy…
Jim
“Markus Loffler” <> loffler@ces.clemson.edu> > wrote in message
news:97dnka$sfl$> 1@inn.qnx.com> …
Hi Jim,
I’ve never used PtAppAddInput, but there is an example in the doc,
under
PtAppAddInput. Did you try this one? However, it uses message
queues.
Markus
“Jim Douglas” <> jim@dramatec.co.uk> > wrote in message
news:97din3$pq9$> 1@inn.qnx.com> …
Can anyone tell me how a make a Neutrino process establish a
connection
with
a Photon application such that the Photon application handles
messages
and
(Neutrino) pulses using the callback attached with
PtAppAddInput()?
Assume that both processes are on the same node, and that all
information
needed to establish the connection e.g. name, pid, chid, can be
made
available to the Neutrino process when it starts running.
I can’t find anything in the docs that tells me how to do this,
and
if
it
can’t be done then PtAppAddInput might as well be removed from
the
library.
Jim Douglas
\