diste
September 24, 2009, 9:00pm
1
I use ppp server on uart1.
It accepts the first connection, but when this will disconnect then the ppp server is no more available.
For to have the ppp server again, I must restart the openat app.
I used the WIP_BOPT_RESTART=true but the behavior is the same
there is another flag for keep the ppp server running?
thanks
Luca
With this code worcks fine:
xtc=wm_strcmp(Tipo,"UART1");
if(xtc==0)
{
rst=wip_bearerOpen(&ptrRAM_MD->Bear_CX.Serv_Bear,"UART1",evh_Serv_Bear, PTR_NULL);
if((rst<0) && (!(rst==(-21)))){return rst;} // WIP_BERR_ALREADY
zst= wip_bearerSetOpts( ptrRAM_MD->Bear_CX.Serv_Bear,
WIP_BOPT_IP_ADDR, local,
WIP_BOPT_IP_DST_ADDR, dest,
WIP_BOPT_RESTART, TRUE,
WIP_BOPT_END);
if( zst <0 ) {return zst;}
xtc= wip_bearerStartServer(ptrRAM_MD->Bear_CX.Serv_Bear,Serv_Bearer_Hand, PTR_NULL);
return xtc;
}
diste
June 3, 2010, 7:33pm
4
not works for me.
I do:
connect with windows ppp connection
disconnect ppp
reconnect ppp-> hangs
my code is:
void init_tcp() {
int r;
wip_in_addr_t local, dest;
r = wip_netInitOpts(WIP_NET_OPT_SOCK_MAX, 12, //
WIP_NET_OPT_DEBUG_PORT, WIP_NET_DEBUG_PORT_UART1,
WIP_NET_OPT_LOG_EVENTS, TRUE,//
WIP_NET_OPT_END);
ASSERT(r)
wip_inet_aton(PPP_LOCAL_STRADDR, &local);
wip_inet_aton(PPP_DEST_STRADDR, &dest);
/* Initialize PPP server over UART */
r = wip_bearerOpen(&bearer, PPP_BEARER, evh_bearer, NULL);
ASSERT(r)
r = wip_bearerSetOpts(bearer,//
WIP_BOPT_IP_ADDR, local,//
WIP_BOPT_IP_DST_ADDR, dest,//
WIP_BOPT_RESTART, TRUE,//
WIP_BOPT_END);
ASSERT(r)
r = wip_bearerStartServer(bearer, evh_ppp_auth, NULL);
ASSERT(r)
server = wip_TCPServerCreate(SERVER_PORT, tcp_event_handler, (void*) 0);
ASSERT(server)
}
static void evh_bearer(wip_bearer_t b, s8 event, void *ctx) {
}