Cool. Thanks Johny. learn something everyday. I went and stared at section 11 to see what Johny was talking about and you should be able to use the '@C' attribute notation.
eric 2012/1/10 Johny Mattsson <jmatts...@dius.com.au> > Hello Anna, > > You can use nesC annotations to prevent the name mangling. Have a look at > section 11 in the nesC 1.3 language reference manual. The first two are the > ones which apply to your situation. Depending on the exact use case you may > or may not need the second one. If you don't need it, then Eric's > suggestion of simply putting the definition outside the implementation > block should work just as well. > > Regards, > /Johny > > > 2012/1/11 Anna Förster <anna.foers...@supsi.ch> > >> Hi all, >> >> I am trying to implement a tinyos interface to a software library. The >> problem I am currently facing is that the NesC compiler re-names all >> functions like this: >> >> in BlinkC.nc I define for example MY_FUNCTION >> And then it is converted to BLINKC_MY_FUNCTION >> >> Well, what I am actually trying to do is the following simple scenario: >> >> An external C file uses an interface function, which needs to be defined >> in Tinyos, let's say interface_function(). To compile the C file, I have >> defined a INTERFACE.H file, where I only declare the function, but do not >> impelment it. Then, in the tinyos code, I want to implement it by putting >> exactly this fucntion into the implementation of the TinyOS component. >> >> What happens is that the linker cannot find the implementation of this >> fucntion, because NesC has renamed its implementation to >> BlinkC__interface_function(). >> >> Any ideas of how to handle this?! Any other possibilities of how to >> implement a tinyos function and call it from an external file? >> >> Thanks a lot, >> Anna >> -- >> Dr. Anna Förster >> PostDoctoral Researcher >> Networking Laboratory, SUPSI >> Via Cantonale, Galleria 2 >> Manno, Switzerland >> Tel. + 41 58 666 6597 >> http://www.dti.supsi.ch/~afoerste/ >> >> >> _______________________________________________ >> Tinyos-help mailing list >> Tinyos-help@millennium.berkeley.edu >> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >> > > > > -- > Johny Mattsson > Senior Software Engineer > > DiUS Computing Pty. Ltd. > *where ideas are engineered > * > > _______________________________________________ > Tinyos-help mailing list > Tinyos-help@millennium.berkeley.edu > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > -- Eric B. Decker Senior (over 50 :-) Researcher
_______________________________________________ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help