I would simply add your code to module/owlib/src/c/ow_buslock.c in functions BUS-lock_in and BUS_unlock_in. If there are other 1-wire buses you should add some text to make sure you only lock when the correct bus is referenced.
I don't know how you plan on communicating with the other process. Perhaps a file lock? The code in HA7Net is interesting. The hardware has a lock function, but it expires on it's own after 1 second. I made the assumption that owfs would be used as the exclusive client and merely clear any existing lock at the start. Paul Alfile On Fri, Mar 18, 2011 at 8:05 AM, Chris Boot <[email protected]> wrote: > Hi folks, > > I'm currently building a microcontroller-based device which has a 1-wire > bus and ethernet. This is intended to be a self-contained device for > home automation or industrial control and will query 1-wire devices > attached to it to gather temperature data and suchlike. Internally I use > a DS2812-100 for my bus master. > > I really would like to write an owfs driver for the device so that its > 1-wire attached devices can also be queried by owfs. The problem I have > is as the bus needs to be shared between the controller's internal code > and owfs, so I need to implement some sort of bus locking. It appears > that owfs cannot do that - it has internal locking but can't seem to > tell an external bus master to be locked. > > I looked at the source for the HA7NET controller and it seems to have a > little code in there for locking, but that just releases a lock if it's > acquired - and never tries to claim a lock. > > Can I do what I want without major owfs surgery? > > Thanks, > Chris > > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > Owfs-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/owfs-developers > ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Owfs-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/owfs-developers
