net. Object
The net. object of TiOS running on Tibbo hardware facilitates network communications via the hardware Ethernet port (if available).
The net. object of the TiOS Simulator facilitates network communications via the WinPcap driver, which taps into the low-level network traffic of your PC's Ethernet port.
It is important to realize that, as far as the net. object and sock. object are concerned, the TiOS Simulator does not rely on Windows sockets. TiOS has its own sockets implementation, so it requires a channel to receive and send MAC-level Ethernet packets into and out of its own socket system. This channel is provided by the WinPcap driver.
Several important points follow from the use of the WinPcap driver:
- The net. object is fully separated from the socket system of your Windows PC. You can (and should) give your TiOS Simulator an IP address that is different from your PC's IP. The TiOS Simulator's ports are not integrated into the port space of your PC. From the TiOS Simulator's point of view, you PC is only a shell that lugs MAC-level Ethernet packets to and from the TiOS Simulator, with the help of the WinPcap driver.
- The sock. object of the TiOS Simulator is only able to send and receive data when the WinPcap driver is enabled. This is achieved by checking the Use WinPcap checkbox and selecting the correct Ethernet interface in the TiOS Simulator's Options Dialog (Simulator > Settings). This should be the Ethernet interface through which the TiOS Simulator's PC is connected to the network. You must have this PC connected to the network via the Ethernet interface. Using other interfaces, such as Wi-Fi, will prevent the net. object and sock. object from working correctly.
- It is not possible to communicate with the sock. object from the same PC on which the TiOS Simulator is running. This is because the PC's internal network traffic goes through the loopback interface of Windows sockets. In other words, the Ethernet port that the WinPcap driver is attached to does not see any local (unicast) traffic. Hence, the TiOS Simulator won't receive any (unicast) network traffic originating from the same PC.
For more information see Network Communications in the TiOS Simulator.
Differences from the "real" net. object:
Always equal to the MAC address of the host PC. The MAC cannot be changed even using Device Explorer's Change MAC feature. |
|
Always returns 0 — NO. |
|
On each TiOS Simulator's (re)start, changes from 0 — PL_NET_LINKSTAT_NOLINK to 2 — PL_NET_LINKSTAT_100BASET, regardless of the actual state of the Ethernet link. |
|
Always happens once after the TiOS Simulator (re)starts. |
|
Never happens. |
All other aspects of the TiOS SImulator's net. object follow our "real" net. object found on several Tibbo devices.