Added socket_examples as and app

This commit is contained in:
goldsimon 2010-02-02 18:39:24 +00:00
parent c0b7b8de41
commit b411c22658
3 changed files with 26 additions and 6 deletions

View File

@ -25,16 +25,17 @@
#define LWIP_CHARGEN_APP 0
#define LWIP_DNS_APP 0
#define LWIP_PING_APP 0
#define LWIP_NETBIOS_APP 0
#define LWIP_HTTPD_APP 0
/* Set this to 1 to use the netconn http server,
* otherwise the raw api server will be used. */
/*#define LWIP_HTTPD_APP_NETCONN */
#define LWIP_NETBIOS_APP 0
#define LWIP_NETIO_APP 0
#define LWIP_PING_APP 0
#define LWIP_RTP_APP 0
#define LWIP_SNTP_APP 0
#define LWIP_SHELL_APP 0
#define LWIP_SNTP_APP 0
#define LWIP_SOCKET_EXAMPLES_APP 0
#define LWIP_TCPECHO_APP 0
/* Set this to 1 to use the netconn tcpecho server,
* otherwise the raw api server will be used. */

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="9,00"
Name="lwIP_test"
ProjectGUID="{8CC0CE51-32CF-4585-BFAF-A9343BC5A96D}"
RootNamespace="lwIP_test"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@ -78,6 +79,8 @@
AdditionalLibraryDirectories="$(PCAP_DIR)\Lib"
ProgramDatabaseFile=".\Release/test.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -165,6 +168,8 @@
AdditionalLibraryDirectories="$(PCAP_DIR)\Lib"
GenerateDebugInformation="true"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -337,6 +342,14 @@
RelativePath="..\..\..\apps\sntp\sntp.h"
>
</File>
<File
RelativePath="..\..\..\apps\socket_examples\socket_examples.c"
>
</File>
<File
RelativePath="..\..\..\apps\socket_examples\socket_examples.h"
>
</File>
<File
RelativePath="..\..\..\apps\tcpecho\tcpecho.c"
>

View File

@ -72,6 +72,7 @@
#include "apps/tcpecho/tcpecho.h"
#include "apps/udpecho/udpecho.h"
#include "apps/tcpecho_raw/echo.h"
#include "apps/socket_examples/socket_examples.h"
#if NO_SYS
/* ... then we need information about the timer intervals: */
@ -179,7 +180,8 @@ pppLinkStatusCallback(void *ctx, int errCode, void *arg)
#if LWIP_NETIF_STATUS_CALLBACK
void status_callback(struct netif *netif)
{ if (netif_is_up(netif)) {
{
if (netif_is_up(netif)) {
printf("status_callback==UP, local interface IP is %s\n", ip_ntoa(&netif->ip_addr));
} else {
printf("status_callback==DOWN\n");
@ -189,7 +191,8 @@ void status_callback(struct netif *netif)
#if LWIP_NETIF_LINK_CALLBACK
void link_callback(struct netif *netif)
{ if (netif_is_link_up(netif)) {
{
if (netif_is_link_up(netif)) {
printf("link_callback==UP\n");
#if LWIP_DHCP
if (netif->dhcp != NULL) {
@ -363,6 +366,9 @@ apps_init()
#if LWIP_UDPECHO_APP && LWIP_NETCONN
udpecho_init();
#endif /* LWIP_UDPECHO_APP && LWIP_NETCONN */
#if LWIP_SOCKET_EXAMPLES_APP && LWIP_SOCKET
socket_examples_init();
#endif /* LWIP_SOCKET_EXAMPLES_APP && LWIP_SOCKET */
}
/* This function initializes this lwIP test. When NO_SYS=1, this is done in