This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

waiting for proposal. (TCP/IP stack used in ARM E7T board) Thanks a lot!


Dear all:
    I am currently on a project to building a system with TCP/IP networking
functionality.  What I am planning to do is: ARM E7T board, PHY board with
ICS1892,  and KS3C4510 ethernet driver developed by Grant Edwards. and light
weight TCP/IP stack: lwip  I have already built the ecos library as:  ARM
E7T template, default, common ethernet support,  deselect "support for
stand-alone network stack" option  ( with this option it will make multiple
definition for "eth_drv_write" (both defined in lwip and stand-alone network
stack)) ,  deselect support printing driver debug information.  After I
built the ecos lib, I try to link with the test code as below(modified from
the original test code in lwip: socket.c):

The idea to use such test code is to connect the PHY board( The PHY board is
built by myself and have been tested so it should work properly, the aim of
this question is to know whether such configuraion is correct or not)  to a
hub and keep sending out the package so I can observe the led flashing from
the LED on the hub if the system can work.  I have no idea how to test
whether such configuration is correct this is the only way I know to do.
maybe somebody can give me some hint. But I can't see any led flashing as
the result of this application. hope anyone can help me out of this.  Thanks
a lot!

#include "lwip/sys.h"
#define LWIP_COMPAT_SOCKETS 1
#include "lwip/sockets.h"

static void
socket_thread(void *arg)
{
	int sock,s;
	char buf[100];
	int len;
	struct sockaddr_in addr,rem;

	sock = socket(AF_INET,SOCK_STREAM,0);
	addr.sin_family = AF_INET;
	addr.sin_port = htons(2000);
	addr.sin_addr.s_addr = (168<<24 | 192<<16 | 0<<8 | 5);// ip: 168.192.0.5

/*	bind(sock,(struct sockaddr *)&addr,sizeof(addr));
	listen(sock,5);
	len = sizeof(rem);
	s = accept(sock,(struct sockaddr*)&rem,&len);
	while((len = read(s,buf,100))>0)
		write(s,buf,len);
*/
	// try to send out the request  so I can observe it via the LED on the hub
to see whether it is working with the network.
	while(1)
		connect(sock, (struct sockaddr *)&addr, sizeof(addr));
}

int
main(void)
{
  lwip_init();
  sys_thread_new(socket_thread, (void*)"socket");
  return 0;
}


Best regards

james


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]