Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The application developer may start a network interface by calling the NetIF_Start() API function with the necessary parameters. A call to NetIF_Start() is shown below.

Code Block
languagecpp
titleListing - Calling NetIF_Start()
linenumberstrue
NetIF_Start(if_nbr, &err);   (1)


Panel
bgColor#f0f0f0
  1. NetIF_Start() requires two arguments. The first function argument is the interface number that the application wants to start, and the second argument is a pointer to a NET_ERR to contain the return error code. The interface number is acquired upon successful addition of the interface and upon the successful start of the interface; the return error variable will contain the value NET_IF_ERR_NONE.

There are very few things that could cause a network interface to not start properly. The application developer should always inspect the return error code and take the appropriate action if an error occurs. Once the error is resolved, the application may again attempt to call NetIF_Start().

Stopping

Under some circumstances, it may be desirable to stop a network interface such as for saving power. A network interface may be stopped any time after it has been successfully “added” to the system. Stopping an interface may be performed by calling NetIF_Stop() with the appropriate arguments shown below.

Code Block
languagecpp
firstline1
titleListing - Calling NetIF_Stop()
linenumberstrue
NetIF_Stop(if_nbr, &err);   (1)


Panel
bgColor#f0f0f0
  1. NetIF_Stop() requires two arguments. The first function argument is the interface number that the application wants to stop, and the second argument is a pointer to a NET_ERR to contain the return error code. The interface number is acquired upon the successful addition of the interface and upon the successful stop of the interface; the return error variable will contain the value NET_IF_ERR_NONE.

There are very few things that may cause a network interface to not stop properly. The application developer should always inspect the return error code and take the appropriate action if an error occurs. Once the error is resolved, the application may attempt to call NetIF_Stop() again.