On 8/19/2011 12:43, ekgnkb3d wrote:

Paul Alfille-2 wrote:
Do you have an idea of what information you want from the error code?

I would like to distinguish between errors in:
- The application: like a typo in the path which is is nonsens (e.g.
"uncaxxched/", or "temperature21" in a DS18B20)
- The configuration: like accessing a invalid device (e.g. CRC is not valid,
wrong format "/28.7A00.0E" or "/28.7X20Z&010000.0E"
- The hardware: like non reachable devices (e.g. devices never been
connected, temporarily unavailable, shorted bus)
My 0,002 c, which may help the discussion, maybe..

1. It seems to me that "application errors" would be confined to:
    - bad path (device path not present or typo error)
    - bad configuration information (ow_init)
    - invalid request (asking the API to do something that cannot be done)

2. Configuration errors would fall within (1) as they relate to ow_init.

Both 1 and 2 seem to be already covered in the API.

New items (?):

3. Bus or device errors
    - CRC fail on read/write/scan/convert, etc
    - Bus short
    - Adapter connected but not responding
* owfs presumably knows when an adapter has connected and somehow determines that it has disconnected. It may be impossible to distinguish a disconnected adapter from an adapter that is connected but unresponsive. This is particularly true with the DS2490 which locks up during a bus short condition and can only be recovered by
            cycling power to the DS2490 (and bus, if a powered bus).

4. Bus events (not errors)
    - Adapter connected/removed
    - Device connected/removed

Bus or Device Errors:
    * expose a single global bit state indicating:
        - an error on a device
        - an error on a bus
        - an adapter error
* elaborate on error within the end-structure of the specific owfs device, in the case of a device error, or the root in the case of an adapter.
        ./CRC_error (retry count)
        ./error_desc (string)


In the case of a missing device (where your application has stored the address, the device is taken off the bus, and your application does not know this fact) OWFS will also return EINVALID. I am not certain that it's possible to distinguish the difference. However, it would be nice to have an event fired (or queued and available by interrogation via the API) when a device is added or removed. This would allow the user application to remain in sync. In my case I will just re-scan the entire owfs network anyway, so a single event saying "changed" is sufficient.

/m
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to