3 * "Copyright (c) 2005 Stanford University. All rights reserved.
5 * Permission to use, copy, modify, and distribute this software and
6 * its documentation for any purpose, without fee, and without written
7 * agreement is hereby granted, provided that the above copyright
8 * notice, the following two paragraphs and the author appear in all
9 * copies of this software.
11 * IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE TO ANY PARTY FOR
12 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
13 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
14 * IF STANFORD UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
17 * STANFORD UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
18 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
20 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND STANFORD UNIVERSITY
21 * HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
22 * ENHANCEMENTS, OR MODIFICATIONS."
26 * Internal AM component that fills in needed packet fields for the
27 * AMSend -> Send transformation.
29 * @author Philip Levis
35 generic module AMQueueEntryP(am_id_t amId) {
36 provides interface AMSend;
45 command error_t AMSend.send(am_addr_t dest,
48 call AMPacket.setDestination(msg, dest);
49 call AMPacket.setType(msg, amId);
50 return call Send.send(msg, len);
53 command error_t AMSend.cancel(message_t* msg) {
54 return call Send.cancel(msg);
57 event void Send.sendDone(message_t* m, error_t err) {
58 signal AMSend.sendDone(m, err);
61 command uint8_t AMSend.maxPayloadLength() {
62 return call Send.maxPayloadLength();
65 command void* AMSend.getPayload(message_t* m) {
66 return call Send.getPayload(m);