Paul,

I wasn't so much thinking about what was right but looking at 
generalizing what OWFS does today.

How do you convert from the data reading on a 18B20 to a temperature? 
Same goes for a humidity level or a thermocouple reading.

It seems like you have readings you get back, and by knowing the meaning 
of the reading you present a usable form. How does this get extended to 
these newly created entries from Jim's proposal?

here are some tricks that I have seen used in the past:

Most interpretive languages (perl, python, java...) have late code 
binding and this is how many of these functions are sucked in. Python is 
the most loose and fast, you can easily load a string then turn in into 
a routine. Then you have the name of the function to call as a variable 
that is created at run time. (shades of simula for us fossils.) Perl is 
in the middle and java can be finicky about this.

With object oriented compiled languages, you have a general class 
operator for something like a noop data transformation and then the more 
specific class overrides the data transformation as needed. If the 
things are all done with loadable libraries, the runtime linker/loader 
can resolve all this. It's not as dynamic as interpretive languages, but 
it does work. You need to have some strict mechanisms for being able to 
compile a new subclass and have the runtime match the source for both 
the main line and the subclass.

With C libraries, it is common in libraries where you can have callback 
hooks that the library can call you back on. Again, loadable libraries 
and the runtime linker/loader fixes up the execution addresses of the 
routines. The bad thing with C is the complete lack of stack bounds 
checking and exceptions, which can make this kind of system a bit more 
sporting than I would like.

The grossest way to do this is to exec a process that takes the input 
and returns the output. many ways to do this, all slow and gross. This 
gives the best error protection. nasty to do 50 times a second!

jerry

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to