Yes, Matchbox is what I'm using. Sorry for forgetting to mention (as well as my platform MicaZ).

Anyway, I made the changes you suggested and it works like a charm. Thanks a lot!

        Harri

At 12:03 PM 11/17/2005 -0700, David Moss wrote:
If you're talking about Matchbox, it uses a ready() event that signals when
the file system is ready.  Just make your component provide the
implementation for that event and wire up:

// wiring:
Matchbox.ready -> YourComponent.ready;


And in your module:

module YourComponent {
  provides {
    event result_t ready();
  }
}

implementation {

  event result_t ready() {
     // Now the file system is ready to go
  }

}


David



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Harri
Siirtola
Sent: Thursday, November 17, 2005 11:45 AM
To: [email protected]
Subject: [Tinyos-help] Way of knowing when file system is ready?


Hi,

I noticed that my first file read fails after reset. The reason (most
certainly) is that the file system is not ready that quickly after reset.
Is there a sophisticated way of checking when the file system has come up?
Other than wasting some time (tried that and it works) or retrying a few
times?

My application checks for a configuration file on startup, and if one is
found, acts upon the data inside. The problem is, if I take a fresh mote
which hasn't been configured, I cannot tell if "FileRead.open" fails due to
missing files or some other problem.

My guess is, I should check the return value but I couldn't figure out the
appropriate FS_ERROR_XXX definition.

Thanks,

        Harri

_______________________________________________
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

Reply via email to