亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? http.lst

?? 基于單片機C8051F020與以太網進行通信程序
?? LST
?? 第 1 頁 / 共 2 頁
字號:
 195   1         {
 196   2            tcp_data = inbuf;
 197   2            conxn[nr].my_sequence = conxn[nr].old_sequence;   
 198   2         }
 199   1         
 200   1         // Start off with no request
 201   1         request = NONE;
 202   1            
 203   1              // TODO: Calling strstr() on a large buffer takes a lot of time
 204   1         // so perhaps we could speed things up by limiting the search
 205   1         // range to the portion of the buffer where the item is expected
 206   1         // to be found
 207   1              
 208   1              // If it is a POST, then set a flag to start looking for the post
 209   1              // data of interest, which is the string "switch=".  It may arrive
 210   1              // in a later segment (Netscape seems to split up the POST message)
 211   1         if (strstr(tcp_data, "POST") != NULL) post_flg = TRUE; 
 212   1                 
 213   1         // See if this is a GET message
 214   1         else if (strstr(tcp_data, "GET") != NULL)
 215   1         {
 216   2            post_flg = FALSE;
 217   2            if (strstr(tcp_data, "photo1") != NULL) request = GET_JPEG;
 218   2            else if (strstr(tcp_data, "index") != NULL) request = GET_PAGE;
 219   2            else if (strstr(tcp_data, "/ ") != NULL) request = GET_PAGE;
 220   2         }
 221   1         
 222   1         // If POST flag is "armed" then look for the "switch=" string
 223   1         // and if found, turn the LED on or off according to whether 
 224   1         // the browser is sending a 1 or a 0.
 225   1         if (post_flg)
 226   1         {
 227   2            ptr = strstr(tcp_data, "switch=");
 228   2            if (ptr != NULL)
 229   2            {
 230   3               // Move to space after equals sign
 231   3               // Set control indicator accordingly
 232   3               post_flg = FALSE;
 233   3               request = POST_PAGE;
 234   3               ptr += 7;
 235   3               if (*ptr == '1') {CONTROL_LED=0x0;}   
 236   3               else if (*ptr == '0') {CONTROL_LED=0x1;}
 237   3                       LightONOFF(CONTROL_LED);
 238   3            }
 239   2         }
 240   1      
 241   1         if ((request == GET_PAGE) || (request == POST_PAGE))
