[Tinyos-help] Calling nesC Commands from C functions

Jay Taneja taneja at cs.berkeley.edu
Fri Jul 7 20:21:08 PDT 2006


Hi,

I have a program where some processing is performed in an included C  
function. Ideally, I would like the C function to call and return the  
result of a nesC command. The reason I am using C is because the  
function takes a variable number of arguments, a feature not yet  
supported in nesC. However, I am unsure if there is any way to call a  
nesC command in my C function. I realize it is possible to have the C  
function simply return the parameters to be passed to the nesC  
command, but that involves two separate operations to be called in my  
module. Any ideas how to get around this?

Here is some simple code:

# myfile.h
bool my_func(int number, ...);

# myfile.c
bool my_func(int number, ...) {
   return call MyProg.my_cmd(number);
}

Hopefully I've described the issue enough. Thanks.

-jay


More information about the Tinyos-help mailing list