Denislam Valeev / Mbed OS Nucleo_rtos_basic
Embed: (wiki syntax)

« Back to documentation index

Fnet_stack_init

Fnet_stack_init

Data Structures

struct  fnet_mutex_api_t
 Mutex API. It should be defined by application if FNET_CFG_MULTITHREADING is enabled. More...
struct  fnet_init_params
 Input parameters structure for fnet_init() More...

Typedefs

typedef void * fnet_mutex_t
 Mutex type.

Functions

fnet_return_t fnet_init (struct fnet_init_params *init_params)
 Initializes the FNET TCP/IP stack.
void fnet_release (void)
 Releases the FNET TCP/IP stack.

Detailed Description

  • The fnet.h file includes all the other header files needed to use the FNET TCP/IP stack user interface. This means that it is the only file the application developer needs to include in the source code using the FNET stack API.
  • The fnet_init() function must be called in order to initialize the FNET TCP/IP stack. The return value from fnet_init() must be verified to indicate the success before calling any other TCP/IP functions.
  • After fnet_init() returns the FNET_OK value, the FNET TCP/IP stack is ready for use.
  • Initialize required networking interfaces using fnet_netif_init().

For example:

 ...
    static fnet_uint8_t stack_heap[FAPP_CFG_HEAP_SIZE];
    struct fnet_init_params init_params;

    // Input parameters for FNET stack initialization.
    init_params.netheap_ptr = stack_heap;
    init_params.netheap_size = sizeof(stack_heap);

    // Init FNET stack.
    if(fnet_init(&init_params) != FNET_ERR)
    {
        // Initialize Network Interfaces.
         ,,,
        // Place your code here.
    }
    else
        fnet_printf("ERROR: FNET stack initialization is failed!\n");
 ...

Typedef Documentation

typedef void* fnet_mutex_t

Mutex type.

See also:
FNET_CFG_MULTITHREADING,

Definition at line 87 of file fnet_stack.h.


Function Documentation

fnet_return_t fnet_init ( struct fnet_init_params init_params )

Initializes the FNET TCP/IP stack.

Parameters:
init_paramsPointer to the initialization parameter structure.
Returns:
This function returns:
  • FNET_OK = Stack initialization is successful.
  • FNET_ERR = Stack initialization has failed.
See also:
fnet_release()

This function executes the initialization of the FNET TCP/IP stack.
Only after a succesful initialization, the application may use other FNET API functions and services.

void fnet_release ( void   )

Releases the FNET TCP/IP stack.

See also:
fnet_init()

This function releases all resources occupied by the FNET TCP/IP stack. But it does not release resources occupied by FNET services.