268
Platforms
©2000-2008 Tibbo Technology Inc.
link status.
Be notified when data overflow occurs in the NIC.
8.3.3.1
Overview
Here you will find:
(IP, gateway IP, netmask, MAC).
(link status change, failure, overflows).
Main Parameters
To enable Ethernet communications, you need to set the
properties. Actually, net.gatewayip and net.netmask
are only needed when your device will be establishing outgoing connections to
other hosts on the network (perform active opens). If your device will only be
accepting incoming connections then you do not have to set the net.gatewayip and
the net.netmask.
Strangely, a lot of people hold a passionate belief that default gateway
IP and the netmask are necessary always, even for incoming
connections. This is not true!
The net object is usually initialized once on startup, like this:
sub
on_sys_init
... some other stuff
net.ip =
"192.168.1.95"
'just an example! May not work on your
network!
net.gatewayip =
"192.168.1.1"
'just an example! May not work on your
network!
net.netmask=
"255.255.255.0"
'just an example! May not work on your
network!
...some other stuff
end
sub
On a lot of networks the IP, gateway IP, and the netmask parameters
of the hosts are configured automatically, through the use of a special
protocol called "DHCP". The net object does not support dhcp directly
by we provide a BASIC library that implements DHCP functionality.
One additional read-only property- the
- can be used to extract the MAC
address of your device. Your program cannot change the MAC address directly. The
MAC is stored in the special configuration area of the EEPROM. Access to the
EEPROM is provided by the
object. To change the MAC address you need to
rewrite the data in the EEPROM. For more details, see the
and
Property topics.
268
269
270
270
270
269
380
380
381