Network Component  Version 6.6
MDK-Professional Middleware for IP Networking
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
System Functions (User)

Core system functions to be called by user. More...

Functions

netStatus net_initialize (void)
 Initialize Network Component, resources and interfaces.
 
int net_main (void)
 Run Network Component main function.
 

Description

Core system functions to be called by user.

System Functions represent the core of the protocol stack. They form an operating system that calls all other protocol module functions. The functions require a CMSIS-RTOS compatible RTOS to run and are not reentrant.

The functions are part of the Network Component library and are defined in rl_net.h.

Function Documentation

netStatus net_initialize ( void  )

Initialize Network Component, resources and interfaces.

Returns
status code that indicates the execution status of the function as defined with netStatus.

The function net_initialize initializes the Network Core's system resources, protocols, and applications.

Note
You must call the function at system start-up to properly initialize the networking environment.

Code Example

void main (void) {
init ();
// Initialize the Network Core
while (1) {
// Run main Network Core 'thread'
..
}
}
int net_main ( void  )

Run Network Component main function.

Returns
system status information:
  • 1 = Another call to this function needed.
  • 0 = System is idle.

The function net_main is the main function of the Network Core. It handles:

  • Protocol time-outs
  • ARP address cache
  • Polling of the Ethernet controller for received data.

When net_main receives data from a remote machine, it calls the appropriate protocol functions to process the data. It then passes the resulting data to the user application.

Note
You must call net_main frequently. Otherwise the Network Core fails to run.

Code Example

void main (void) {
init ();
// Initialize the Network Core
while (1) {
// Run main Network Core 'thread'
..
}
}