bugfix server client demo

This commit is contained in:
harald42 2013-11-28 09:43:59 +01:00 committed by harald
parent da39da39dc
commit 337be76b26
4 changed files with 27 additions and 24 deletions

View file

@ -741,11 +741,13 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
watchdog_periodic();
#if WITH_PHASE_OPTIMIZATION
if(!is_broadcast && (is_receiver_awake || is_known_receiver) &&
!RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + MAX_PHASE_STROBE_TIME)) {
PRINTF("miss to %d\n", packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[0]);
break;
}
#endif /* WITH_PHASE_OPTIMIZATION */
len = 0;

View file

@ -222,7 +222,7 @@ typedef unsigned short uip_stats_t;
/* 25 bytes per UDP connection */
#define UIP_CONF_UDP_CONNS 10
/* See uip-ds6.h */
#define UIP_CONF_DS6_NBR_NBU 20
#define NBR_TABLE_CONF_MAX_NEIGHBORS 20
#define UIP_CONF_DS6_DEFRT_NBU 2
#define UIP_CONF_DS6_PREFIX_NBU 3
#define UIP_CONF_MAX_ROUTES 20
@ -243,7 +243,7 @@ typedef unsigned short uip_stats_t;
/* So without the header this needed for RPL mesh to form */
#define CONTIKIMAC_CONF_SHORTEST_PACKET_SIZE 43-18 //multicast RPL DIS length
/* Not tested much yet */
#define WITH_PHASE_OPTIMIZATION 0
#define CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION 0
#define CONTIKIMAC_CONF_COMPOWER 1
#define RIMESTATS_CONF_ENABLED 1
#define NETSTACK_CONF_FRAMER framer_802154
@ -266,7 +266,7 @@ typedef unsigned short uip_stats_t;
#define UIP_CONF_MAX_CONNECTIONS 2
#define UIP_CONF_MAX_LISTENPORTS 4
#define UIP_CONF_UDP_CONNS 5
#define UIP_CONF_DS6_NBR_NBU 20
#define NBR_TABLE_CONF_MAX_NEIGHBORS 20
#define UIP_CONF_DS6_DEFRT_NBU 2
#define UIP_CONF_DS6_PREFIX_NBU 3
#define UIP_CONF_MAX_ROUTES 4

View file

@ -436,6 +436,9 @@ ipaddr_add(const uip_ipaddr_t *addr)
int
main(void)
{
#if UIP_CONF_IPV6
uip_ds6_nbr_t *nbr;
#endif /* UIP_CONF_IPV6 */
initialize();
while(1) {
@ -533,11 +536,9 @@ if ((clocktime%PINGS)==1) {
#if ROUTES && UIP_CONF_IPV6
if ((clocktime%ROUTES)==2) {
extern uip_ds6_nbr_t uip_ds6_nbr_cache[];
extern uip_ds6_route_t uip_ds6_routing_table[];
extern uip_ds6_netif_t uip_ds6_if;
uint8_t i,j;
uint8_t i,j=0;
PRINTF("\nAddresses [%u max]\n",UIP_DS6_ADDR_NB);
for (i=0;i<UIP_DS6_ADDR_NB;i++) {
if (uip_ds6_if.addr_list[i].isused) {
@ -545,35 +546,35 @@ extern uip_ds6_netif_t uip_ds6_if;
PRINTF("\n");
}
}
PRINTF("\nNeighbors [%u max]\n",UIP_DS6_NBR_NB);
for(i = 0,j=1; i < UIP_DS6_NBR_NB; i++) {
if(uip_ds6_nbr_cache[i].isused) {
ipaddr_add(&uip_ds6_nbr_cache[i].ipaddr);
PRINTF("\n");
j=0;
}
PRINTF("\nNeighbors [%u max]\n",NBR_TABLE_MAX_NEIGHBORS);
for(nbr = nbr_table_head(ds6_neighbors);
nbr != NULL;
nbr = nbr_table_next(ds6_neighbors, nbr)) {
ipaddr_add(&nbr->ipaddr);
PRINTF("\n");
j=0;
}
if (j) PRINTF(" <none>");
PRINTF("\nRoutes [%u max]\n",UIP_DS6_ROUTE_NB);
{
uip_ds6_route_t *r;
j = 1;
for(r = uip_ds6_route_list_head();
for(r = uip_ds6_route_head();
r != NULL;
r = list_item_next(r)) {
r = uip_ds6_route_next(r)) {
ipaddr_add(&r->ipaddr);
PRINTF("/%u (via ", r->length);
ipaddr_add(&r->nexthop);
// if(uip_ds6_routing_table[i].state.lifetime < 600) {
ipaddr_add(uip_ds6_route_nexthop(r));
PRINTF(") %lus\n", r->state.lifetime);
// } else {
// PRINTF(")\n");
// }
j = 0;
}
}
if (j) PRINTF(" <none>");
PRINTF("\n---------\n");
}
#endif

View file

@ -52,8 +52,8 @@
void
led1_on(void)
{
DDRE |= (1<<PINE5);
PORTE &= ~(1<<PINE5);
DDRE |= (1<<PINE5);
}
/*---------------------------------------------------------------------------*/
@ -64,15 +64,15 @@ led1_on(void)
void
led1_off(void)
{
DDRE |= (1<<PINE5);
PORTE |= (1<<PINE5);
DDRE |= (1<<PINE5);
}
/*---------------------------------------------------------------------------*/
void
led2_on(void)
{
DDRE |= (1<<PINE4);
PORTE &= ~(1<<PINE4);
DDRE |= (1<<PINE4);
}
/*---------------------------------------------------------------------------*/
@ -83,7 +83,7 @@ led2_on(void)
void
led2_off(void)
{
DDRE |= (1<<PINE4);
PORTE |= (1<<PINE4);
DDRE |= (1<<PINE4);
}
/*---------------------------------------------------------------------------*/