[Tinyos Core WG] Dissemination needs a way to set the default value

David Gay dgay42 at gmail.com
Tue Feb 13 06:32:05 PST 2007


(add a set command to DisseminationValue?)

I'm trying to use Dissemination to disseminate program settings, but
it's a little annoying w/o a way to specify the initial value when no
dissemination value received. You either have to keep your own copy of
the settings (initially set to the default values, and updated when
you get a new value - this wastes RAM), or you have to do:

  settings_t *settings = call DisseminationValue.get();

  if (settings->parameter1)
     ... use settings->parameter1
  else
     ... use default value for parameter1

on each parameter access (and this assumes 0 is not a valid value for
parameter1)
This is with settings_t defined something like
  typedef nx_struct { uintX_t parameter1; ...} settings_t;

David


More information about the Tinyos-2.0wg mailing list