[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/serial SerialAMImplP.nc, NONE, 1.1.2.1 SerialAMReceiverC.nc, NONE, 1.1.2.1 SerialAMSenderC.nc, NONE, 1.1.2.1 SerialQueueP.nc, NONE, 1.1.2.1 Serial.h, 1.1.2.11, 1.1.2.12

Phil Levis scipio at users.sourceforge.net
Mon May 15 09:44:19 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/serial
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10686

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	Serial.h 
Added Files:
      Tag: tinyos-2_0_devel-BRANCH
	SerialAMImplP.nc SerialAMReceiverC.nc SerialAMSenderC.nc 
	SerialQueueP.nc 
Log Message:
Have a Serial send system just like the standard AM send system.


--- NEW FILE: SerialAMImplP.nc ---
// $Id: SerialAMImplP.nc,v 1.1.2.1 2006/05/15 16:44:17 scipio Exp $
/*									tab:4
 * "Copyright (c) 2005 The Regents of the University  of California.  
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice, the following
 * two paragraphs and the author appear in all copies of this software.
 * 
 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
 *
 * Copyright (c) 2004 Intel Corporation
 * All rights reserved.
 *
 * This file is distributed under the terms in the attached INTEL-LICENSE     
 * file. If you do not find these files, copies can be found by writing to
 * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, 
 * 94704.  Attention:  Intel License Inquiry.
 */


/**
 * The underlying configuration of the AM layer. Wires the AM
 * implementation (ActiveMessageC) to the boot sequence, and exports
 * the AM interfaces.
 *
 * @author Philip Levis
 * @date   January 5 2005
 */ 

#include "AM.h"

configuration ActiveMessageImplP {
  provides {
    interface SplitControl;      
    interface AMSend[am_id_t id];
    interface Receive[am_id_t id];
    interface Receive as Snoop[am_id_t id];
    interface Packet;
    interface AMPacket;
    interface PacketAcknowledgements;
  }
}

implementation {
  components SerialActiveMessageC as AM, MainC;

  MainC.SoftwareInit -> AM;

  SplitControl = AM;
  AMSend = AM;
  Receive = AM.Receive;
  Snoop = AM.Snoop;
  Packet = AM;
  AMPacket = AM;
  PacketAcknowledgements = AM;
}

--- NEW FILE: SerialAMReceiverC.nc ---
// $Id: SerialAMReceiverC.nc,v 1.1.2.1 2006/05/15 16:44:17 scipio Exp $
/*
 * "Copyright (c) 2005 Stanford University. All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and
 * its documentation for any purpose, without fee, and without written
 * agreement is hereby granted, provided that the above copyright
 * notice, the following two paragraphs and the author appear in all
 * copies of this software.
 * 
 * IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF STANFORD UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 * 
 * STANFORD UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE
 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND STANFORD UNIVERSITY
 * HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
 * ENHANCEMENTS, OR MODIFICATIONS."
 */

/**
 * The virtualized AM reception abstraction.
 *
 * @author Philip Levis
 * @date   Jan 16 2006
 * @see    TEP 116: Packet Protocols
 */ 

#include "AM.h"

generic configuration AMReceiverC(am_id_t amId) {
  provides {
    interface Receive;
    interface Packet;
    interface AMPacket;
  }
}

implementation {
  components SerialAMImplP as Impl;

  Receive = Impl.Receive[amId];
  Packet = Impl;
  AMPacket = Impl;
}

--- NEW FILE: SerialAMSenderC.nc ---
// $Id: SerialAMSenderC.nc,v 1.1.2.1 2006/05/15 16:44:17 scipio Exp $
/*
 * "Copyright (c) 2006 Stanford University. All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and
 * its documentation for any purpose, without fee, and without written
 * agreement is hereby granted, provided that the above copyright
 * notice, the following two paragraphs and the author appear in all
 * copies of this software.
 * 
 * IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF STANFORD UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 * 
 * STANFORD UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE
 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND STANFORD UNIVERSITY
 * HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
 * ENHANCEMENTS, OR MODIFICATIONS."
 */

/**
 * The virtualized active message send abstraction. Each instantiation
 * of AMSenderC has its own queue of depth one. Therefore, it does not
 * have to contend with other AMSenderC instantiations for queue space.
 * The underlying implementation schedules the packets in these queues
 * using some form of fair-share queueing.
 *
 * @author Philip Levis
 * @date   Jan 16 2006
 * @see    TEP 116: Packet Protocols
 */ 

#include "Serial.h"

generic configuration SerialAMSenderC(am_id_t AMId) {
  provides {
    interface AMSend;
    interface Packet;
    interface AMPacket;
    interface PacketAcknowledgements as Acks;
  }
}

implementation {
  components new AMQueueEntryP(AMId) as AMQueueEntryP;
  components SerialAMQueueP, SerialActiveMessageC as AM;

  AMQueueEntryP.Send -> SerialAMQueueP.Send[unique(UQ_AMQUEUE_SEND)];
  AMQueueEntryP.AMPacket -> AM;
  
  AMSend = AMQueueEntryP;
  Packet = AM;
  AMPacket = AM;
  Acks = AM;
}

--- NEW FILE: SerialQueueP.nc ---
// $Id: SerialQueueP.nc,v 1.1.2.1 2006/05/15 16:44:17 scipio Exp $
/*
 * "Copyright (c) 2005 Stanford University. All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and
 * its documentation for any purpose, without fee, and without written
 * agreement is hereby granted, provided that the above copyright
 * notice, the following two paragraphs and the author appear in all
 * copies of this software.
 * 
 * IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF STANFORD UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 * 
 * STANFORD UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE
 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND STANFORD UNIVERSITY
 * HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
 * ENHANCEMENTS, OR MODIFICATIONS."
 */

/**
 * The fair-share AM send queue.
 *
 * @author Philip Levis
 * @date   Jan 16 2006
 */ 

#include "Serial.h"

configuration SerialQueueP {
  provides interface Send[uint8_t client];
}

implementation {
  enum {
    NUM_CLIENTS = uniqueCount(UQ_SERIALQUEUE_SEND)
  };
  
  components new AMQueueImplP(NUM_CLIENTS), SerialActiveMessageC;

  Send = AMQueueImplP;
  AMQueueImplP.AMSend -> SerialActiveMessageC;
  AMQueueImplP.AMPacket -> SerialActiveMessageC;
  AMQueueImplP.Packet -> SerialActiveMessageC;
  
}


Index: Serial.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/serial/Attic/Serial.h,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -C2 -d -r1.1.2.11 -r1.1.2.12
*** Serial.h	15 Jan 2006 22:31:32 -0000	1.1.2.11
--- Serial.h	15 May 2006 16:44:17 -0000	1.1.2.12
***************
*** 72,75 ****
--- 72,77 ----
  typedef uint8_t uart_id_t;
  
+ #define UQ_SERIALQUEUE_SEND "SerialQueueP.Send"
+ 
  enum {
    HDLC_FLAG_BYTE	   = 0x7e,



More information about the Tinyos-2-commits mailing list