Iam trying to using this function to set the node which send packet to other node in code unicast contiki , but this function doesn't work , what's the problem ? Can you help me ,please ! I want to topo 2 node which require : If node 2 received packet from node 1 then node2 send the packet ACK to node 1 to announce that node 2 has received the packet from node 1 . I use unicast program in contiki . , I use function linkaddr_set_node_addr (linkaddr_t *addr) to set node 1 to send packet, but this function doesn't work , can someone help me , please . This is my code :
linkaddr_t addr;
addr.u8[0]=2;
addr.u8[1]=0;
packetbuf_copyfrom("GINDBK",5);
unicast_send(&uc,&addr);
if (linkaddr_node_addr.u8[0]==1 && linkaddr_node_addr.u8[1]==0)
{
linkaddr_t addr;
addr.u8[0]=2;
addr.u8[1]=0;
linkaddr_set_node_addr(&addr);
packetbuf_copyfrom("ACK",20);
addr.u8[0]=1;
addr.u8[1]=0;
unicast_send(&uc,&addr);
}