I want to broadcast an array of integers using the broadcast function in the Contiki OS. However, the packetbuf_copyfrom() function does not seem to work for me, when giving an integer array as input. When monitoring the Messages over Cooja's "Radio Message Tool" the packets seem to be empty.
This is what it looks like using a char array as parameter and like that when trying to do exactly the same, just using an integer array.
According to the Contiki Documentation the function expects a void pointer and calls the memcpy function, which should not be a problem regarding integers?
int packetbuf_copyfrom(const void *from, uint16_t len)
{
uint16_t l;
packetbuf_clear();
l = len > PACKETBUF_SIZE? PACKETBUF_SIZE: len;
memcpy(packetbufptr, from, l);
buflen = l;
return l;
}
I'm using the
/contiki/examples/rime/example-broadcast.c
file on Z1 Motes in the Cooja Simulator with contiki 2.7.
Where might my mistake be?