Skip navigation.
Home
The QNX Community Portal

View topic - How to outport data to an address on another node ?

Page 1 of 1

How to outport data to an address on another node ?

PostPosted: Wed Mar 16, 2016 5:44 am
by sieudot
Hi,

I have some computers connected together via Ethernet, from node 1 to node 3.

Now, on node 1, I want to outport data to an address on node 2, using function outp(), how can I do?

It is
Code: Select all
 system( "on -n2 outp(0x123, 0xFF)" )
, isn't it? Or any clues?

Re: How to outport data to an address on another node ?

PostPosted: Wed Mar 16, 2016 5:11 pm
by Tim
outp is a C function, not a shell command. You can't execute C functions from the shell.

Make a small program to do what you want like:

Code: Select all
void main()
  {
    outp( 0x123, 0xFF );
  }


Compile this into an executable (say it's called 'foo'). Then you can do:

system( "on -n2 foo" )

Tim

P.S. If you need variable values outputted, you can use argc/argv in main() to acquire the values to put in outp.