OWFS SF.net project page New OWFS Website! by Paul H Alfille SourceForge.net Logo
OWFS Design
overview
components
naming
cache
arrays
performance

OWFS Features
cache
statistics

OWFS Software
Install instructions
Bootable CD
Filesystem (owfs)
Web Server (owhttpd)
Backend Server (owserver)
Perl bindings (owperl)
Python bindings (owpython)
PHP bindings (owphp)
Tcl bindings (owtcl)
Download
Daily Configured Package
CVS -- newest
CVS Statistics
FAQ
Examples & Usage
1-wire wireless
1-Wire Hardware
OWFS Project
OWFS Array Files
Some of the 1-wire device properties are best described as arrays. OWFS presents the 1-wire data as a set of files with consistent naming and attributes. Additionally, if the chip supports it, you can change the properties simultaneously (atomically).

Naming
Files are named name.index where name is the property and index gives the individual element. Index is usually of the form 0,1, ... although a few indicies are of the form A,B,... .
Letters are used only

ALL
Each set of array files also has a file name.ALL which represents all the files put together.  the .ALL file has the same format as the individual array files, possibly separated by commas (unless the contents are binary). Changes are made simultaneously if possible (See Atomic below).

Atomic
If the underlying 1-wire chip supports it, the .ALL file represents all the values at the same time, and any changes are made simultaneously (atomically). This can be useful for changing switches. Usually these atomic operations are individual bits in a register. Array files for an atomic property are extracted from the .ALL file.

Aggregate
For properties that are not atomic, aggregation is used instead. the .ALL file is created from each of the individual array files called in turn. In contrast, atomic .ALL is read directly from the chip and the individual files are extracted from it.
The main implications of the atomic/aggregate distinction is threefold. First, atomic changes are made simultaneously.  Second it is much more efficient to change atomic .ALL files if multiple values need to be changed.Aggregate .ALL changes are essentially made by individual calls for each element, so changing several elements should be done indivudually. Finally, if caching is implemented, atomic properties cache .ALL while aggregate properties cache individual element files.

Separators
The .ALL contains the individual array elements separated by a comma. Pure memory (binary) data is not comma separated.

Examples:
DS1993 4kb Memory iButton
Memory is organized as 16 pages of 32 bytes each.

# ls -al 06.8FD62D000000/*.*

Note that each page has the format page.* with length 32 bytes.
Also, file page.ALL is the combined page.?? files with length 16*32=512 bytes.
-rw-rw-rw-    1 root     root           32 Oct 11 08:26 06.8FD62D000000/page.0
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.1
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.10
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.11
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.12
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.13
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.14
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.15
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.2
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.3
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.4
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.5
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.6
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.7
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.8
-rw-rw-rw- 1 root root 32 Oct 11 08:26 06.8FD62D000000/page.9
-rw-rw-rw- 1 root root 512 Oct 11 08:26 06.8FD62D000000/page.ALL
DS 1982U UniqueWare iButton
Similar, 4 pages of 32 bytes.

# ls -al 89.BD29C300705E/*.*
# for x in 89.*/*.* ; do echo $x; od -Ax -w32 -x $x; done

Since page format is binary, page.ALL has no comma separating the individual pages.
-rw-rw-rw-    1 root     root           32 Oct 11 11:31 89.BD29C300705E/page.0
-rw-rw-rw- 1 root root 32 Oct 11 11:31 89.BD29C300705E/page.1
-rw-rw-rw- 1 root root 32 Oct 11 11:31 89.BD29C300705E/page.2
-rw-rw-rw- 1 root root 32 Oct 11 11:31 89.BD29C300705E/page.3
-rw-rw-rw- 1 root root 128 Oct 11 11:31 89.BD29C300705E/page.ALL
89.BD29C300705E/page.0
000000 280c 0011 2800 00b8 0000 6035 dd00 ffd4 ffff ffff ffff ffff ffff ffff ffff ffff
000020
89.BD29C300705E/page.1
000000 ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff
000020
89.BD29C300705E/page.2
000000 ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff
000020
89.BD29C300705E/page.3
000000 ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff
000020
89.BD29C300705E/page.ALL
000000 280c 0011 2800 00b8 0000 6035 dd00 ffd4 ffff ffff ffff ffff ffff ffff ffff ffff
000020 ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff
*
000080
LCD contoller (Louis Swart version)

Several  properties are array values.
 
Changing the screen, for example, can be done by:echo "OWFSsystem,line two,

# ls *.*
# echo "OWFS system,line two," >  FF.3D0100000100/line16.ALL

Note that the second comma is needed if all 4 elements are supplied.

Integer values can also be in an array:

# cat FF.3D0100000100/counters.ALL
# cat FF.3D0100000100/counters.ALL

Note that the second time through, the counters have been read, and thus cleared. Use the cumulative property to see the total counts.
counters.0    gpio.0    line16.0    line20.0    line40.0
counters.1 gpio.1 line16.1 line20.1 line40.1
counters.2 gpio.2 line16.2 line20.2 line40.ALL
counters.3 gpio.3 line16.3 line20.3
counters.ALL gpio.ALL line16.ALL line20.ALL
"OWFS system,line two,
0, 2, 4, 0
0, 0, 0, 0

© 2003 Paul H. Alfille and The owfs Team
$Id: array.html,v 1.6 2004/10/14 01:44:10 alfille Exp $