Interface Programming
This section describe how to use and control Interface's options such:
- Starting and Stopping Network Interfaces
- Network Interface Hardware Address
- Network Interface Maximum Transmit Unit
- Network Interface Link State
Configuration
Some parameters should be configured and/or optimized for your project requirements. Please refer to the s ection Network Interfaces Configuration for further details.
Using Network Interface Programming API
Wherever you want to configure or access an Interface option you should include one or many of these files:
Include file | Description |
---|---|
IF/net_if.h | Functions used for Interface API |
IF/net_if_ether.h | Ethernet Interface's API reference (used with NetIF_Add()). |
IF/net_if_wifi.h | Wireless Interface's API reference (used with NetIF_Add()). |
API Reference
All Interface APIs are presented in the section Network Interface Functions.
Function Name | Description |
---|---|
NetIF_Add() | Add a network device and hardware as a network interface. |
NetIF_AddrHW_Get() | Get network interface’s hardware address. |
NetIF_AddrHW_IsValid() | Validate a network interface hardware address. |
NetIF_AddrHW_Set() | Set network interface’s hardware address. |
NetIF_CfgPerfMonPeriod() | Configure the network interface Performance Monitor Handler timeout. |
NetIF_CfgPhyLinkPeriod() | Configure network interface Physical Link State Handler timeout. |
NetIF_GetRxDataAlignPtr() | Get an aligned pointer into a receive application data buffer. |
NetIF_GetTxDataAlignPtr() | Get an aligned pointer into a transmit application data buffer. |
NetIF_IO_Ctrl() | Handle network interface and/or device specific (I/O) control(s). |
NetIF_IsEn() | Validate network interface as enabled. |
NetIF_IsEnCfgd() | Validate configured network interface as enabled. |
NetIF_ISR_Handler() | Handle a network interface’s device interrupts. |
NetIF_IsValid() | Validate network interface number. |
NetIF_IsValidCfgd() | Validate configured network interface number. |
NetIF_LinkStateGet() | Get network interface’s last known physical link state. |
NetIF_LinkStateSubscribe() | Subscribe to get notified when an interface link state changes. |
NetIF_LinkStateUnsubscribe() | Unsubscribe to get notified when interface link state changes. |
NetIF_LinkStateWaitUntilUp() | Wait for a network interface's physical link state to be UP . |
NetIF_MTU_Get() | Get network interface’s MTU. |
NetIF_MTU_Set() | Set network interface’s MTU. |
NetIF_Start() | Start a network interface. |
NetIF_Stop() | Stop a network interface. |