X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fnet%2FDeluge%2FDelugePageTransfer.h;h=1edc880a204476238537da55543c50017d9a0996;hb=11c90104bc30d39dd70605809fd4a36f3f7bae6d;hp=44455b56a7382a81dd34f4ebe509734462a4735a;hpb=1275ad8c5c9368b541e7eeccfeb6bf20352e6330;p=tinyos-2.x.git diff --git a/tos/lib/net/Deluge/DelugePageTransfer.h b/tos/lib/net/Deluge/DelugePageTransfer.h index 44455b56..1edc880a 100644 --- a/tos/lib/net/Deluge/DelugePageTransfer.h +++ b/tos/lib/net/Deluge/DelugePageTransfer.h @@ -1,17 +1,17 @@ /* - * "Copyright (c) 2000-2004 The Regents of the University of California. + * "Copyright (c) 2000-2004 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 @@ -33,7 +33,7 @@ #if defined(PLATFORM_TELOSB) #include "extra/telosb/TOSBoot_platform.h" -#elif defined(PLATFORM_MICAZ) +#elif defined(PLATFORM_MICAZ) || defined(PLATFORM_IRIS) #include "extra/micaz/TOSBoot_platform.h" #else #error "Target platform is not currently supported by Deluge T2" @@ -53,10 +53,15 @@ typedef uint8_t page_num_t; typedef nx_uint8_t nx_page_num_t; enum { - DELUGE_PKT_PAYLOAD_SIZE = TOSH_DATA_LENGTH - sizeof(nx_object_id_t) - sizeof(nx_page_num_t) - sizeof(nx_uint8_t), - DELUGE_BYTES_PER_PAGE = 1024, - DELUGE_PKTS_PER_PAGE = ((DELUGE_BYTES_PER_PAGE - 1) / DELUGE_PKT_PAYLOAD_SIZE) + 1, - + DELUGET2_PKT_PAYLOAD_SIZE = TOSH_DATA_LENGTH - sizeof(nx_object_id_t) - sizeof(nx_page_num_t) - sizeof(nx_uint8_t), + DELUGET2_BYTES_PER_PAGE = 1024, + DELUGET2_PKTS_PER_PAGE = ((DELUGET2_BYTES_PER_PAGE - 1) / DELUGET2_PKT_PAYLOAD_SIZE) + 1, + DELUGET2_PKT_BITVEC_SIZE = (((DELUGET2_PKTS_PER_PAGE - 1) / 8) + 1), + + DELUGE_PKT_PAYLOAD_SIZE = 23, + DELUGE_PKTS_PER_PAGE = 48, + DELUGE_BYTES_PER_PAGE = (DELUGE_PKTS_PER_PAGE*DELUGE_PKT_PAYLOAD_SIZE), + DELUGE_VERSION = 2, DELUGE_MAX_ADV_PERIOD_LOG2 = 22, DELUGE_NUM_NEWDATA_ADVS_REQUIRED = 2, @@ -65,12 +70,12 @@ enum { DELUGE_REBOOT_DELAY = 4, DELUGE_FAILED_SEND_DELAY = 16, DELUGE_MIN_DELAY = 16, - DELUGE_DATA_OFFSET = 128, +// DELUGE_DATA_OFFSET = 128, DELUGE_IDENT_SIZE = 128, DELUGE_INVALID_ADDR = (0x7fffffffL), + DELUGE_MIN_ADV_PERIOD_LOG2 = 9, DELUGE_MAX_REQ_DELAY = (0x1L << (DELUGE_MIN_ADV_PERIOD_LOG2 - 1)), DELUGE_NACK_TIMEOUT = (DELUGE_MAX_REQ_DELAY >> 0x1), - DELUGE_PKT_BITVEC_SIZE = (((DELUGE_PKTS_PER_PAGE - 1) / 8) + 1), DELUGE_MAX_IMAGE_SIZE = (128L * 1024L), DELUGE_MAX_PAGES = 128, DELUGE_CRC_SIZE = sizeof(uint16_t), @@ -79,6 +84,7 @@ enum { DELUGE_INVALID_OBJID = 0xff, DELUGE_INVALID_PKTNUM = 0xff, DELUGE_INVALID_PGNUM = 0xff, + DELUGE_QSIZE = 2 }; typedef struct DelugeAdvTimer {