]> oss.titaniummirror.com Git - tinyos-2.x.git/blob - tos/interfaces/ArbiterInfo.nc
When using a Timer in AeroVaneReadP, we don't need to post a task to read vane.
[tinyos-2.x.git] / tos / interfaces / ArbiterInfo.nc
1 /*
2 * "Copyright (c) 2005 Washington University in St. Louis.
3 * All rights reserved.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation for any purpose, without fee, and without written agreement is
7 * hereby granted, provided that the above copyright notice, the following
8 * two paragraphs and the author appear in all copies of this software.
9 *
10 * IN NO EVENT SHALL WASHINGTON UNIVERSITY IN ST. LOUIS BE LIABLE TO ANY PARTY
11 * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
12 * OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF WASHINGTON
13 * UNIVERSITY IN ST. LOUIS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14 *
15 * WASHINGTON UNIVERSITY IN ST. LOUIS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
16 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
18 * ON AN "AS IS" BASIS, AND WASHINGTON UNIVERSITY IN ST. LOUIS HAS NO
19 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
20 * MODIFICATIONS."
21 */
22
23 /*
24 * Copyright (c) 2004, Technische Universitat Berlin
25 * All rights reserved.
26 *
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * - Redistributions of source code must retain the above copyright notice,
31 * this list of conditions and the following disclaimer.
32 * - Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 * - Neither the name of the Technische Universitat Berlin nor the names
36 * of its contributors may be used to endorse or promote products derived
37 * from this software without specific prior written permission.
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
40 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
41 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
42 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
43 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
45 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
46 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
47 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
48 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
49 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50 */
51
52 /*
53 * - Revision -------------------------------------------------------------
54 * $Revision$
55 * $Date$
56 * ========================================================================
57 */
58
59 /**
60 * Please refer to TEP 108 for more information about this interface and its
61 * intended use.<br><br>
62 *
63 * The ArbiterInfo interface allows a component to query the current
64 * status of an arbiter. It must be provided by ALL arbiter implementations,
65 * and can be used for a variety of different purposes. Normally it will be
66 * used in conjunction with the Resource interface for performing run time
67 * checks on access rights to a particular shared resource.
68 *
69 * @author Kevin Klues (klueska@cs.wustl.edu)
70 */
71
72 interface ArbiterInfo {
73 /**
74 * Check whether a resource is currently allocated.
75 *
76 * @return TRUE If the resource being arbitrated is currently allocated
77 * to any of its users<br>
78 * FALSE Otherwise.
79 */
80 async command bool inUse();
81
82 /**
83 * Get the id of the client currently using a resource.
84 *
85 * @return Id of the current owner of the resource<br>
86 * 0xFF if no one currently owns the resource
87 */
88 async command uint8_t userId();
89 }