lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] problem in ppp connection


From: Jonathan Larmour
Subject: Re: [lwip-users] problem in ppp connection
Date: Mon, 22 Jan 2007 10:36:28 +0000
User-agent: Thunderbird 1.5.0.9 (X11/20070102)

shobhit saxena wrote:
hello everyone,
                   i am using an ARM e7t kit on ecos.i have
established a ppp connection using lwip_init() between two
pc's(fedora) through ARM kit.i have made one pc as the server & the
kit as client.
my problem is that i am want to transfer data from one pc to another
through ARM kit.i have tried many functions.
Can someone suugest me a way to transfer a string from one pc to another.
here is my code:-

Are you wanting to use a TCP/IP stack really? Or do you want to just send a string through the serial port. If you want a TCP/IP stack, then you need to make TCP/IP networking calls to create a new connection, and be running PPP at both ends. If you want to just send a string out a serial port in eCos, read the eCos serial driver documentation, which says to use cyg_io_write(). If you have more questions on this, take them to the eCos mailing lists: <http://ecos.sourceware.org/intouch.html> as this list is for lwIP only.

Jifl

#include <cyg/infra/cyg_type.h>
#include <stdio.h>                      /* printf */
#include <string.h>                     /* strlen */
#include <cyg/kernel/kapi.h>            /* All the kernel specific stuff */
#include <cyg/io/io.h>                  /* I/O functions */
#include <cyg/hal/hal_arch.h>           /* CYGNUM_HAL_STACK_SIZE_TYPICAL */
#include "ppp.h"
#include "init.c"


/* DEFINES */

#define NTHREADS 1
#define STACKSIZE ( CYGNUM_HAL_STACK_SIZE_TYPICAL + 4096 )

/* STATICS */

static cyg_handle_t thread[NTHREADS];
static cyg_thread thread_obj[NTHREADS];
static char stack[NTHREADS][STACKSIZE];

/* FUNCTIONS */

void pppLinkStatusCallback(void * ctx, int errCode, void * arg) {
      printf("entered call back\n");

}
static void simple_prog(CYG_ADDRESS data)
{
  cyg_io_handle_t handle1;
  Cyg_ErrNo err;
  const char str[]="hi.i am shobhit\n";
  cyg_uint32 len=strlen(str);

  cyg_io_lookup( "/dev/ser0", &handle1);
  printf("Starting serial example\n");

 lwip_init();         //this function only is reponsible for the ppp
connection//

}
void cyg_user_start(void)
{
  cyg_thread_create(4, simple_prog, (cyg_addrword_t) 0, "serial",
(void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]);
  cyg_thread_resume(thread[0]);
}


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users



--
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
Visit us at Embedded World 2007, Nürnberg, Germany, 13-15 Feb, Stand 11-336
Company legal info, address and number:   http://www.ecoscentric.com/legal
------["The best things in life aren't things."]------      Opinions==mine




reply via email to

[Prev in Thread] Current Thread [Next in Thread]