Network

Top  Previous  Next

The Network functions are used for establishing a connection either to the internet or to a local network.

 

The following network interfaces are supported:

 

IFACE

Name

Description

1

Cellular

Cellular connection.

2

LAN 1

Primary Ethernet connection.

3

LAN 2

Secondary / USB Ethernet connection.

4

WLAN

Wireless network connection.

5

AP

Wireless Access Point connection.

When using the 'net' API the external WiFi and Ethernet add-on modules are not supported.

 

The following defines are present representing each interface:
 

1        _NET_IFACE_MOBILE // _NET_IFACE_CELLULAR

2        _NET_IFACE_LAN1

3        _NET_IFACE_LAN2

4        _NET_IFACE_WLAN

5        _NET_IFACE_WLAN_AP

 

Additionally, the define _NET_IFACE_ANY with the value of 0 can be used when calling netConnected() to get the status for any interface.

 

 

Network Address Translation (NAT)

This is a way to route socket connections between different network interfaces.

It is possible to configure a network interface to be a gateway to the Internet.

When this is done, NAT is used to masquerade outgoing socket connection, as if sending from the device.

Please note that only one network interface can be set as gateway at a time.

The NAT functionality is only available on devices with NX32L architecture.

 

 

Dynamic Host Configuration Protocol (DHCP) server

This server uses the DHCP to dynamically assign an IP address and other network configuration parameters to each device on a network.

The configuration parameters the DHCP server assigns are configured for each network interface.

The DHCP server is only available on devices with NX32L architecture.

 

 

Port Forwarding

This is a way to forward incoming connections from a network interface to a client device located on a different network interface.

The forwarding rules always apply to the network interface which is configured as the NAT gateway.

If the NAT gateway configuration is moved to a different network interface, the port forwarding rules will follow automatically.

For example:

If the WLAN network interface is configured as NAT Gateway, then only incoming connections from this interface will be forwarded.

Later the Mobile network interface is configured as NAT Gateway,and only incoming connections from this interface will be forwarded, no changes to the port forwarding rules are necessary.

 

If no rules are defined, no incoming socket connections will be forwarded to other network interfaces.

 

 

Routing

The routes tells the system how to send socket data to the receiver.

Normally the system handles it automatically based on the subnet for each network, using the NAT Gateway as the default route, see netSetNATParam.

When using more complex networks (Multiple subnets, VPN, or similar) it may be necessary to access devices on different subnets that can not use the default route.

 

Interface configuration

The interfaces can either be configured in the Network Settings dialog or from VPL.

 

Gateway functions and configuration

Deprecated functions for the RTCU Gateway.

 

RCH functions and configuration

RTCU Communcation Hub / Gateway functions.

 

 

 

The following functions are available for working with the interfaces:

 


netOpen

Opens a network interface.


netClose

Closes a network interface.


netConnected

Queries if an interface is connected to the network.


netPresent

Determines if the network interface is available.


netGetInformation

Returns information about a network interface.


netGetStatistics

Returns statistics for a network interface.


netGetStatisticsAcc

Returns accumulated statistics for a network interface.


netGetSignalLevel

Returns the signal strength of a network interface.


netPing

Ping a host (advanced)


netPingS

Ping a host (simple)

 

The following functions are available for network services:

 


netGetMonitorParam

Retrieve the network monitoring service parameters for a network interface.


netSetMonitorParam

Set the network monitoring service parameters for a network interface.