]> oss.titaniummirror.com Git - tinyos-2.x.git/blob - tos/chips/rf230/RadioSend.nc
update RF230Sniffer to the new interfaces
[tinyos-2.x.git] / tos / chips / rf230 / RadioSend.nc
1 /*
2 * Copyright (c) 2007, Vanderbilt University
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 THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
11 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
12 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
13 * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14 *
15 * THE VANDERBILT UNIVERSITY 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 THE VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
19 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
20 *
21 * Author: Miklos Maroti
22 */
23
24 #include <Tasklet.h>
25
26 interface RadioSend
27 {
28 /**
29 * Starts the transmission of the given message. This command must not
30 * be called while another send is in progress (so one must wait for the
31 * sendDone event). Returns EBUSY if a reception is in progress or for
32 * some other reason the request cannot be temporarily satisfied (e.g.
33 * the SPI bus access could not be acquired). In this case the send
34 * command could be retried from a tasklet. Returns SUCCESS if the
35 * transmission could be started. In this case sendDone will be fired.
36 */
37 tasklet_async command error_t send(message_t* msg);
38
39 /**
40 * Signals the completion of the send command, exactly once for each
41 * successfull send command. If the returned error code is SUCCESS, then
42 * the message was sent (may not have been acknowledged), otherwise
43 * the message was not transmitted over the air.
44 */
45 tasklet_async event void sendDone(error_t error);
46
47 /**
48 * This event is fired when the component is most likely able to accept
49 * a send request. If the send command has returned with a failure, then
50 * this event will be called at least once in the near future.
51 */
52 tasklet_async event void ready();
53 }