Also when tinyos builds the makerules define the following:

IDENT_USERHASH
IDENT_TIMESTAMP
IDENT_UIDHASH

for example from a build I did just now...

-DIDENT_USERHASH=0x11dce1bdL -DIDENT_TIMESTAMP=0x4e321289L
-DIDENT_UIDHASH=0x64639c60L

and then when I built again about 5 mins later.

-DIDENT_USERHASH=0x11dce1bdL -DIDENT_TIMESTAMP=0x4e321364L
-DIDENT_UIDHASH=0x3eba0e6eL

I'm not sure where there are getting these from (I haven't pulled apart
Makerules) but they look pretty random.

Now I know you are trying to do autoconfiguration for IPv6 address
assignment and don't have a serial id chip.

Something else to look at is ./tos/platforms/intelmote2/LocalIeeeEui64C.nc

Look at what they did.   They made one up (using Berkeley's OUI) and then
added node address down below.   Probably won't work for nodes you want to
see but certainly works for a local testbed.

eric



On Thu, Jul 28, 2011 at 4:25 PM, Johny Mattsson <[email protected]>wrote:

> On Thu, Jul 28, 2011 at 11:20 PM, Carlos Rodrigues <[email protected]> wrote:
>
>> **
>>
>> It is possible create a random value during a make? For example in
>> Makefile have something like this:
>> CFLAGS += -DVALUE_RANDOM
>>
> Assuming you're on a *nix system (and using GNU make, but that should be a
> given), you could do something like:
>
> 1) For low randomness (but maybe sufficient for you), just use a process
> ID:
> CFLAGS+= -DMY_RANDOM_VALUE=$(shell echo $$$$)
>
> or
>
> 2) For much better randomness, grab a couple of bytes from /dev/random,
> like so:
> CFLAGS+= -DMY_RANDOM_VALUE=$(shell dd if=/dev/random bs=2 count=1
> 2>/dev/null | od -tu2 | awk '{print $$2}')
>
> There are probably shorter/neater way to do the latter, but I'll leave that
> as the traditional exercise for the reader.
>
> Cheers,
> /Johny
>
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to