I have created an application that responds message sent from a second
computer. When the app receives the message (an integer of “2” for
example) I would like a 2nd executable to be called, and if the main app
receives a different integer (“3” for example) another external executable
should be called
I have created an application that responds message sent from a second
computer. When the app receives the message (an integer of “2” for
example) I would like a 2nd executable to be called, and if the main app
receives a different integer (“3” for example) another external executable
should be called
The simplest way would be with the system() subroutine. Here’s a simple
mock up of how you might want to do it.
switch(msg.value)
{
case ‘2’:
system(“executable_2 &”);
break;
case ‘3’:
system(“executable_3 &”);
break;
}
The ‘&’ would cause the executable to excute separately from
the Photon application. Without it, system() would wait for
the executable to finish.
A little more sophisticated way to do this would be with a spawn…()
routine. I’ll let you check the documentation out for more information.
I have created an application that responds message sent from a second
computer. When the app receives the message (an integer of “2” for
example) I would like a 2nd executable to be called, and if the main app
receives a different integer (“3” for example) another external executable
should be called
The simplest way would be with the system() subroutine. Here’s a simple
mock up of how you might want to do it.
switch(msg.value)
{
case ‘2’:
system(“executable_2 &”);
break;
case ‘3’:
system(“executable_3 &”);
break;
}
The ‘&’ would cause the executable to excute separately from
the Photon application. Without it, system() would wait for
the executable to finish.
A little more sophisticated way to do this would be with a spawn…()
routine. I’ll let you check the documentation out for more information.