Hey all,

Just occurred to me that you can include the following command to any parameterized interface:

command uint8_t <interface>.getid[uint8_t id]() {
   return id;
}

Best regards,

Darren

-------- Original Message --------

Shane, you are  ****dy marvelous.

--
Warm regards,

Darren Bishop, MSc, BSc (Hons), MBCS

On Monday 14 August 2006 03:24, Shane B. Eisenman wrote:
hi Darren,

i guess this isn't exactly what you were looking for, but you might be
able to get the information you want by keeping track of it yourself from
the beginning. i should say up front that i've never tried what i'm about
to suggest, so no guarantees.

unique() is a compile time constant function. Therefore, i'm thinking
perhaps something like this would work:

   enum my_Interface_IDs {
     Interface_1_const = unique("Interface"),
     ...
   };

   configuration X {
     ...
   }

   implementation {
     components A, B;

     A -> B.Interface[Interface_1_const];
   }

Now you have a symbol 'Interface_1_const' assigned the value of the unique
id, you can reference at run time.

-shane

------------------------------------
http://www.comet.columbia.edu/~shane

On Mon, 14 Aug 2006, Darren Bishop wrote:
> Hi, does anyone know how to obtain the parameter values from within the
> wired component e.g. in A where
>
> A -> B.Interface[unique("Interface")];
>
> Is there by any chance some variable name that when referenced from
> within any of A.Interface's commands/events will yield that unique value?
>
> --
> Warm regards,
>
> Darren Bishop, MSc, BSc (Hons), MBCS
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help@Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to