Chinaunix首页 | 论坛 | 博客
  • 博客访问: 91875
  • 博文数量: 24
  • 博客积分: 1411
  • 博客等级: 上尉
  • 技术积分: 260
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-15 13:16
文章分类
文章存档

2010年(24)

我的朋友

分类: 嵌入式

2010-03-28 23:02:46

在LwIP邮件列表中看到了,先记下以作备忘。

以下是原文:

>I don't have an example that I can show you but it's not really that
>complicated. I'm going to assume that you have lwip all set up and ready to
>go; in other words, you have all the sysarch, lwipopts, and sio stuff in
>working order. If that is the case, there a four routines that you should
>take a look at in ppp.c:
>
>pppInit() - Call this once when you system starts. I call this from my
>sys_init() routine.
>pppSetAuth() - Use this to set a user name and password for PAP or CHAP, if
>you have either of them enabled (look in your lwip opts files).
>pppOpen() - Creates a new thread and tells it to start PPP. This new thread
>will let you know what's going on with the PPP connection via the callback
>that you must specify for the first argument.
>pppClose() - Brings down the PPP link and ends the PPP thread.
>
>You should be able to ignore just about everything else, unless you need to
>do some debugging. Anyway, this is basically what you need to do:
>
>1. Initialize your system and lwip (including pppInit()).
>2. Open your comm port.
>3. Dial your modem and wait for it to connect.
>4. call pppSetAuth() and pppOpen().
>5. wait for PPP to tell you it is open (or if it failed for whatever reason).
>6. now you should be on-line. do your thing.
>7. call pppClose and close your comm port.
>
>That should get you started. Just make sure you read and understand exactly
>what those four routines (the ones i outlined above) are doing.

 

LwIP的mailing list

阅读(7742) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~