In my opinion, the best way to do this is to #include your library
headers in tos.h.

NesC includes also works, but you have to be careful, because in the
file that includes the header you wouldn't be able to see the macros
defined in the header file (see nesC specs for details).

Using #include in the module body will not work, because the contents of
header file will be placed in module scope. You can modify the header
file though by adding __attribute__((C)) to the function declarations,
etc. to make them global. This way the linker won't complain.

The external libraries (or object files) can be specified in the
Makefile, by adding -l<library> or <objecfile>.o to PFLAGS.

Janos

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Michael Schippling
Sent: Wednesday, January 25, 2006 2:22 PM
To: Ron Olson
Cc: [email protected]
Subject: Re: [Tinyos-help] Intermixing C modules with nesC modules

There might be a way to fix the makefiles to include standard libraries
during the final app.c compile, which I think is just gcc...hope the
experts or your makefile guru can help you on that.

But a couple of kludges that you might try....
Can you #include your C file inside the appropriate nesc structure?
Or, hackhackhack, cat the C onto the end of app.c?

MS

Ron Olson wrote:
> I have a TinyOS application under development, where I want to mix 
> standard C modules with nesC files.  One approach is to cut-and-paste 
> the C modules into a .nc file, combining everything manually or
possibly 
> with the help of tools or include statements.  I'd also have to add
some 
> nesC preamble to the .nc file.
> 
> But, if possible, I'd rather change the build procedure so that I
could 
> compile the C modules separately and have them pulled in during the
link 
> phase, along with the monolithic app.c that the build process
produces.
> 
> Is this feasible, and if so, what are the required steps?
> 
> By the way, the reason I want the C modules to retain their separate 
> identity is because I want to continue to use them in a Linux-based 
> application, without having two diverging code bases.
> 
> Thanks,
> Ron
> 
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
>
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-hel
p
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-hel
p

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to