Hi,
owfs has an ingenious automatic branch selection mechanism for the
DS2409 MicroLAN coupler. A user application has to remember only the
path for a certain chip and owfs does all the pesky DS2409 switching to
reach that chip on the network behind the curtains.
This magic has two drawbacks. First, owfs will *always* address and
switch all the DS2409 lying in the path to a certain chip before
addressing that chip, putting some additional traffic on the bus.
Second, during that process, the "All lines off" command ist sent on the
bus, clearing all the event flags of DS2409 in the process.
I have a bus with remote locks on branch lines, like the DS2409
datasheet suggests:
Host
|
|
|In
| Main
DS2409----------- Lock
|
|Aux
|
|
Other chip
|
|
|
|In
| Main
DS2409----------- Lock
|
|Aux
|
|
Other chips
|
|
|
|In
| Main
DS2409----------- Lock
|
|Aux
|
|
Other chips
(Oh, before someone asks why the locks are on the main lines and not
aux: the DS2409 lines each have a level detector setting an event bit
when something unpowered like an iButton is connected to the line, but
only the main branch event bit makes the DS2409 respond to a
"Conditional search ROM" a.k.a. alarm. Why only main? Ask the Dal-Semi
engineers.)
There may be a dozen locks in the application. If find it rather
undesireable to address up to a dozen DS2409 just to reach the far end
cluster of other chips. So I like the DS2409 to keep their current
switch direction unless I explicitely turn them around to the other
side. Attached is a small patch which does the trick for me.
The patch simply disables the automatic "All lines off" command after
selecting a chip, so the last path used is preserved and the chips in
that path can be addressed by their ID in the main directory, too.
Of course subsequent lists of "/uncached" and "/alarm" will send a
"Search ROM" resp, "Conditional Search ROM" command on the preserved
path instead of the short stub between the host and the first DS2409 as
the unpatched owfs does.
I doubt this patch will be included in the main distribution. Maybe
someone has the same itch to scratch, here's the solution (or part of).
Or maybe I'm wrong and some others like the general idea but not the
somewhat clumsy way I've addressed it.
Thoughts, comments?
Kind regards
Jan
Index: module/owlib/src/c/ow_select.c
===================================================================
RCS file: /cvsroot/owfs/owfs/module/owlib/src/c/ow_select.c,v
retrieving revision 1.61
diff -u -r1.61 ow_select.c
--- module/owlib/src/c/ow_select.c 25 Sep 2012 01:00:47 -0000 1.61
+++ module/owlib/src/c/ow_select.c 5 Jul 2013 20:55:56 -0000
@@ -74,7 +74,7 @@
if (RootNotBranch(pn)) { /* no branches, overdrive possible */
if (in->branch.branch != eBranch_bad ) { // need clear root branch */
LEVEL_DEBUG("Clearing root branch");
- BUS_select_closing(pn) ;
+ //BUS_select_closing(pn) ;
} else {
LEVEL_DEBUG("Continuing root branch");
//BUS_reselect_branch(pn) ;
@@ -89,7 +89,7 @@
{
/* different path */
LEVEL_DEBUG("Clearing all branches to level %d", ds2409_depth);
- BUS_select_closing(pn) ;
+ //BUS_select_closing(pn) ;
} else {
LEVEL_DEBUG("Reselecting branch at level %d", ds2409_depth);
//BUS_reselect_branch(pn) ;
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers