6 Software
User Manual
52/374
High Level Hardware Access
Get local information
It is possible to read out the local settings of the eth0 device, such as MAC address, IP address, Gateway,
Netmask,....
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:1D:48:20:F6:11
inet addr:172.25.230.17 Bcast:172.25.230.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3819 errors:0 dropped:0 overruns:0 frame:0
TX packets:295 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:507786 (495.8 KiB) TX bytes:23816 (23.2 KiB)
Interrupt:133 Base address:0x3000
How to set static IP for eth0
1. Set the IP settings to "STATIC" in /etc/init.d/rc.conf
# -------------- NETWORK ETH0:
# DHCP settings for eth0
# if ETH0_CONF is set to "DHCP" then DHCP will be used
# in case we do not get any DHCP configuration from a DHCP server, we will automatically
# fall back to mode "STATIC".
# if ETH0_CONF is set to "STATIC" then the static settings below will be used
# if ETH0_CONF is set to "UBOOT" then the settings will not be touched
# Note: also adapt the setting in /sbin/dhclient for the gateway entries
export ETH0_CONF="STATIC"
# Static settings for eth0 (if ETH0_CONF="STATIC")
# Note: ETH0_GW is also important if you use ETH0_CONF="UBOOT"
# IP of eth0 if ETH0_CONF="STATIC"
export ETH0_IP="192.168.200.1"
# Submask of eth0 if ETH0_CONF="STATIC"
export ETH0_SUBMASK="255.255.255.0"
# Broadcast IP of eth0 if ETH0_CONF="STATIC"
export ETH0_BR="192.168.200.255"
# Settings for eth0 (if ETH0_CONF="STATIC" or "UBOOT")
# Gateway of eth0
export ETH0_GW="192.168.200.1"
# Domain of eth0
export ETH0_DOMAIN=""
# DNS which eth0 uses for communication
export ETH0_DNS="192.168.1.8"
2. Reboot the system:
# reboot
Example: C-Code
# How to TCP connection via sockets
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
sint16 s16_Return;
sint16 s16_Sockfd = socket(AF_INET, SOCK_STREAM, 0);
// Create socket
Summary of Contents for TC1
Page 1: ...TC1 User Manual Version of this document V1 00r0 ...
Page 25: ...5 Hardware User Manual 25 374 5 2 2 Block Diagram Variant TC1 WIFI ...
Page 34: ...5 Hardware User Manual 34 374 5 6 Housing Connector Top view and side view Bottom View ...
Page 125: ...7 Teleservice Application Framework User Manual 125 374 TAF overview ...
Page 190: ...7 Teleservice Application Framework User Manual 190 374 How the logger mechanism works ...