Re: serial port access
| From: | Lars Torben Wilson | Date: | Tue, 03 Apr 2001 20:18:09 +0000 |
| Subject: | Re: serial port access | ||
| References: | 1 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-1283@lists.php.net to get a copy of this message | ||
Check out the source to the sockets extension
(ext/socket/sockets.c). Perhaps you can use select() for what you
need.
Unfortunately, the extension is quite non-standard (in the PHP sense;
it mimics the C interfaces fairly closely). It works on Linux but is
not widely tested, is considered experimental, and at least two
members of the core team consider it broken. :) If you don't mind
writing a little wrapper around it in PHP, you should be able to
protect yourself from future (seemingly likely) API changes.
jasonr@argia.net writes:
> no, popen is for opening a process pointer to an external
> executable. One other thing i guess i forgot to add but may be
> obvious; I am working with this on linux, but will eventually want
> it to work on windows as well.
>
> > popen?
> >
> > ----- Original Message -----
> > From: <jasonr@argia.net>
> > To: <php-gtk@lists.php.net>
> > Sent: Tuesday, April 03, 2001 10:02 PM
> > Subject: [PHP-GTK] serial port access
> >
> >
> > I know this is more php and less gtk, but i have been unable to find hte answer elsewhere
> > so bear with me a bit :)
> > Does anyone know how to access a serial port from php? I recently got a portable GPS unit
> > and would like to interface it to a php-gtk app. I dont at the moment need to send data (though i
> > may in the future) the gps unit just dumps some info every second or so, whether theres anything
> > attached to the cable or not so its just a simple read. I've tried doing an fopen on
> > /dev/ttyS0, but when i call fread on the file pointer the app stops responding, no matter what
> > length i tell it to grab.
> > Any ideas?
> > Jason Richardson
> >
> > --
> > PHP GTK Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-gtk-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-gtk-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
> --
> PHP GTK Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-gtk-unsubscribe@lists.php.net
> For additional commands, e-mail: php-gtk-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
--
+----------------------------------------------------------------+
|Torben Wilson <torben@php.net> Adcore Finland|
|http://www.coastnet.com/~torben http://www.adcore.com|
|Ph: 1.604.709.0506 torben@adcore.com|
+----------------------------------------------------------------+