This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

NDK - How to test whether NC_ (Network Control Functions) are called with success

Hi all,

I use EVM6678L  with NDK 2.20.4.26. I would like to test my network setup code without checking the return values from NC_ functions (NC_SystemOpen, NC_NetStart and etc.). In my situation one external task will check for the result of these functions on the system without directly controlling the return values of these functions. Is there anything like a register, data field and etc. to externally check if network control functions were successful or not?

Regards

  • You can create a variable in the MSMC to monitor the staatus and update it in the task where you use the function and monitor the variable in the other task. i am not sur we have any thing already like this. But I will confirm to you from the expert.

     

    Thanks,

    Arun.

  • Alternatively you can use mailbox for the purpose. Please check a sample code below:

    networkTask()

    {

        ...

     

        status = NC_SystemOpen();

     

        /* let the other task know the status of NDK starup */

        MBX_post(mbx, &status, ...)

     

        ...

    }

     

    otherTask()

    {

        ...

        /* wait for NDK startup to complete. networkTask will send status via mbx */

        MBX_pend(mbx, status, ...);

     

        if (*status == 0) {

            printf("NDK startup success!\n");

        }

        else {

            printf("NDK startup failed! status = %d\n", *status);

        }

        ...

    }