Am Samstag, 16. Dezember 2006 02:37 schrieb Paul Alfille:
> This is an ambitious, but tricky change. When you are happy with it, let me
> test it too. I can construct a 2 level network here.
>
My idea is to transfer the BUS_select_branch() from BUS_next into BUS_select. 
This should do no harm -- BUS_next is the only place where it is called. That 
way, we could put BUS_select_branch() directly after the BUS_reset().

As BUS_select_branch returns immediately for the backbone, nothing changes 
when selecting the backbone. When selecting a branch, BUS_select_branch() 
will trigger the Smart-On-Command of that DS2409 *again*, thus generating a 
single reset pulse for the branch.

This should work independent on how deep the DS2409 is located, as with the 
previous algorithm, all switches of the DS2409 up to that last DS2409 in the 
row are already set-up correctly, and all the chips in that branch (and the 
backbone) could receive the previously thrown BUS_reset() and 
BUS_select_branch().


As the BUS_next function and therefore, the 'uncached' directories always 
used this method to list nodes on branches, I think the attached minimalistic 
patch is safe. I'm not sure how it affects caching, though.


If the thermostat handling is broken now (don't have one to test), I think 
BUS_select_branch() could be called safely after it, too. I didn't do it just 
to keep the possiblity to attach the thermostat to a branch, too. Maybe it 
works that way?


Kind regards

        Jan
-- 
DOS: n., A small annoying boot virus that causes random spontaneous
        system crashes, usually just before saving a massive project.
        Easily cured by UNIX.  See also MS-DOS, IBM-DOS, DR-DOS.
diff -Naur owfs.orig/module/owlib/src/c/ow_bus.c owfs/module/owlib/src/c/ow_bus.c
--- owfs.orig/module/owlib/src/c/ow_bus.c       2006-12-14 20:50:04.000000000 +0100
+++ owfs/module/owlib/src/c/ow_bus.c    2006-12-17 00:05:00.000000000 +0100
@@ -110,7 +110,7 @@
 int BUS_next( struct device_search * ds, const struct parsedname * pn) {
     int ret ;

-    if ( BUS_select(pn) || BUS_select_branch( pn ) ) return 1 ;
+    if ( BUS_select(pn) ) return 1 ;
     ret = BUS_next_both( ds, pn ) ;
     LEVEL_DEBUG("BUS_next return = %d "SNformat"\n",ret,SNvar(ds->sn)) ;
     if (ret && ret!=-ENODEV) {
diff -Naur owfs.orig/module/owlib/src/c/ow_select.c owfs/module/owlib/src/c/ow_select.c
--- owfs.orig/module/owlib/src/c/ow_select.c    2006-12-14 20:50:04.000000000 +0100
+++ owfs/module/owlib/src/c/ow_select.c 2006-12-17 00:02:54.000000000 +0100
@@ -88,6 +88,7 @@
         /* proper path now "turned on" */
         /* Now select */
         if ( BUS_reset(pn) ) return 1 ;
+        if ( BUS_select_branch(pn) ) return 1 ;

         if ( pn->dev && (pn->dev != DeviceThermostat) ) {
             //printf("Really select %s\n",pn->dev->code);

-------------------------------------------------------------------------
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