On 3/26/06, jagan nath <[EMAIL PROTECTED]> wrote:
> Still not clear. If I use two seperate interfaces for each volume,and
> suppose I mounted both  teh volumes how do i differentiate between the
> volumes while doing a BlockRead/BlockWrite.....

Storage interfaces are bound to volume instances a run time. But the
concept of using multiple interfaces to refer to different instances
is similar to most other services in TinyOS (timers, active messages,
etc.). For example, when you have a separate interface for a timer,
each interface corresponds to a different timer. There's never any
confusion for which timer to use (assuming you've wired it up
correctly).

For example, if a component uses two BlockRead interfaces as follows:

uses BlockRead as BlockRead0;
uses BlockRead as BlockRead1;
uses Mount as Mount0;
uses Mount as Mount1;

then you can call mount on each as follows:

call Mount0.mount0( my_volume_0 );

When Mount0.mountDone(.) comes back, then you can mount the next volume:

call Mount1.mount1( my_volume_1 );

Then BlockRead0 will always refer to my_volume_0 and BlockRead1 will
always refer to BlockRead1. As I've mentioned before, there is no
unmount command, so those interfaces will always refer to those
volumes after mounting.

--
Jonathan W. Hui
[EMAIL PROTECTED]
http://www.cs.berkeley.edu/~jwhui/

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to