Re: Passing Values between C App and PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 21, 2009 at 3:25 PM, Tobias Krieger <
tobias.krieger@xxxxxxxxxxxxxxx> wrote:

> Hi,
>
> I've recently written an eMail regarding I2C and PHP - since I haven't
> found a nice solution yet, I'm considering writting the I2C part (opening
> device, writing, reading,...) in C (that's simple) and to recieve (and
> returning) the values through PHP and Javascript.
>
> E.g. Website (PHP/Javascript) -> set a new motorspeed -> PHP passes the new
> speed to C Application -> C AP opens and writes the new speed onto the I2C
> Bus -> Motor executes -> returns ack ->----
>
> Is this somehow, and not complicated possible?


if the C program is written such that it can start and stop on every request
rather than as a daemon, its as simple as shell_exec().

write your C app to take args over the cli and then pass them in through the
call:

<?php
$result = shell_exec('myI2C -speed 50');
?>

something of that nature.

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux