From 4eee7b8bf417167481d1bea485529eb22eae0eaa Mon Sep 17 00:00:00 2001 From: bg- Date: Wed, 2 Aug 2006 14:33:36 +0000 Subject: [PATCH] Slightly outdated versions were imported to sf. --- apps/codeprop/tcp_loader.c | 4 ++-- core/dev/cc2420.c | 12 ++---------- core/dev/cc2420.h | 12 +++++++++++- tools/codeprop.c | 9 ++------- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/apps/codeprop/tcp_loader.c b/apps/codeprop/tcp_loader.c index c8d299200..be81743f8 100644 --- a/apps/codeprop/tcp_loader.c +++ b/apps/codeprop/tcp_loader.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: tcp_loader.c,v 1.1 2006/06/18 07:44:36 adamdunkels Exp $ + * @(#)$Id: tcp_loader.c,v 1.2 2006/08/02 14:33:37 bg- Exp $ */ #include @@ -75,7 +75,7 @@ PT_THREAD(recv_tcpthread(struct pt *pt)) uip_appdata += sizeof(struct codeprop_tcphdr); uip_len -= sizeof(struct codeprop_tcphdr); - xmem_erase(s.len, EEPROMFS_ADDR_CODEPROP); + xmem_erase(XMEM_ERASE_UNIT_SIZE, EEPROMFS_ADDR_CODEPROP); /* Read the rest of the data. */ do { diff --git a/core/dev/cc2420.c b/core/dev/cc2420.c index 9145d8e25..fe27c0bf3 100644 --- a/core/dev/cc2420.c +++ b/core/dev/cc2420.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: cc2420.c,v 1.1 2006/06/17 22:41:16 adamdunkels Exp $ + * @(#)$Id: cc2420.c,v 1.2 2006/08/02 14:33:36 bg- Exp $ */ /* * This code is almost device independent and should be possible to @@ -566,15 +566,7 @@ PROCESS_THREAD(cc2420_retransmit_process, ev, data) #define MAX_EXPIRE 15 #define AGE_INTERVAL 5 /* 20 seconds */ -struct cc2420_neigbour { - unsigned mac:16, nretrans:4, expire:4; /* expiration time */ -#if 0 - unsigned rssi:6, correlation:6; -#endif -}; - -#define NNEIGBOURS 16 -static struct cc2420_neigbour neigbours[NNEIGBOURS]; +struct cc2420_neigbour neigbours[NNEIGBOURS]; /* * Double hash into 3 different positions using a constand step. If we diff --git a/core/dev/cc2420.h b/core/dev/cc2420.h index 3031dbd19..024355afe 100644 --- a/core/dev/cc2420.h +++ b/core/dev/cc2420.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: cc2420.h,v 1.1 2006/06/17 22:41:16 adamdunkels Exp $ + * @(#)$Id: cc2420.h,v 1.2 2006/08/02 14:33:37 bg- Exp $ */ #ifndef CC2420_H @@ -94,6 +94,16 @@ struct hdr_802_15_ack { /* no more */ }; +struct cc2420_neigbour { + unsigned mac:16, nretrans:4, expire:4; /* expiration time */ +#if 0 + unsigned rssi:6, correlation:6; +#endif +}; + +#define NNEIGBOURS 16 +extern struct cc2420_neigbour neigbours[NNEIGBOURS]; + PROCESS_NAME(cc2420_process); extern struct uip_fw_netif cc2420if; diff --git a/tools/codeprop.c b/tools/codeprop.c index aa6905fa9..ff4d8208c 100644 --- a/tools/codeprop.c +++ b/tools/codeprop.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: codeprop.c,v 1.1 2006/06/18 08:16:12 adamdunkels Exp $ + * @(#)$Id: codeprop.c,v 1.2 2006/08/02 14:33:37 bg- Exp $ */ #include #include @@ -92,7 +92,7 @@ main(int argc, char **argv) { } - { + while(1) { char buf[64000]; int len; @@ -116,17 +116,12 @@ main(int argc, char **argv) { exit(0); } total += len; - buf[0] = len >> 8; buf[1] = len & 0xff; if(write(s, buf, len + 2) == -1) { perror("network send failed"); exit(1); } - printf("File sent\n"); - len = read(s, buf, sizeof(buf)); - buf[len] = 0; - printf("%s", buf); } return 0;