Jaap Struyk wrote:
> On 31-05-09 19:16, Brian Fahrlander wrote:
>
>
>> A piece of code *inside* the tarball is running (I had to put a
>> #!/usr/bin/php as the first line)
>>
>
> owfs is a damn good piece of work and all parts from *inside* the
> tarball I used are working very well...
>
Yes, they are! It's just kinda curious that we have no similar
documentation on the website. Honestly, I've seen a lot of code, though
I've not understood it all. There are myriad styles, some is barely
readable, even to the author- others is clean, clear, and extremely
maintainable. Which is why, since there's a documentation-page on the
website, I looked at it, and didn't drill-down to the source code.
What was missing was this clever and decisive piece of code:
//check to make sure the file exists
if(!function_exists('bcadd')) {
if(file_exists("/opt/owfs/bin/bcadd.php")) {
require "/opt/owfs/bin/bcadd.php";
} else if(file_exists("bcadd.php")) {
require "bcadd.php";
} else {
die("File 'bcadd.php' is not found.\n");
}
}
//check to make sure the file exists
if(file_exists("/opt/owfs/bin/ownet.php")) {
require "/opt/owfs/bin/ownet.php";
} else if(file_exists("ownet.php")) {
require "ownet.php";
} else {
die("File 'ownet.php' is not found.\n");
}
...it sets the stage for this to happen:
$ow=new OWNet("tcp://127.0.0.1:4304");
echo
$ow->get("/1F.38C704000000/main/10.71E454010800/temperature",OWNET_MSG_READ,true);
You see, using the docs on the website, you only get the bottom part.
The top is necessary to find and use the module to prepare PHP to talk
to an owserver.
Thanks guys!
--
------------------------------------------------------------------------
Brian Fahrländer Christian, Conservative, and Technomad
Evansville, IN
ICQ: 5119262 AOL/Yahoo/GoogleTalk: WheelDweller
------------------------------------------------------------------------
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers