Hi, Phil, Thank you so much for the help.
-- LIU Yu On Tue, Jun 22, 2010 at 9:15 AM, Philip Levis <[email protected]> wrote: > > On Jun 22, 2010, at 5:51 AM, LIU Yu wrote: > >> Greetings, >> >> I am working on an extension to TOSSIM. The idea is to bind Sensor >> components to external data sources (i.e. synthetic data generators or >> DB tables containing real historical data). With such an extension, >> data management algorithms for WSN can be evaluated in a more thorough >> way. As the development proceeds, I came up with the following >> concerns on how to make the extension less invasive to existing TOSSIM >> code. >> >> 1. Extending "sim.extra" v.s. Adding a new "sim-custom.extra": >> >> My extension needs to link a separate object file into the Tossim app. >> So far as I know, this can be done in three ways, i) hack >> "$TOSROOT/support/sim.extra", ii) put custom make rules in app's local >> Makefile, iii) add a new "sim-custom.extra" to "$TOSROOT/support/". >> Unfortunately all three methods have some drawbacks. > > Why does it need to link a separate object file? Can you just include the C > code? > > >> >> For the 1st method, existing code of TinyOS distribution needs to be >> modified, which is invasive. And it potentially increases maintanence >> cost (i.e. need to modify all "$TOSROOT/support/sim*.extra, including >> "sim.extra", "sim-fast.extra" and "sim-sf.extra" and those from >> upcoming extensions). >> >> For the 2nd, the app's local Makefile becomes complicated, and >> contains details that app. developers generally need not to know. >> Worse still, these complicated details are duplicated among all >> relevant app's Makefile. >> >> For the 3rd, each app. can only be compiled with one particular TOSSIM >> extension. For example, if "sim-custom.extra" is modified from >> "sim.extra", then the resulting app. has to be built with "make micaz >> sim-custom", and it thus cannot utilize TOSSIM Live features (which >> need to be built with "make micaz sim-sf"). > > Can you work it to include another .extra? So you'd do 'make sim sim-sensors'? >> >> >> 2. Custom initialization at the start of TOSSIM applications: >> >> My extension needs to initialize a *singleton* connection to external >> data source at the start of simulation. I understand this can be done >> by hacking "$TOSROOT/tos/lib/tossim/sim_tossim.c" (i.e. adding the >> custom init() function into sim_init()). But again, this is invasive >> to existing code. >> >> Of couse, the initialization task can be pushed to app's simulation >> scripts. But I am seeking to avoid this design, because it adds >> potential burden / trap to app. developers. >> >> Could anyone suggest a better way / place invoking this initialization? > > Include a component whose init calls a C function, and the C function only > opens the connection on its first invocation? > > Phil _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
