Hello, i'm trying to send UDP messages from netcat to openthread.
where IP6ADRESS are any of the ips listed by ipadrr at CLI and I'm able to ping6 it.
echo -n "foo" | nc -u -w1 -6 IP6ADDRESS%wpan0 10000
and I'm able to see the messages are sent with wireshark.
and my application is code is as such:
otSockAddr mSocket = {0};
otUdpSocket uSock = {0};
void init_udp(){
otIp6SetReceiveCallback(m_app.p_ot_instance, &dataCallback, NULL);
if(otUdpOpen(m_app.p_ot_instance, &uSock, &udpCallback, m_app.p_ot_instance) == OT_ERROR_NONE){}
memcpy(&(mSocket.mAddress), findLocalAddr(m_app.p_ot_instance), sizeof(mSocket.mAddress));
mSocket.mPort = 10000;
mSocket.mScopeId = 8; //Tested 2,5,8
if(otUdpBind(&uSock, &mSocket) == OT_ERROR_NONE){}
}
I've paired the device to the border router as per meshcop example and i'm able to receive ip address to the device.
findLocalAddr returns first entry where preferred == 1 and valid == 1 using list unicast addresses API call.
I'm able to see that i'm receiving some (crypted?) messages at dataCallback, but i'm never receiving any messages to the udpCallback.
How can I get my receive to work?