Handling external events.

HI,

I have a need to handle external events/messages (from a non-photon
application/process) within a photon application.

I have managed to implement a handler and I registered it via a call to
PtAppAddInput. From this handler I plan on emitting an appropriate event to
a specific widget.

The issue I am having is it is not clear to me what I need to do on the
client (external non-photon application/process) side to communicate with
this photon application. I believe I should be able to use QNX message
passing but I need to get a Node ID, process ID and channel ID for the
photon application in question. Is this not correct? How do I go about
getting this info for a photon application?
Can I simply use POSIX calls to send messages to the photon application? If
so, does the input handler registered via PtAppAddInput get called as well
when using the method?

The help documentation is a bit weak of how an external client
application/process needs to configure itself for message sending to a
photon application when using the input handler methodology. The example,
from the sending end, uses a photon to external message send. The receive
side makes sense to me, less the process needed to setup the client end, in
the case of a external to photon message send.

Any help would be great and thank you for you time,
Philip


Philip

Philip Gonia wrote:

HI,

I have a need to handle external events/messages (from a non-photon
application/process) within a photon application.

I have managed to implement a handler and I registered it via a call to
PtAppAddInput. From this handler I plan on emitting an appropriate event to
a specific widget.

The issue I am having is it is not clear to me what I need to do on the
client (external non-photon application/process) side to communicate with
this photon application. I believe I should be able to use QNX message
passing but I need to get a Node ID, process ID and channel ID for the
photon application in question. Is this not correct? How do I go about
getting this info for a photon application?
Can I simply use POSIX calls to send messages to the photon application? If
so, does the input handler registered via PtAppAddInput get called as well
when using the method?

The help documentation is a bit weak of how an external client
application/process needs to configure itself for message sending to a
photon application when using the input handler methodology.

Realy? Please read the section ‘Interprocess Communication’ of the
Photon Programmer’s Guide. There are also several examples included …

Best Regards

Armin

http://www.steinhoff-automation.com

Philip Gonia wrote:

HI,

I have a need to handle external events/messages (from a non-photon
application/process) within a photon application.

I have managed to implement a handler and I registered it via a call to
PtAppAddInput. From this handler I plan on emitting an appropriate event to
a specific widget.

The issue I am having is it is not clear to me what I need to do on the
client (external non-photon application/process) side to communicate with
this photon application. I believe I should be able to use QNX message
passing but I need to get a Node ID, process ID and channel ID for the
photon application in question. Is this not correct? How do I go about
getting this info for a photon application?

Use the PtConnection…/ PtConnector… calls.

I don’t know why QSSL has introduced these wrapper calls … the design
of the PtMainLoop() seems not to be able to separate internal and
external messages.

Best Regards

Armin


Philip Gonia <philip.t.gonia@nasa.gov> wrote:

HI,

I have a need to handle external events/messages (from a non-photon
application/process) within a photon application.

Ok, try the following:

Photon app side:

attach = name_attach( … );
PhChannelAttach( attach->chid, -1, NULL );

PtAppAddInput( NULL, 0, handler_func, … );

On the client side:

coid = name_open( … );
MsgSend( coid, … );

-David

QNX Training Services
http://www.qnx.com/services/training/
Please followup in this newsgroup if you have further questions.