|
From: Paul A. <pal...@ea...> - 2003-08-29 00:34:19
|
As I wrote you privately, the PDKit was certainly used for some of the
low-level coding, and as a basis for some of the device communication,
especially the search algorhythm. OWFS has (to my mind) a cleaner
interface, which I'm starting to document.
1. Each 1-wire device has it's own file. Each property has it's own
functions to read or write.
2. The command and data strings that go out over the bus are cleaner:
A. Command (to the DS2480B)
BUS_send_cmd(str,bytes) -- send a str and check that the echo
matches
BUS_sendout_cmd(str,bytes) send a str, no echo read
BUS_sendback_cmd(str,resp,bytes) send a string, read response in.
B. Data (to the 1-wire bus)
BUS_send_data(str,bytes) -- send a str and check that the echo
matches
BUS_sendout_data(str,bytes) send a str, no echo read
BUS_sendback_data(str,resp,bytes) send a string, read response in.
So instead of adding the mode shifts, echo checking etc to each
interaction explicitly, these intermediate routines are used. The
general gist is easier to see.
OWFS employs fewer global variables, and doesn't have the interface
index (portnum) as part of every call. (For more than one interface, I
expect OWFS to be called multiple times.)
OWFS doesn't support all the 1-wire functions. First I don't have all
the devices, second not all functions fit easily into a filesystem
model, and lastly, I am aiming for simplicity over completeness.
I expect that OWFS, and especially OWHTTPD will be used for easy tasks,
and testing. Complex transactions and speed-critical work may be better
served by another approach. Still, I could be surprised.
|