i wrote the following to print the ipv6 address of a mote in contiki-
static void
print_ipv6_addr(const uip_ipaddr_t *ip_addr) {
int i;
for (i = 0; i <= 7; i++) {
printf("%04x ", ip_addr->u16[i]);
}
}
My method prints-
aaaa 0000 0000 0000 1202 0174 0100 0101
whereas the IP address displayed by cooja is- aaaa::212:7401:1:101
.
I understand that 0000 0000 0000
is the same as ::
but why is the rest of it 'garbled'? What could i be doing wrong here?