bugfix server client demo
This commit is contained in:
parent
da39da39dc
commit
337be76b26
|
@ -741,11 +741,13 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr,
|
||||||
|
|
||||||
watchdog_periodic();
|
watchdog_periodic();
|
||||||
|
|
||||||
|
#if WITH_PHASE_OPTIMIZATION
|
||||||
if(!is_broadcast && (is_receiver_awake || is_known_receiver) &&
|
if(!is_broadcast && (is_receiver_awake || is_known_receiver) &&
|
||||||
!RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + MAX_PHASE_STROBE_TIME)) {
|
!RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + MAX_PHASE_STROBE_TIME)) {
|
||||||
PRINTF("miss to %d\n", packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[0]);
|
PRINTF("miss to %d\n", packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif /* WITH_PHASE_OPTIMIZATION */
|
||||||
|
|
||||||
len = 0;
|
len = 0;
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ typedef unsigned short uip_stats_t;
|
||||||
/* 25 bytes per UDP connection */
|
/* 25 bytes per UDP connection */
|
||||||
#define UIP_CONF_UDP_CONNS 10
|
#define UIP_CONF_UDP_CONNS 10
|
||||||
/* See uip-ds6.h */
|
/* 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_DEFRT_NBU 2
|
||||||
#define UIP_CONF_DS6_PREFIX_NBU 3
|
#define UIP_CONF_DS6_PREFIX_NBU 3
|
||||||
#define UIP_CONF_MAX_ROUTES 20
|
#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 */
|
/* So without the header this needed for RPL mesh to form */
|
||||||
#define CONTIKIMAC_CONF_SHORTEST_PACKET_SIZE 43-18 //multicast RPL DIS length
|
#define CONTIKIMAC_CONF_SHORTEST_PACKET_SIZE 43-18 //multicast RPL DIS length
|
||||||
/* Not tested much yet */
|
/* Not tested much yet */
|
||||||
#define WITH_PHASE_OPTIMIZATION 0
|
#define CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION 0
|
||||||
#define CONTIKIMAC_CONF_COMPOWER 1
|
#define CONTIKIMAC_CONF_COMPOWER 1
|
||||||
#define RIMESTATS_CONF_ENABLED 1
|
#define RIMESTATS_CONF_ENABLED 1
|
||||||
#define NETSTACK_CONF_FRAMER framer_802154
|
#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_CONNECTIONS 2
|
||||||
#define UIP_CONF_MAX_LISTENPORTS 4
|
#define UIP_CONF_MAX_LISTENPORTS 4
|
||||||
#define UIP_CONF_UDP_CONNS 5
|
#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_DEFRT_NBU 2
|
||||||
#define UIP_CONF_DS6_PREFIX_NBU 3
|
#define UIP_CONF_DS6_PREFIX_NBU 3
|
||||||
#define UIP_CONF_MAX_ROUTES 4
|
#define UIP_CONF_MAX_ROUTES 4
|
||||||
|
|
|
@ -436,6 +436,9 @@ ipaddr_add(const uip_ipaddr_t *addr)
|
||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
|
#if UIP_CONF_IPV6
|
||||||
|
uip_ds6_nbr_t *nbr;
|
||||||
|
#endif /* UIP_CONF_IPV6 */
|
||||||
initialize();
|
initialize();
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
@ -533,11 +536,9 @@ if ((clocktime%PINGS)==1) {
|
||||||
#if ROUTES && UIP_CONF_IPV6
|
#if ROUTES && UIP_CONF_IPV6
|
||||||
if ((clocktime%ROUTES)==2) {
|
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;
|
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);
|
PRINTF("\nAddresses [%u max]\n",UIP_DS6_ADDR_NB);
|
||||||
for (i=0;i<UIP_DS6_ADDR_NB;i++) {
|
for (i=0;i<UIP_DS6_ADDR_NB;i++) {
|
||||||
if (uip_ds6_if.addr_list[i].isused) {
|
if (uip_ds6_if.addr_list[i].isused) {
|
||||||
|
@ -545,35 +546,35 @@ extern uip_ds6_netif_t uip_ds6_if;
|
||||||
PRINTF("\n");
|
PRINTF("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PRINTF("\nNeighbors [%u max]\n",UIP_DS6_NBR_NB);
|
|
||||||
for(i = 0,j=1; i < UIP_DS6_NBR_NB; i++) {
|
PRINTF("\nNeighbors [%u max]\n",NBR_TABLE_MAX_NEIGHBORS);
|
||||||
if(uip_ds6_nbr_cache[i].isused) {
|
|
||||||
ipaddr_add(&uip_ds6_nbr_cache[i].ipaddr);
|
for(nbr = nbr_table_head(ds6_neighbors);
|
||||||
|
nbr != NULL;
|
||||||
|
nbr = nbr_table_next(ds6_neighbors, nbr)) {
|
||||||
|
ipaddr_add(&nbr->ipaddr);
|
||||||
PRINTF("\n");
|
PRINTF("\n");
|
||||||
j=0;
|
j=0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (j) PRINTF(" <none>");
|
if (j) PRINTF(" <none>");
|
||||||
PRINTF("\nRoutes [%u max]\n",UIP_DS6_ROUTE_NB);
|
PRINTF("\nRoutes [%u max]\n",UIP_DS6_ROUTE_NB);
|
||||||
{
|
{
|
||||||
uip_ds6_route_t *r;
|
uip_ds6_route_t *r;
|
||||||
j = 1;
|
j = 1;
|
||||||
for(r = uip_ds6_route_list_head();
|
for(r = uip_ds6_route_head();
|
||||||
r != NULL;
|
r != NULL;
|
||||||
r = list_item_next(r)) {
|
r = uip_ds6_route_next(r)) {
|
||||||
ipaddr_add(&r->ipaddr);
|
ipaddr_add(&r->ipaddr);
|
||||||
PRINTF("/%u (via ", r->length);
|
PRINTF("/%u (via ", r->length);
|
||||||
ipaddr_add(&r->nexthop);
|
ipaddr_add(uip_ds6_route_nexthop(r));
|
||||||
// if(uip_ds6_routing_table[i].state.lifetime < 600) {
|
|
||||||
PRINTF(") %lus\n", r->state.lifetime);
|
PRINTF(") %lus\n", r->state.lifetime);
|
||||||
// } else {
|
|
||||||
// PRINTF(")\n");
|
|
||||||
// }
|
|
||||||
j = 0;
|
j = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (j) PRINTF(" <none>");
|
if (j) PRINTF(" <none>");
|
||||||
PRINTF("\n---------\n");
|
PRINTF("\n---------\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@
|
||||||
void
|
void
|
||||||
led1_on(void)
|
led1_on(void)
|
||||||
{
|
{
|
||||||
DDRE |= (1<<PINE5);
|
|
||||||
PORTE &= ~(1<<PINE5);
|
PORTE &= ~(1<<PINE5);
|
||||||
|
DDRE |= (1<<PINE5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -64,15 +64,15 @@ led1_on(void)
|
||||||
void
|
void
|
||||||
led1_off(void)
|
led1_off(void)
|
||||||
{
|
{
|
||||||
DDRE |= (1<<PINE5);
|
|
||||||
PORTE |= (1<<PINE5);
|
PORTE |= (1<<PINE5);
|
||||||
|
DDRE |= (1<<PINE5);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
led2_on(void)
|
led2_on(void)
|
||||||
{
|
{
|
||||||
DDRE |= (1<<PINE4);
|
|
||||||
PORTE &= ~(1<<PINE4);
|
PORTE &= ~(1<<PINE4);
|
||||||
|
DDRE |= (1<<PINE4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -83,7 +83,7 @@ led2_on(void)
|
||||||
void
|
void
|
||||||
led2_off(void)
|
led2_off(void)
|
||||||
{
|
{
|
||||||
DDRE |= (1<<PINE4);
|
|
||||||
PORTE |= (1<<PINE4);
|
PORTE |= (1<<PINE4);
|
||||||
|
DDRE |= (1<<PINE4);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in a new issue