OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 4648|回复: 4

uip与花生壳服务

[复制链接]

1

主题

3

帖子

0

精华

新手入门

积分
27
金钱
27
注册时间
2014-7-18
在线时间
0 小时
发表于 2014-10-11 14:16:52 | 显示全部楼层 |阅读模式
5金钱
最近在玩uip 在局域网中可以访问webserver,但想要用花生壳服务时就做不到了,不知道有没有成功的
另外还有几个问题想请教:
1.我是关了路由器的dhcp功能的,不知道你们有没有关
2.无论我有没有开dhcp,在路由器中都找不到stm32的mac地址,你们是不是指定静态地址了
2.我在修改案列后稳定性大大下降,最多10秒钟就死了。
不知道大家有什么意见,请指点一下我这个熊孩子吧

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

13

主题

67

帖子

0

精华

初级会员

Rank: 2

积分
139
金钱
139
注册时间
2014-2-15
在线时间
0 小时
发表于 2014-10-11 16:55:30 | 显示全部楼层
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2014-10-11 21:56:33 | 显示全部楼层
帮顶....
回复

使用道具 举报

1

主题

3

帖子

0

精华

新手入门

积分
27
金钱
27
注册时间
2014-7-18
在线时间
0 小时
 楼主| 发表于 2014-10-12 13:51:36 | 显示全部楼层
回复【3楼】正点原子:

--------------------------------
上面的问题可能是默认的80端口被封(你懂的),我改改再试试,
另外,http://blog.csdn.net/zouw96/article/details/8444438这个是我看到的其他人的分析,与原子大哥差不多
回复

使用道具 举报

1

主题

3

帖子

0

精华

新手入门

积分
27
金钱
27
注册时间
2014-7-18
在线时间
0 小时
 楼主| 发表于 2014-10-12 14:03:57 | 显示全部楼层
[mw_shl_code=c,true]上面的大神的部分分析 if(s->inputbuf[1] == ISO_space) { //如果是空格符就把index_html作为输出页 strncpy(s->filename, http_index_html, sizeof(s->filename)); } else { s->inputbuf[PSOCK_DATALEN(&s->sin) - 1] = 0; //否则将后面的字符作为输出页 strncpy(s->filename, &s->inputbuf[0], sizeof(s->filename)); } [/mw_shl_code]
以下是原子哥的部分  ,原子哥的把原有的更改了。我不是太懂,是如何把浏览器的数据处理的,又是如何,把我们的数据处理后返回的
[mw_shl_code=c,true]if(s->inputbuf[1] == ISO_space||s->inputbuf[1] == '?') //第二个数据是空格/问号 { if(s->inputbuf[1]=='?'&&s->inputbuf[6]==0x31)//LED1 { LED0=!LED0; strx=strstr((const char*)(data_index_html+13),"LED0状态"); if(strx)//存在"LED0状态"这个字符串 { strx=strstr((const char*)strx,"color:#");//找到"color:#"字符串 if(LED0)//LED0灭 { strncpy(strx+7,"5B5B5B",6); //灰色 strncpy(strx+24,"灭",2); //灭 strx=strstr((const char*)strx,"http:");//找到"http:"字符串 strncpy(strx,(const char*)LED_OFF_PIC_ADDR,strlen((const char*)LED_OFF_PIC_ADDR));//LED0灭图片 }else { strncpy(strx+7,"FF0000",6); //红色 strncpy(strx+24,"亮",2); //"亮" strx=strstr((const char*)strx,"http:");//找到"http:"字符串 strncpy(strx,(const char*)LED0_ON_PIC_ADDR,strlen((const char*)LED0_ON_PIC_ADDR));//LED0亮图片 } } }else if(s->inputbuf[1]=='?'&&s->inputbuf[6]==0x32)//LED2 { LED1=!LED1; strx=strstr((const char*)(data_index_html+13),"LED1状态"); if(strx)//存在"LED1状态"这个字符串 { strx=strstr((const char*)strx,"color:#");//找到"color:#"字符串 if(LED1)//LED1灭 { strncpy(strx+7,"5B5B5B",6); //灰色 strncpy(strx+24,"灭",2); //灭 strx=strstr((const char*)strx,"http:");//找到"http:"字符串 strncpy(strx,(const char*)LED_OFF_PIC_ADDR,strlen((const char*)LED_OFF_PIC_ADDR));//LED1灭图片 }else { strncpy(strx+7,"00FF00",6); //绿色 strncpy(strx+24,"亮",2); //"亮" strx=strstr((const char*)strx,"http:");//找到"http:"字符串 strncpy(strx,(const char*)LED1_ON_PIC_ADDR,strlen((const char*)LED1_ON_PIC_ADDR));//LED1亮图片 } } } strx=strstr((const char*)(data_index_html+13),"℃");//找到"℃"字符 if(strx) { get_temperature(dbuf); //得到温度 strncpy(strx-4,(const char*)dbuf,4); //更新温度 } strx=strstr((const char*)strx,"RTC时间:");//找到"RTC时间:"字符 if(strx) { get_time(dbuf); //得到时间 strncpy(strx+33,(const char*)dbuf,16); //更新时间 } strncpy(s->filename, http_index_html, sizeof(s->filename)); }else //如果不是' '/'?' { s->inputbuf[PSOCK_DATALEN(&s->sin)-1] = 0; strncpy(s->filename,&s->inputbuf[0],sizeof(s->filename)); } [/mw_shl_code]

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-30 11:57

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表