[Assigner] cart association modified

This commit is contained in:
Daniela 2019-04-16 16:29:18 +02:00
parent 91a93b6d6a
commit cd8812d049

View File

@ -38,8 +38,11 @@ bool insert_cart(uint8_t new_req_battery, linkaddr_t mac_cart_addr)
return false; return false;
} }
cart* c = cart_list; cart* c = cart_list;
while(linkaddr_cmp(&(c->cart_address),&mac_cart_addr) == 0) while(c)
c = c->next; {
if(linkaddr_cmp(&(c->cart_address),&mac_cart_addr) == 0)
c = c->next;
}
if(c) if(c)
printf("Cart already associated!\n"); printf("Cart already associated!\n");
else else