This is the mail archive of the ecos-discuss@sourceware.org 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]

problem with ppp connection


hello everyone,
                    has anyone implemented ppp connection serially on
arm e7t board using ecos.actually i have established the connection
using lwip_init() function & including the lwip package.my code is
running successfully.i have used two fedora pc and i have established
a ppp connection via arm kit from one pc to other.i have made the  2nd
pc as server & the connection is established.the connection is showing
the local address & remote address.
              the problem is that even if the connection is made ,i
am not able to send or recive any data from one pc to other.i have
used all the possible functions(cyg_io_write,sio_send,sio_write),but
nothing is working.i don't know which functions should i use to
read/write when i have enabled the connection by only using
lwip_init().when the connection is established i am not able to open
the minicom as well.it shows dev/ttyso lock.i am trying to ping but
even that is not working.
can anyone me advice me what to do.
here is my code:-
#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();



// pppInit(); cyg_io_write(handle1,str,&len); // pppSetAuth(PPPAUTHTYPE_NONE,"rakesh",""); printf("first hello\n");



// pd=pppOpen(handle1,pppLinkStatusCallback,NULL);
printf("second hello\n");
// printf("value of pd=%d\n",pd);
// pppClose(pd);
}

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]);
}

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


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