On 12/13/06, Jan Kandziora <[EMAIL PROTECTED]> wrote:

Am Mittwoch, 13. Dezember 2006 12:51 schrieb Paul Alfille:
>
> How about separating the functions  as:
> "present" = 0 if no devices, "1" if more
> "single" = "" if 0 or >1, else name (ID)
> You can return other error codes, just not through FS_output_ascii_z
>
> I checked in a provisional "simultaneous/present" -- see if you like it.
>
Thanks for the simplifications, caching, and error handling you showed
there.

I'm not entirely happy with separated nodes, as they involve reading twice
and
therefore, have both a performance hit *and* introduced a race condition.
However, the "simultaneous/present" node is useful if someone wants to do
a
quick check prior to a scan ("uncached") of an usually unpopulated bus
segment.


Well, it really depends on what you intend to do with the data. You can only
get "empty" and "non-empty" reliably. "More than one" isn't truly reliable
(a CRC8 means 1/256 chance of false single)

Many of the adapters have an id chip included, so this technique will only
work on DS2409 branches or the "more than one".


If I understand correctly it should be possible to return an error code from
FS_output_ascii (without "_z"). I'll try this for the new "single" (really
"single", not "id"?) node.

"single" = "" if 0, -EFAULT if >1, else name(id)


Correct (though not valid C syntax, of course). A bigger question is should
the function return an error if it was used correctly?

Paul Alfille
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to