[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/ctp CtpSenderC.nc, NONE, 1.1.2.1 CtpSenderP.nc, NONE, 1.1.2.1 TreeRouting.h, NONE, 1.1.2.1 Collection.h, 1.1.2.1, 1.1.2.2 CollectionSenderC.nc, 1.1.2.2, NONE CollectionSenderP.nc, 1.1.2.2, NONE

Kyle Jamieson kasj78 at users.sourceforge.net
Tue Aug 29 10:24:43 PDT 2006


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

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	Collection.h 
Added Files:
      Tag: tinyos-2_0_devel-BRANCH
	CtpSenderC.nc CtpSenderP.nc TreeRouting.h 
Removed Files:
      Tag: tinyos-2_0_devel-BRANCH
	CollectionSenderC.nc CollectionSenderP.nc 
Log Message:
Moved link estimator to its own directory; updated CTP for compilation errors.

--- NEW FILE: CtpSenderC.nc ---
/* $Id: CtpSenderC.nc,v 1.1.2.1 2006/08/29 17:24:40 kasj78 Exp $ */
/*
 * Copyright (c) 2006 Massachusetts Institute of Technology (MIT).
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * - Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 * - Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the
 *   distribution.
 * - Neither the name of the Massachusetts Institute of Technology nor
 *   the names of its contributors may be used to endorse or promote
 *   products derived from this software without specific prior written
 *   permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
 * MASSACHUSETTS INSITIUTE OF TECHNOLOGY OR ITS CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 */

/**
 * The virtualized collection sender abstraction.
 *
 * @author Kyle Jamieson
 * @author Philip Levis
 * @date April 25 2006
 * @see TinyOS Net2-WG
 */

#include "Collection.h"
#include "Ctp.h"

generic configuration CtpSenderC(collection_id_t collectid) {
  provides {
    interface Send;
    interface Packet;
  }
}

implementation {
  components new CtpSenderP(collectid, unique(UQ_CTP_CLIENT));
  Send = CtpSenderP;
  Packet = CtpSenderP;
}

--- NEW FILE: CtpSenderP.nc ---
/* $Id: CtpSenderP.nc,v 1.1.2.1 2006/08/29 17:24:41 kasj78 Exp $ */
/*
 * Copyright (c) 2006 Massachusetts Institute of Technology (MIT).
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * - Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 * - Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the
 *   distribution.
 * - Neither the name of the Massachusetts Institute of Technology nor
 *   the names of its contributors may be used to endorse or promote
 *   products derived from this software without specific prior written
 *   permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
 * MASSACHUSETTS INSITIUTE OF TECHNOLOGY OR ITS CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 */

#include "Collection.h"

generic configuration CtpSenderP(collection_id_t collectid, uint8_t clientid) {
  provides {
    interface Send;
    interface Packet;
  }
}

implementation {
  components CtpC as Collector;
  components new CollectionIdP(collectid);
  
  Send = Collector.Send[clientid];
  Packet = Collector.Packet;
  Collector.CollectionId[clientid] -> CollectionIdP;
}

--- NEW FILE: TreeRouting.h ---
#ifndef _TREE_ROUTING_H
#define _TREE_ROUTING_H

enum {
    AM_TREE_ROUTING_CONTROL = 0xCE,
    BEACON_INTERVAL = 8192, 
    INVALID_ADDR  = TOS_BCAST_ADDR,
    ETX_THRESHOLD = 50,      // link quality=20% -> ETX=5 -> Metric=50 
    PARENT_SWITCH_THRESHOLD = 15,
    MAX_METRIC = 0xFFFF,
}; 
 

typedef struct {
    am_addr_t parent;
    uint8_t hopcount;
    uint16_t metric;
} route_info_t;

typedef struct {
    am_addr_t neighbor;
    route_info_t info;
} routing_table_entry;

inline void routeInfoInit(route_info_t *ri) {
    ri->parent = INVALID_ADDR;
    ri->hopcount = 0;
    ri->metric = 0;
}

typedef nx_struct beacon_msg_t {
    nx_am_addr_t parent;
    nx_uint8_t hopcount;
    nx_uint16_t metric;
} beacon_msg_t;

#endif

Index: Collection.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/ctp/Attic/Collection.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** Collection.h	24 Aug 2006 20:04:23 -0000	1.1.2.1
--- Collection.h	29 Aug 2006 17:24:40 -0000	1.1.2.2
***************
*** 29,33 ****
--- 29,42 ----
  #define COLLECTION_H
  
+ enum {
+     AM_COLLECTION_DATA = 20,
+     AM_COLLECTION_CONTROL = 21,
+     AM_COLLECTION_DEBUG = 22,
+ };
+ 
  typedef uint8_t collection_id_t;
+ typedef nx_uint8_t nx_collection_id_t;
+ 
+ #define UQ_COLLECTION_ID "CollectionSenderC.CollectId"
  
  #endif

--- CollectionSenderC.nc DELETED ---

--- CollectionSenderP.nc DELETED ---



More information about the Tinyos-2-commits mailing list