nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

open thread open UDP < build error >

I start learning open thread in nrf connect SDK using nrf52833, it was pretty fun examples. Now I switch from using cli to send udp from/ to devices to implement it in the main code. every thing went fine except the UDP open.

I copy the functions of udp open from cli example, the error causes by otUdpOpen in callback function was in: error: invalid use of undefined type 'struct otMessage'  .

void udp_rcv_handle(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
    LOG_INF("callback");
    //handling msg here...
}


void UDPopen()
{

    otError error;
    static struct openthread_context *lOTContext;
    lOTContext = openthread_get_default_context();
    otUdpSocket mySocket;

    if(!otUdpIsOpen(lOTContext->instance, &mySocket), error = OT_ERROR_ALREADY)
    {
	    error = otUdpOpen(lOTContext->instance, &mySocket, udp_rcv_handle, lOTContext);

    }

}

screenshot of error message

from my understanding is that otMessage struct did not pass to c++ libraries of openthread.  I try using same function of handling of cli but have same error! I do not know what I missing.

I use 1.9.1 nRF connect SDK. with nrf52833 device.

any help please.
Thanks! 

Parents Reply Children
No Data
Related