Jay, this works fine for me. Does it do what you want?
// a portion of a nesC module implementation
uint16_t m_count;
void myfun( int n, ... ) {
va_list args;
int count;
va_start( args, n );
count = va_arg( args, int );
va_end( args );
call Leds.set( count );
}
event void Timer.fired() {
m_count++;
myfun( 1, m_count );
}
- Cory
On 7/7/06, Jay Taneja <[EMAIL PROTECTED]> wrote:
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
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help