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 When to use NC_NetStop() with Cfg API

Hello,

My question is when should I call NC_NetStop() if Cfg manipulation functions can take effect without rebooting the network stack?

What are the exact cases when I have to call NC_NetStop()?

For example: 
In this post no NC_NetStop() is called only Cfg calls are made.

  • I read through the NDK User's guide as well as the NDK Reference Guide. It appears to me that calling NC_NetStop() should not be required if you're simply trying to modify a port configuration.

    I'm referring this question to someone with more NDK experience.

    Alan
  • I spoke with our local NDK expert regarding normal use cases for when NC_NetStop() might be called. Here is his response:

    "One example I can think of is if you want to free up space and don't need to use the network all the time. For example, maybe you want to connect to a web server and get some kind of data, but only every once in a while. And the rest of the time, you are doing other stuff, that may need to use a lot of memory, but doesn't require the network.

    "You could leave the stack running, but its task(s) will be taking up RAM, while the app doesn't even need the network connection. Instead, you could turn it on initially, connect to the server, get the data, then shut it down and free up resources so you can do "other stuff."

    "If you need it again, you can start up the stack and repeat the web server data access, then shut it down again.

    "One example of needing to reboot is for changing the MAC address. While this requires support at the driver layer (not sure which h/w he's on), if you wanted to call the NDK's IOCT to change the MAC address, this could require a reboot (it may be h/w specific, but I had to reboot the stack on Freon when I added the support for changing the MAC address via IOCTL command).

    "Another example might be to clear the NDK's statistics and give you a clean slate as far as the number of packets received, dropped, failures, etc., for a particular protocol."

    Also, he mentioned this regarding situations where calling NC_NetStop() is NOT required:

    "Updates to the NDK configuration (calls to the Cfg* APIs) will take effect immediately - you don't need to shut down or reboot the stack."

    Alan
  • Dear Alan,

    Thank you for your effort and for the detailed answers.

    All the bests,