C51 COMPILER V7.06   HTTP                                                                  07/29/2006 13:15:57 PAGE 5   

 242   1         {
 243   2            // Figure out sizes
 244   2            hhdr_len = strlen(html_header);
 245   2            page_len = strlen(web_page);
 246   2            body_len = hhdr_len + page_len;
 247   2            
 248   2            // Free memory holding received message.  The message from the
 249   2            // browser can be 500+ bytes long so this is a significant 
 250   2            // chunk out of the available malloc space of 1500 bytes
 251   2            if (!resend) {free(inbuf); rcve_buf_allocated = FALSE;}
 252   2      
 253   2            // Allocate memory for entire outgoing message including
 254   2            // 14 byte Ethernet + 20 byte IP + 20 byte TCP headers
 255   2            // Allow 1 byte for NULL char at the end
 256   2            outbuf = (UCHAR xdata *)malloc(54 + body_len + 1);
 257   2            if (outbuf == NULL)
 258   2            {
 259   3               if (debug) serial_send("TCP: Oops, out of memory\r");
 260   3               return 0;
 261   3            }
 262   2            
 263   2            // Copy page data.  This moves data from flash into RAM.  It is
 264   2            // an undesirable process, but must get data into RAM to replace
 265   2            // tags 
 266   2                      memcpy(outbuf + 54, html_header, hhdr_len);
 267   2                      memcpy(outbuf + 54 + hhdr_len, web_page, page_len);
 268   2                              
 269   2              outbuf[54 + body_len] = 0;              // Append NULL 
 270   2         
 271   2            // Replace length tag with actual value
 272   2             itoa(page_len, text, 10);
 273   2                      replace_tag(outbuf + 54, "TAG:LEN1", text);
 274   2                      
 275   2                      // Replace CPU temperature tag with actual value
 276   2                      itoa(cpu_temperature/100, text, 10);
 277   2                      i=strlen(text);
 278   2                      text[i]='.';
 279   2                      i++;
 280   2                      itoa(cpu_temperature%100, text+i, 11);
 281   2                      replace_tag(outbuf + 54, "TAG:TMP1", text);
 282   2      
 283   2                      itoa(air_temperature/100, text, 10);
 284   2                      i=strlen(text);
 285   2                      text[i]='.';
 286   2                      i++;
 287   2                      itoa(air_temperature%100, text+i, 11);
 288   2                      replace_tag(outbuf + 54, "TAG:TMP2", text);
 289   2      
 290   2                      // Replace CPU voltage tag with actual value X 100
 291   2                      // Insert decimal point between first and second digits
 292   2                      itoa(cpu_voltage/100, text, 10);
 293   2                      i=strlen(text);
 294   2                      text[i]='.';
 295   2                      i++;
 296   2                      itoa(cpu_voltage%100, text+i, 11);
 297   2                      replace_tag(outbuf + 54, "TAG:VOL1", text);
 298   2            
 299   2            // Insert the word CHECKED into the html so the browser will
 300   2                      // check the correct LED state indicator box 
 301   2            if (CONTROL_LED == OFF) replace_tag(outbuf + 54, "TAG:CHK1", "CHECKED");
 302   2            else replace_tag(outbuf + 54, "TAG:CHK2", "CHECKED");
 303   2            
C51 COMPILER V7.06   HTTP                                                                  07/29/2006 13:15:57 PAGE 6   

 304   2            // Segment length = body_len + 20
 305   2            http_send(outbuf, body_len + 20, nr);
 306   2            conxn[nr].my_sequence += body_len;
 307   2         }
 308   1         else if (request == GET_JPEG)
 309   1         {
 310   2            // Ths browser has requested the jpeg image.  First figure out
 311   2            // sizes - cannot use sizeof() for jpeg here because it is in
 312   2            // another module.  Just directly specify length of it
 313   2            jhdr_len = strlen(jpeg_header);
 314   2            jpeg_len = 5705;//6194;
 315   2            body_len = jhdr_len + jpeg_len;
 316   2            
 317   2            // Free memory holding received message.  The message from the
 318   2            // browser can be 500+ bytes long so this is a significant 
 319   2            // chunk out of the available malloc space of 1500 bytes
 320   2            if (!resend) {free(inbuf); rcve_buf_allocated = FALSE;}
 321   2      
 322   2            // First send the header and enough of the jpeg to make 1000 bytes.
 323   2            // The value of 1000 is arbitrary, but must be stay under 1500. 
 324   2            if (body_len < 1000) remaining = body_len; else remaining = 1000; 
 325   2            outbuf = (UCHAR xdata *)malloc(54 + remaining + 1);
 326   2            if (outbuf == NULL)
 327   2            {
 328   3               if (debug) serial_send("TCP: Oops, out of memory\r");
 329   3               return 0;
 330   3            }
 331   2            
 332   2            memcpy(outbuf + 54, jpeg_header, jhdr_len);
 333   2                      memcpy(outbuf + 54 + jhdr_len, photo1_jpeg, remaining - jhdr_len);
 334   2                        
 335   2            outbuf[54 + remaining] = 0;               // Append NULL
 336   2      
 337   2            // Replace jpeg length tag with actual value
 338   2            itoa(jpeg_len, text, 10);
 339   2                      replace_tag(outbuf + 54, "TAG:LEN2", text);
 340   2      
 341   2            http_send(outbuf, remaining + 20, nr);
 342   2            sent = remaining - jhdr_len;
 343   2            conxn[nr].my_sequence += remaining;
 344   2           
 345   2            // Send the rest of the jpeg file in 1000 byte chunks.  This sends about
 346   2            // 6 segments of 1000 bytes back to back, but we should actually process
 347   2            // acks from the other end to make sure we are not sending more than the
 348   2            // other end can receive.  Most systems can handle 6K
 349   2            while (sent < jpeg_len)
 350   2            {
 351   3               remaining = jpeg_len - sent;
 352   3               if (remaining > 1000) remaining = 1000;
 353   3               outbuf = (UCHAR xdata *)malloc(54 + remaining + 1);
 354   3               if (outbuf == NULL)
 355   3               {
 356   4                  if (debug) serial_send("TCP: Oops, out of memory\r");
 357   4                  return 0;
 358   4               }
 359   3               
 360   3               memcpy(outbuf + 54, photo1_jpeg + sent, remaining);
 361   3                                 
 362   3               outbuf[54 + remaining] = 0;            // Append NULL
 363   3               http_send(outbuf, remaining + 20, nr);
 364   3               sent += remaining;
 365   3               conxn[nr].my_sequence += remaining;
C51 COMPILER V7.06   HTTP                                                                  07/29/2006 13:15:57 PAGE 7   

 366   3            }
 367   2         }
 368   1         else
 369   1         {
 370   2            // The incoming HTTP message did not warrant a response
 371   2            if (debug) serial_send("HTTP: No response sent\r");
 372   2            return 0;
 373   2         }
 374   1         
 375   1         // Return number of bytes sent, not including TCP header
 376   1              return(body_len);
 377   1      }
 378          
 379          
 380          
 381          
 382          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   2397    ----
   CONSTANT SIZE    =    184    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----      39
   IDATA SIZE       =      1      23
   BIT SIZE         =      1    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一二三精品| 亚洲一区欧美一区| 国产一区二区美女诱惑| 久久久久青草大香线综合精品| 精品一区二区免费看| 久久久精品黄色| 不卡av在线免费观看| 最新热久久免费视频| 欧美日韩亚洲综合一区二区三区| 日韩成人一级大片| 日韩亚洲欧美成人一区| 国产乱人伦精品一区二区在线观看| 亚洲精品日韩综合观看成人91| 色综合久久天天| 婷婷国产在线综合| 26uuuu精品一区二区| 国产白丝精品91爽爽久久 | 91久久国产综合久久| 婷婷成人激情在线网| 久久夜色精品一区| 91老师片黄在线观看| 日本亚洲视频在线| 国产精品少妇自拍| 欧美精品一二三| 欧美日韩高清一区二区| 久久成人综合网| 亚洲欧美日韩中文字幕一区二区三区 | 懂色av一区二区夜夜嗨| 亚洲一二三区在线观看| 亚洲精品一区二区三区精华液| 99久久综合99久久综合网站| 日韩国产在线一| 国产精品成人免费| 日韩视频不卡中文| 色综合一个色综合亚洲| 久久国产麻豆精品| 亚洲精品水蜜桃| 久久精品亚洲国产奇米99| 欧美日韩一区三区| 成人看片黄a免费看在线| 日本欧美一区二区在线观看| 亚洲天堂av老司机| 久久蜜臀中文字幕| 这里只有精品视频在线观看| 91视频国产资源| 国产成人高清在线| 久久er精品视频| 香蕉av福利精品导航| 中文字幕五月欧美| 久久精品免费在线观看| 日韩欧美中文字幕一区| 欧美在线制服丝袜| 99麻豆久久久国产精品免费| 狠狠色丁香久久婷婷综| 首页国产欧美日韩丝袜| 亚洲视频免费在线| 国产精品久久久久久久蜜臀| 久久婷婷色综合| 日韩精品最新网址| 欧美美女黄视频| 欧美中文字幕一区二区三区亚洲| 成人av免费在线| 成人性生交大片免费| 国产一区欧美一区| 国产呦萝稀缺另类资源| 激情久久五月天| 国产乱码一区二区三区| 韩国在线一区二区| 国产最新精品免费| 国内精品嫩模私拍在线| 九九精品视频在线看| 免费黄网站欧美| 久久电影网站中文字幕| 免费观看30秒视频久久| 日韩电影在线一区| 日本欧美一区二区在线观看| 日本欧美一区二区三区乱码| 免费在线观看一区二区三区| 日本成人在线视频网站| 麻豆成人免费电影| 久久精工是国产品牌吗| 国模无码大尺度一区二区三区| 国产一区二三区| 欧美性色黄大片手机版| 日本二三区不卡| 欧美色中文字幕| 欧美久久久影院| 日韩精品资源二区在线| 久久精品视频在线看| 欧美国产一区视频在线观看| 国产精品女人毛片| 亚洲男人的天堂一区二区| 亚洲一区自拍偷拍| 日韩制服丝袜先锋影音| 蜜乳av一区二区| 国产99久久久国产精品潘金网站| 成人黄动漫网站免费app| 色综合久久久久| 欧美日韩国产区一| 精品久久免费看| 国产精品免费看片| 亚洲高清免费视频| 国产精品中文字幕日韩精品| 成人国产精品视频| 精品视频在线免费| 久久只精品国产| 亚洲免费在线观看视频| 免费在线观看精品| 成人高清免费在线播放| 欧美日韩国产精品自在自线| 精品蜜桃在线看| 亚洲免费av高清| 另类综合日韩欧美亚洲| 99这里都是精品| 日韩视频免费直播| 亚洲欧洲性图库| 蜜臀av一级做a爰片久久| 成人午夜伦理影院| 在线播放/欧美激情| 欧美国产禁国产网站cc| 亚洲一区电影777| 国产成人av影院| 欧美日韩高清在线播放| 日本一区二区三区国色天香 | 午夜视频在线观看一区二区| 久久99国产精品久久| 久久网站最新地址| 婷婷一区二区三区| caoporen国产精品视频| 欧美一区二区播放| 亚洲黄色在线视频| 国产精品亚洲综合一区在线观看| 欧美伊人久久久久久午夜久久久久| 久久蜜桃一区二区| 奇米影视7777精品一区二区| 91在线视频网址| 欧美国产一区二区在线观看| 男女男精品网站| 欧美日韩国产一二三| 亚洲人午夜精品天堂一二香蕉| 精品写真视频在线观看| 欧美日韩国产成人在线91| 亚洲品质自拍视频网站| 粉嫩一区二区三区性色av| 日韩欧美成人一区二区| 亚洲福中文字幕伊人影院| 色综合一个色综合亚洲| 国产精品色婷婷| 国产精品香蕉一区二区三区| 欧美一区二区不卡视频| 首页国产欧美久久| 欧美性欧美巨大黑白大战| 综合网在线视频| 成人av电影在线观看| 久久久www成人免费毛片麻豆| 蜜臀av性久久久久蜜臀aⅴ | 日本一区二区电影| 国产在线精品一区二区不卡了 | 亚洲伦理在线免费看| 成人福利电影精品一区二区在线观看| 日韩精品一区二区在线观看| 日韩av午夜在线观看| 欧美日韩国产精品自在自线| 亚洲不卡一区二区三区| 欧美性大战xxxxx久久久| 一区二区在线观看视频在线观看| 成人国产一区二区三区精品| 国产精品久久久久影院色老大| 国产激情91久久精品导航| 久久这里只有精品6| 国产精品 日产精品 欧美精品| 精品国产sm最大网站免费看| 国精品**一区二区三区在线蜜桃| 2021国产精品久久精品| 国产成人福利片| 国产精品麻豆网站| 一本久道久久综合中文字幕| 尤物在线观看一区| ●精品国产综合乱码久久久久| 国产成人无遮挡在线视频| 国产精品色哟哟| 日本韩国欧美国产| 日韩精品电影一区亚洲| 日韩三级av在线播放| 国产一区 二区| 国产精品初高中害羞小美女文| 色综合中文字幕| 日韩av一区二区三区| 2014亚洲片线观看视频免费| 东方欧美亚洲色图在线| 亚洲视频在线一区二区| 91高清视频在线| 捆绑变态av一区二区三区| 久久久激情视频| 在线亚洲高清视频| 久久精品国产99久久6| 国产精品福利一区二区三区| 欧美写真视频网站| 国产乱对白刺激视频不卡| 中文字幕在线不卡|