This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
problem with ppp connection
- From: "shobhit saxena" <shobhit dot sahai at gmail dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Fri, 19 Jan 2007 01:22:10 -0500
- Subject: [ECOS] problem with ppp connection
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:-
#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]);
}
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss