I know that TinyOS itself is written in nesC and the application written in nesC gets executed in TinyOS. Can we develop C language application to run on TinyOS?
1 Answers
The short is answer is NO. You generally can't write a application in C that "runs" on TinyOS.
TinyOS uses nesC so you can't directly use a full, already existing C application with TinyOS. Remember that the NesC compiler takes a TinyOS application written in nesC as input and then compiles it and outputs an C application. That C application is then fed to the microcontroller's compiler which compiles it and uploads it to the microcontroller. So if you already have a complete C application then the question is why do you need to compile it with TinyOS's nesC compiler.
A common task that people want to accomplish is to include pure C code (either from some library or self written) in a TinyOS application. This can be accomplished by including normal C header files and then calling the C functions as you normally would do in C. The actual C code can then be located in the header file itself (for instance the CRC.h file in the TinyOS distribution has C code in it's header) or can be in some other C file. Similar to how you would do it in C.

- 995
- 1
- 13
- 29