diff --git a/RIOT/examples/dynamic_app/main.c b/RIOT/examples/dynamic_app/main.c index c085164..630d063 100755 --- a/RIOT/examples/dynamic_app/main.c +++ b/RIOT/examples/dynamic_app/main.c @@ -25,6 +25,7 @@ #include #include +#include "periph/gpio.h" #include "../../boards/stm32f4discovery/include/board.h" #include "../../boards/stm32f4discovery/include/periph_conf.h" #include "net/sock/udp.h" @@ -83,9 +84,9 @@ #define _STACKSIZE (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF) #define MSG_TYPE_ISR (0x3456) -#define PWM_FREQ 100 -#define PWM_RES 100 -#define DEADLINE 24000 +#define PWM_FREQ 1000 +#define PWM_RES 1000 +#define DEADLINE 15000 static msg_t _main_msg_queue[MAIN_QUEUE_SIZE]; @@ -125,11 +126,11 @@ sock_udp_ep_t local = SOCK_IPV6_EP_ANY; sock_udp_t sock; sock_udp_ep_t local_ntp = SOCK_IPV6_EP_ANY; sock_udp_t sock_ntp; -//static ntp_packet_t sntp_packet; +static ntp_packet_t sntp_packet; typedef struct tableau { - uint32_t heure_actuelle; - char donnees[2]; + uint32_t heure_actuelle; + char donnees[2]; }Data; /***************** RPL functions *****************/ @@ -138,143 +139,143 @@ int crea_rpl_dodag_root(char *arg1, char *arg2) { uint8_t instance_id = (uint8_t) atoi(arg1); ipv6_addr_t dodag_id; - + if (ipv6_addr_from_str(&dodag_id, arg2) == NULL) { puts("error: must be a valid IPv6 address"); return 1; } - + gnrc_rpl_instance_t *inst = NULL; inst = gnrc_rpl_root_init(instance_id, &dodag_id, false, false); if (inst == NULL) { char addr_str[IPV6_ADDR_MAX_STR_LEN]; printf("error: could not add DODAG (%s) to instance (%d)\n", - ipv6_addr_to_str(addr_str, &dodag_id, sizeof(addr_str)), instance_id); + ipv6_addr_to_str(addr_str, &dodag_id, sizeof(addr_str)), instance_id); return 1; } - + printf("successfully added a new RPL DODAG\n"); return 0; } -int _gnrc_rpl_send_dis(void) -{ - gnrc_rpl_send_DIS(NULL, (ipv6_addr_t *) &ipv6_addr_all_rpl_nodes); - - puts("success: send a DIS\n"); - return 0; -} - /***************** /RPL functions ****************/ -/*void *sock_time_server_thread(void *arg) +void *sock_time_server_thread(void *arg) { (void) arg; local_ntp.port = NTP_PORT; - + if (sock_udp_create(&sock_ntp, &local_ntp, NULL, 0) < 0) { - puts("Error creating UDP sock"); - return NULL; - } - - while (1) { - sock_udp_ep_t remote; - ssize_t res; - - if ((res = sock_udp_recv(&sock_ntp,&sntp_packet, sizeof(sntp_packet), SOCK_NO_TIMEOUT, - &remote)) >= 0) { - puts("Received a message"); - //printf("TT: %lu\n", byteorder_ntohl(sntp_packet.transmit.seconds)); - - // printf("%c\n",remote.addr.ipv6[15]); - //xtimer_ticks64_t now = xtimer_now64(); - // heure actuelle du serveur - sntp_packet.receive.seconds=byteorder_htonl( xtimer_now_usec()); - sntp_packet.origin.seconds=sntp_packet.transmit.seconds; - sntp_packet.transmit.seconds=byteorder_htonl( xtimer_now_usec()); - //printf("heure actuelle : %lu\n",xtimer_now_usec()); - //printf("TT2: %lu\n", byteorder_ntohl(sntp_packet.transmit.seconds)); - //memset(&sntp_packet, 0, sizeof(sntp_packet)); - //ntp_packet_set_vn(&sntp_packet); - //ntp_packet_set_mode(&sntp_packet, NTP_MODE_SERVER); - if (sock_udp_send(&sock_ntp, &sntp_packet, sizeof(sntp_packet), &remote) < 0) { - puts("Error sending reply"); - } - } - } + puts("Error creating UDP sock"); + return NULL; + } + + while (1) { + sock_udp_ep_t remote; + ssize_t res; + + if ((res = sock_udp_recv(&sock_ntp,&sntp_packet, sizeof(sntp_packet), SOCK_NO_TIMEOUT, + &remote)) >= 0) { + puts("Received a message"); + //printf("TT: %lu\n", byteorder_ntohl(sntp_packet.transmit.seconds)); + + // printf("%c\n",remote.addr.ipv6[15]); + //xtimer_ticks64_t now = xtimer_now64(); + // heure actuelle du serveur + sntp_packet.receive.seconds=byteorder_htonl( xtimer_now_usec()); + sntp_packet.origin.seconds=sntp_packet.transmit.seconds; + sntp_packet.transmit.seconds=byteorder_htonl( xtimer_now_usec()); + //printf("heure actuelle : %lu\n",xtimer_now_usec()); + //printf("TT2: %lu\n", byteorder_ntohl(sntp_packet.transmit.seconds)); + //memset(&sntp_packet, 0, sizeof(sntp_packet)); + //ntp_packet_set_vn(&sntp_packet); + //ntp_packet_set_mode(&sntp_packet, NTP_MODE_SERVER); + if (sock_udp_send(&sock_ntp, &sntp_packet, sizeof(sntp_packet), &remote) < 0) { + puts("Error sending reply"); + } + } + } return NULL; -}*/ +} void *sock_server_thread(void *arg) { (void) arg; Data buf; - // int compteur = 5; - // int deadline; + int compteur = 5; + int deadline; local.port = 1234; sock_udp_ep_t server = { .port = NTP_PORT, .family = AF_INET6 }; ipv6_addr_from_str((ipv6_addr_t *)&server.addr, "dead:beef::3402"); if (sock_udp_create(&sock, &local, NULL, 0) < 0) { - puts("Error creating UDP sock"); - return NULL; + puts("Error creating UDP sock"); + return NULL; + } + if (sntp_sync(&server, SOCK_NO_TIMEOUT) < 0) { + puts("Error in synchronization"); } - /*if (sntp_sync(&server, SOCK_NO_TIMEOUT) < 0) { - puts("Error in synchronization"); - return NULL; - } - offset = sntp_get_offset(); - printf("offset : %i\n",(int)offset);*/ + offset = sntp_get_offset(); + printf("offset : %i\n",(int)offset); while (1) { - sock_udp_ep_t remote; - ssize_t res; - - if ((res = sock_udp_recv(&sock, &buf, sizeof(buf), SOCK_NO_TIMEOUT, - &remote)) >= 0) { - puts("Received a message"); - //printf("%s\n",buf); - /*if (sock_udp_send(&sock, buf, res, &remote) < 0) { - puts("Error sending reply"); - }*/ - - /*deadline = xtimer_now_usec() + offset - buf.heure_actuelle; - printf("tps de transmission : %i\n",deadline); - - if(deadline >= DEADLINE && compteur >=5) - { - //ordre = 2; - compteur = 0; - if(tourne == 1) - pwm_set(PWM_DEV(0),1,31); - if(timer_run == 0) - { - timer_set(TIMER_DEV(1),0,25200); - printf("relance timer\n"); - timer_run = 1; - } - } - if(deadline >= DEADLINE && compteur < 5) - { - compteur = 0; - } - if(deadline<=DEADLINE && compteur >=5) - { - //ordre = 1; - pwm_set(PWM_DEV(0),1,45); - tourne = 1; - timer_run=0; - timer_clear(TIMER_DEV(1),0); - printf("clear timer\n"); - } - if(deadline<=DEADLINE && compteur <5) - { - compteur++; - } - - printf("compteur : %d\n",compteur); - memset(&buf,0,sizeof(buf));*/ - } + sock_udp_ep_t remote; + ssize_t res; + if ((res = sock_udp_recv(&sock, &buf, sizeof(buf), 5 * SEC_IN_USEC,&remote)) >= 0) { + deadline = xtimer_now_usec() + offset - buf.heure_actuelle; + printf("tps de transmission : %i\n",deadline); + + if(buf.donnees[0] == 'g' && buf.donnees[1] == 'o') { + if(deadline >= DEADLINE && compteur >=5) { + compteur = 0; + if(tourne == 1){ + pwm_set(PWM_DEV(0),1,987); + pwm_set(PWM_DEV(1),1,960); + } + if(timer_run == 0) { + if (sock_udp_send(&sock, "d", sizeof("d"), &remote) < 0) { + puts("Error sending reply"); + } + gpio_clear(LED1_PIN); + gpio_clear(LED2_PIN); + gpio_set(LED0_PIN); + timer_set(TIMER_DEV(1),0,25200); + printf("relance timer\n"); + if (sntp_sync(&server, SOCK_NO_TIMEOUT) < 0) { + puts("Error in synchronization"); + return NULL; + } + offset = sntp_get_offset(); + printf("offset : %i\n",(int)offset); + timer_run = 1; + } + } + if(deadline >= DEADLINE && compteur < 5) { + compteur = 0; + } + if(deadline<=DEADLINE && compteur >=5) { + pwm_set(PWM_DEV(0),1,992); + pwm_set(PWM_DEV(1),1,658); + tourne = 1; + timer_run=0; + timer_clear(TIMER_DEV(1),0); + printf("clear timer\n"); + if (sock_udp_send(&sock, "n", sizeof("n"), &remote) < 0) { + puts("Error sending reply"); + } + gpio_clear(LED2_PIN); + gpio_clear(LED0_PIN); + gpio_set(LED1_PIN); + } + if(deadline<=DEADLINE && compteur <5) { + compteur++; + } + printf("compteur : %d\n",compteur); + memset(&buf,0,sizeof(buf)); + } + }else{ + puts("msg non recu"); + } } return NULL; } @@ -282,53 +283,83 @@ void *sock_server_thread(void *arg) void *sock_client_thread(void *arg) { - (void) arg; - Data data; - data.donnees[0] = 'g'; - data.donnees[1] = 'o'; - //uint8_t paquet[]; - sock_udp_ep_t remote = { .family = AF_INET6 }; - - remote.port = 1234; - remote.addr.ipv6[0] = 0xde; - remote.addr.ipv6[1] = 0xad; - remote.addr.ipv6[2] = 0xbe; - remote.addr.ipv6[3] = 0xef; - remote.addr.ipv6[14] = 0x34; - remote.addr.ipv6[15] = 0x1e; -// memcpy(remote.addr.ipv6,addr.u8,IPV6_ADDR_BIT_LEN); - while (1) { -// //ipv6_addr_set_all_nodes_multicast((ipv6_addr_t *)&remote.addr.ipv6, -// // IPV6_ADDR_MCAST_SCP_LINK_LOCAL); - data.heure_actuelle = xtimer_now_usec(); - - if (sock_udp_send(NULL, &data, sizeof(data), &remote) < 0) { - puts("Error sending message"); - } - puts("Send a message"); - xtimer_sleep(2); - } - return NULL; + (void) arg; + Data data; + int vitesse=2; + uint8_t buf[3]; + ssize_t res; + data.donnees[0] = 'g'; + data.donnees[1] = 'o'; + //uint8_t paquet[]; + sock_udp_ep_t remote = { .family = AF_INET6 }; + + remote.port = 1234; + remote.addr.ipv6[0] = 0xde; + remote.addr.ipv6[1] = 0xad; + remote.addr.ipv6[2] = 0xbe; + remote.addr.ipv6[3] = 0xef; + remote.addr.ipv6[14] = 0x34; + remote.addr.ipv6[15] = 0x1e; + // memcpy(remote.addr.ipv6,addr.u8,IPV6_ADDR_BIT_LEN); + while (1) { + data.heure_actuelle = xtimer_now_usec(); + + if (sock_udp_send(&sock, &data, sizeof(data), &remote) < 0) { + puts("Error sending message"); + } + puts("Send a message"); + if(vitesse==2) { + gpio_clear(LED0_PIN); + gpio_toggle(LED1_PIN); + } + else { + gpio_clear(LED1_PIN); + gpio_toggle(LED0_PIN); + } + if ((res = sock_udp_recv(&sock, buf, sizeof(buf), 0.05 * SEC_IN_USEC,NULL)) < 0) { + if (res == -ETIMEDOUT) { + puts("Timed out"); + } + else { + puts("Error receiving message"); + } + } + else { + printf("Received message: \""); + for (int i = 0; i < res; i++) { + printf("%c", buf[i]); + } + if(buf[0] == 'n') + vitesse = 2; + else vitesse = 1; + printf("\"\n"); + } + xtimer_sleep(vitesse); + } + return NULL; } -/*static void arret_urgence(void *arg,int channel) +static void arret_urgence(void *arg,int channel) { - pwm_set(PWM_DEV(0),1,0); - tourne = 0; - //ordre=0; - timer_run = 0; - printf("Arret d'urgence\n"); -}*/ + pwm_set(PWM_DEV(0),1,0); + pwm_set(PWM_DEV(1),1,0); + tourne = 0; + timer_run = 0; + gpio_clear(LED0_PIN); + gpio_clear(LED1_PIN); + gpio_set(LED2_PIN); + printf("Arret d'urgence\n"); +} /*static void degradation(void *arg,int channel) -{ - ordre=2; - //pwm_set(PWM_DEV(0),1,0); - printf("Ralentissement\n"); - timer_set(TIMER_DEV(1),0,25200); -}*/ - -/*static void _init_timer(void) + * { + * ordre=2; + * //pwm_set(PWM_DEV(0),1,0); + * printf("Ralentissement\n"); + * timer_set(TIMER_DEV(1),0,25200); + * }*/ + +static void _init_timer(void) { printf("ok timer\n"); //timer_init(XTIMER_DEV, CLOCK_CORECLOCK/2 ,°radation,NULL); @@ -342,13 +373,14 @@ static void _init_pwm(void) { pwm_init(PWM_DEV(0), PWM_LEFT, PWM_FREQ, PWM_RES); pwm_set(PWM_DEV(0),1,0); - -// thread_create(pwm_stack,sizeof(pwm_stack),7,THREAD_CREATE_STACKTEST,pwm_thread,NULL,"pwm_thread"); + pwm_init(PWM_DEV(1), PWM_LEFT, PWM_FREQ, PWM_RES); + pwm_set(PWM_DEV(1),1,0); + + // thread_create(pwm_stack,sizeof(pwm_stack),7,THREAD_CREATE_STACKTEST,pwm_thread,NULL,"pwm_thread"); } -*/ - + static void _init_interface(void) { kernel_pid_t ifs[GNRC_NETIF_NUMOF]; @@ -358,43 +390,38 @@ static void _init_interface(void) int res; gnrc_netif_get(ifs); - + //addresses gobales addr.u8[0] = 0xde; addr.u8[1] = 0xad; addr.u8[2] = 0xbe; addr.u8[3] = 0xef; - + res = gnrc_netapi_get(ifs[0], NETOPT_ADDRESS, 0, hwaddr, sizeof(hwaddr)); - + if (res >= 0) { addr.u8[14] = *hwaddr; addr.u8[15] = *(hwaddr+1); } - //init RPL - //init_RPL(ifs[0]); - _gnrc_rpl_send_dis(); + memcpy(tmp_addr.u8,addr.u8,IPV6_ADDR_BIT_LEN); - + gnrc_ipv6_netif_add_addr(ifs[0], &addr, 64, GNRC_IPV6_NETIF_ADDR_FLAGS_UNICAST); /* model ipv6 addr: dead:beef::Hwaddr */ if((addr.u8[14]==0x34)&&(addr.u8[15]==0x02)){ crea_rpl_dodag_root("1", "dead:beef::3402"); - _gnrc_rpl_send_dis(); - client=thread_create(sock_client_stack,sizeof(sock_client_stack),8,THREAD_CREATE_STACKTEST,sock_client_thread,NULL,"sock_client_thread"); - // xtimer_usleep(200); - //time_server=thread_create(sock_time_server_stack,sizeof(sock_time_server_stack),6,THREAD_CREATE_STACKTEST,sock_time_server_thread,NULL,"sock_time_server_thread"); - // xtimer_usleep(200); + client=thread_create(sock_client_stack,sizeof(sock_client_stack),8,THREAD_CREATE_STACKTEST,sock_client_thread,NULL,"sock_client_thread"); + time_server=thread_create(sock_time_server_stack,sizeof(sock_time_server_stack),6,THREAD_CREATE_STACKTEST,sock_time_server_thread,NULL,"sock_time_server_thread"); }else if((addr.u8[14]==0x37)&&(addr.u8[15]==0x62)){ - + }else if((addr.u8[14]==0x34)&&(addr.u8[15]==0x12)){ - //_init_timer(); - //_init_pwm(); - /*server=thread_create(sock_server_stack,sizeof(sock_server_stack),6,THREAD_CREATE_STACKTEST,sock_server_thread,NULL,"sock_server_thread");*/ }else if((addr.u8[14]==0x34)&&(addr.u8[15]==0x0a)){ }else if((addr.u8[14]==0x34)&&(addr.u8[15]==0x1e)){ - server=thread_create(sock_server_stack,sizeof(sock_server_stack),6,THREAD_CREATE_STACKTEST,sock_server_thread,NULL,"sock_server_thread"); + _init_timer(); + _init_pwm(); + xtimer_sleep(2); + server=thread_create(sock_server_stack,sizeof(sock_server_stack),6,THREAD_CREATE_STACKTEST,sock_server_thread,NULL,"sock_server_thread"); }else{ puts("new node ?"); } @@ -403,9 +430,9 @@ static void _init_interface(void) int main(void) { - msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE); puts("RIOT network stack example application"); + _init_interface(); /* start shell */ diff --git a/RIOT/sys/include/net/gnrc/rpl.h b/RIOT/sys/include/net/gnrc/rpl.h index 997e194..27dac07 100755 --- a/RIOT/sys/include/net/gnrc/rpl.h +++ b/RIOT/sys/include/net/gnrc/rpl.h @@ -294,7 +294,7 @@ static inline bool GNRC_RPL_COUNTER_GREATER_THAN(uint8_t A, uint8_t B) * @{ */ #ifndef GNRC_RPL_DEFAULT_LIFETIME -#define GNRC_RPL_DEFAULT_LIFETIME (5) +#define GNRC_RPL_DEFAULT_LIFETIME (1) #endif #ifndef GNRC_RPL_LIFETIME_UNIT #define GNRC_RPL_LIFETIME_UNIT (60) diff --git a/RIOT/sys/include/net/gnrc/rpl/structs.h b/RIOT/sys/include/net/gnrc/rpl/structs.h index 2760236..45707bc 100755 --- a/RIOT/sys/include/net/gnrc/rpl/structs.h +++ b/RIOT/sys/include/net/gnrc/rpl/structs.h @@ -297,7 +297,7 @@ struct gnrc_rpl_instance { }; /*******************************************************************/ //ADDED BY PFE7 2017 -static uint8_t dodag_insert; +//uint8_t LED_flag_dodag; //\ADDED BY PFE7 2017 /*******************************************************************/ #ifdef __cplusplus diff --git a/RIOT/sys/net/gnrc/network_layer/icmpv6/echo/gnrc_icmpv6_echo.c b/RIOT/sys/net/gnrc/network_layer/icmpv6/echo/gnrc_icmpv6_echo.c index 0831414..7bca60d 100755 --- a/RIOT/sys/net/gnrc/network_layer/icmpv6/echo/gnrc_icmpv6_echo.c +++ b/RIOT/sys/net/gnrc/network_layer/icmpv6/echo/gnrc_icmpv6_echo.c @@ -20,7 +20,7 @@ #include "net/gnrc/ipv6/hdr.h" #include "utlist.h" -#define ENABLE_DEBUG (1) +#define ENABLE_DEBUG (0) #include "debug.h" #if ENABLE_DEBUG diff --git a/RIOT/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c b/RIOT/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c index 38d8c43..3027059 100755 --- a/RIOT/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c +++ b/RIOT/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c @@ -906,7 +906,7 @@ static void _receive(gnrc_pktsnip_t *pkt) #ifdef MODULE_GNRC_IPV6_ROUTER /* only routers redirect */ /* redirect to next hop */ - printf("ipv6: decrement hop limit to %u\n", (uint8_t) (hdr->hl - 1)); + DEBUG("ipv6: decrement hop limit to %u\n", (uint8_t) (hdr->hl - 1)); /* RFC 4291, section 2.5.6 states: "Routers must not forward any * packets with Link-Local source or destination addresses to other @@ -923,7 +923,7 @@ static void _receive(gnrc_pktsnip_t *pkt) gnrc_pktsnip_t *reversed_pkt = NULL, *ptr = pkt; DEBUG("ipv6: forward packet to next hop\n"); - printf ("transmission\n"); + // printf ("transmission\n"); /* pkt might not be writable yet, if header was given above */ ipv6 = gnrc_pktbuf_start_write(ipv6); if (ipv6 == NULL) { diff --git a/RIOT/sys/net/gnrc/routing/rpl/gnrc_rpl.c b/RIOT/sys/net/gnrc/routing/rpl/gnrc_rpl.c index 3b52d81..587f621 100755 --- a/RIOT/sys/net/gnrc/routing/rpl/gnrc_rpl.c +++ b/RIOT/sys/net/gnrc/routing/rpl/gnrc_rpl.c @@ -19,19 +19,15 @@ #include "net/gnrc/ipv6/netif.h" #include "net/gnrc.h" #include "mutex.h" - +#include "board.h" +#include "periph_conf.h" +#include "periph/gpio.h" #include "net/gnrc/rpl.h" + #ifdef MODULE_GNRC_RPL_P2P #include "net/gnrc/rpl/p2p.h" #include "net/gnrc/rpl/p2p_dodag.h" #endif -/*******************************************************************/ -//ADDED BY PFE7 2017 -//#include "../../boards/stm32f4discovery/include/board.h" -//#include "../../boards/stm32f4discovery/include/periph_conf.h" - -//\ADDED BY PFE7 2017 -/*******************************************************************/ #define ENABLE_DEBUG (0) #include "debug.h" @@ -128,7 +124,6 @@ gnrc_rpl_instance_t *gnrc_rpl_root_init(uint8_t instance_id, ipv6_addr_t *dodag_ trickle_start(gnrc_rpl_pid, &dodag->trickle, GNRC_RPL_MSG_TYPE_TRICKLE_INTERVAL, GNRC_RPL_MSG_TYPE_TRICKLE_CALLBACK, (1 << dodag->dio_min), dodag->dio_interval_doubl, dodag->dio_redun); - return inst; } @@ -288,6 +283,16 @@ void _update_lifetime(void) for (int i = 0; i < GNRC_RPL_INSTANCES_NUMOF; ++i) { inst = &gnrc_rpl_instances[i]; if (inst->state != 0) { + /*******************************************************************/ + //ADDED BY PFE7 2017 + if((inst->dodag.my_rank >= GNRC_RPL_INFINITE_RANK) || (inst-> dodag.my_rank<=0)){ + LED3_OFF; + } + else{ + LED3_ON; + } + //\ADDED BY PFE7 2017 + /*******************************************************************/ if ((inst->cleanup > 0) && (inst->dodag.parents == NULL) && (inst->dodag.my_rank == GNRC_RPL_INFINITE_RANK)) { inst->cleanup -= GNRC_RPL_LIFETIME_UPDATE_STEP; diff --git a/RIOT/sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c b/RIOT/sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c index 38bc1d8..a64afec 100755 --- a/RIOT/sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c +++ b/RIOT/sys/net/gnrc/routing/rpl/gnrc_rpl_dodag.c @@ -349,9 +349,7 @@ static gnrc_rpl_parent_t *_gnrc_rpl_find_preferred_parent(gnrc_rpl_dodag_t *doda #endif } - printf("AVmy_rank : %d\n",dodag->my_rank); dodag->my_rank = dodag->instance->of->calc_rank(dodag->parents, 0); - printf("my_rank : %d\n",dodag->my_rank); if (dodag->my_rank != old_rank) { trickle_reset_timer(&dodag->trickle); } diff --git a/RIOT/sys/net/gnrc/routing/rpl/of0.c b/RIOT/sys/net/gnrc/routing/rpl/of0.c index cf79fec..a61c9dd 100755 --- a/RIOT/sys/net/gnrc/routing/rpl/of0.c +++ b/RIOT/sys/net/gnrc/routing/rpl/of0.c @@ -57,7 +57,7 @@ uint16_t calc_rank(gnrc_rpl_parent_t *parent, uint16_t base_rank) puts("pas parent"); return GNRC_RPL_INFINITE_RANK; } - puts("if1"); + //puts("if1"); base_rank = parent->rank; } @@ -65,14 +65,14 @@ uint16_t calc_rank(gnrc_rpl_parent_t *parent, uint16_t base_rank) uint16_t add; if (parent != NULL) { - puts("if2"); + //puts("if2"); //add = parent->dodag->instance->min_hop_rank_inc; /*******************************************************************/ //ADDED BY PFE7 2017 add = 256 - (parent->mc.rssi + parent->mc.lqi)/10; parent->dodag->instance->min_hop_rank_inc=add; - printf("add= %u\n",add); + //printf("add= %u\n",add); //\ADDED BY PFE7 2017 /*******************************************************************/ -- libgit2 0.21.2