From: David G. <dg...@gm...> - 2005-12-14 21:29:48
|
Two main motivations: - a major source of bugs in TinyOS programs is forgetting to wire an interface (especially initialisation interfaces) - in 2.x, we have the concept of "physical and dedicated" interfaces - it would be nice to actually be able to enforce this Proposal: - add some @atleastonce(), @atmostonce(), @exactlyonce() that can be used in component specifications, e.g.,: configuration LedsC { provides interface Init @atleastonce(); provides interface Leds @atmostonce(); } (you don't really want @atmostonce() on Leds, of course) - these annotations would be checked by a standalone program (tos-wiring-check) which runs as part of the standard TinyOS build process (note the extra options to ncc to save the information tos-wiring-check needs): [dgay@barnowl Blink]$ make mica2 mkdir -p build/mica2 compiling BlinkAppC to a mica2 binary ncc -o build/mica2/main.exe -Os -DCC1K_DEF_FREQ=3D434845229=20 -finline-limit=3D100000 -Wall -Wshadow -DDEF_TOS_AM_GROUP=3D0x7d -Wnesc-all -target=3Dmica2 -fnesc-cfile=3Dbuild/mica2/app.c -board=3Dmicasb -I%T/lib/oski -fnesc-dump=3Dwiring -fnesc-dump=3D'interfaces(!abstract())' -fnesc-dump=3D'referenced(interfacedefs, components)' -fnesc-dumpfile=3Dbuild/mica2/wiring-check.xml BlinkAppC.nc -lm nesc1: warning: calls to Leds.get in BlinkC are uncombined tos-wiring-check build/mica2/wiring-check.xml Interface LedsC.Init underwired Interface LedsC.Leds overwired <- BlinkC.Leds (module) [BlinkAppC.nc:57] <- BlinkC.Leds (module) [BlinkAppC.nc:58] compiled BlinkAppC to build/mica2/main.exe 2472 bytes in ROM 64 bytes in RAM Feedback welcome. David |