国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

做誘惑類cpa網(wǎng)站經(jīng)驗(yàn)電商軟文廣告經(jīng)典案例

做誘惑類cpa網(wǎng)站經(jīng)驗(yàn),電商軟文廣告經(jīng)典案例,c語言網(wǎng)站開發(fā),沈陽電商網(wǎng)站建設(shè)httpd 是 Apache HTTP Server 的守護(hù)進(jìn)程名稱,Apache HTTP Server 是一種廣泛使用的開源網(wǎng)頁服務(wù)器軟件。 本項(xiàng)目是從LwIP中抽取的HTTP服務(wù)器代碼; Hi3861 SDK中已經(jīng)包含了一份預(yù)編譯的lwip,但沒有開啟HTTP服務(wù)器功能(靜態(tài)庫無法…

httpd 是 Apache HTTP Server 的守護(hù)進(jìn)程名稱,Apache HTTP Server 是一種廣泛使用的開源網(wǎng)頁服務(wù)器軟件。

本項(xiàng)目是從LwIP中抽取的HTTP服務(wù)器代碼;

`Hi3861 SDK`中已經(jīng)包含了一份預(yù)編譯的lwip,但沒有開啟HTTP服務(wù)器功能(靜態(tài)庫無法修改);

HTTP 服務(wù)器特性

目前已測(cè)試通過的功能有:

  1. 通過HTTP訪問靜態(tài)資源文件
  2. 通過cgi回調(diào)函數(shù)處理表單和頁面跳轉(zhuǎn)

靜態(tài)資源文件:

  • 本服務(wù)器實(shí)現(xiàn)不支持實(shí)際的服務(wù)端本地文件系統(tǒng)訪問;
  • 取而代之的是,一種簡(jiǎn)單的虛擬文件系統(tǒng):
    • \\third_party\httpd\src\http\fs.c 文件提供了一套文件系統(tǒng)接口,使用數(shù)組直接存儲(chǔ)文件數(shù)據(jù)
    • \\third_party\httpd\src\http\fsdata.c文件是由 makefsdata命令生成的虛擬文件系統(tǒng)元數(shù)據(jù)文件
    • makefsdata 命令行工具,用于將一個(gè)目錄下的靜態(tài)資源文件轉(zhuǎn)換為 fsdata.c文件

代碼編寫

修改D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\BUILD.gn文件

# Copyright (c) 2023 Beijing HuaQing YuanJian Education Technology Co., Ltd
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#    http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License. import("//build/lite/config/component/lite_component.gni")lite_component("demo") {features = [#"base_00_helloworld:base_helloworld_example",#"base_01_led:base_led_example",#"base_02_loopkey:base_loopkey_example",#"base_03_irqkey:base_irqkey_example",#"base_04_adc:base_adc_example",#"base_05_pwm:base_pwm_example",#"base_06_ssd1306:base_ssd1306_example",#"kernel_01_task:kernel_task_example",#"kernel_02_timer:kernel_timer_example",#"kernel_03_event:kernel_event_example",#"kernel_04_mutex:kernel_mutex_example",#"kernel_05_semaphore_as_mutex:kernel_semaphore_as_mutex_example",#"kernel_06_semaphore_for_sync:kernel_semaphore_for_sync_example",#"kernel_07_semaphore_for_count:kernel_semaphore_for_count_example",#"kernel_08_message_queue:kernel_message_queue_example",#"wifi_09_hotspot:wifi_hotspot_example",#"wifi_10_sta:wifi_sta_example",#"tcp_11_server:tcp_server_example",#"tcp_12_client:tcp_client_example",#"udp_13_server:udp_server_example",#"udp_14_client:udp_client_example",#"network_15_mqtt:network_mqtt_example",#"network_16_sntp:network_sntp_example","network_17_httpd:network_httpd_example",]
}

創(chuàng)建D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\network_17_httpd文件夾

文件夾中創(chuàng)建D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\network_17_httpd\BUILD.gn文件

# Copyright (c) 2020, HiHope Community.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
#    list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
#    this list of conditions and the following disclaimer in the documentation
#    and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
#    contributors may be used to endorse or promote products derived from
#    this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.static_library("network_httpd_example") {sources = ["network_httpd_example.c","wifi_connecter.c","//third_party/httpd/src/core/altcp.c","//third_party/httpd/src/core/altcp_tcp.c","//third_party/httpd/src/http/fs.c","//third_party/httpd/src/http/httpd.c","//third_party/httpd/src/tcp_port.c",# "//third_party/httpd/src/pbuf_port.c",]defines = ["LWIP_DEBUG","HTTPD_DEBUG=0xA0","LWIP_DBG_TYPES_ON=LWIP_DBG_ON","LWIP_HTTPD_SSI"]include_dirs = ["//third_party/httpd/include","//third_party/httpd/include/lwip/apps","//foundation/communication/wifi_lite/interfaces/wifiservice","//vendor/hisi/hi3861/hi3861/third_party/lwip_sack/include/",]
}

文件夾中創(chuàng)建D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\network_17_httpd\wifi_connecter.h文件,該頭文件包含wifi連接的宏。文件同network_16_sntp\wifi_connecter.h

文件夾中創(chuàng)建D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\network_17_httpd\wifi_connecter.c文件,文件同network_16_sntp\wifi_connecter.c

文件夾中創(chuàng)建D:\DevEcoProjects\test\src\vendor\rtplay\rt_hi3861\demo\network_17_httpd\network_httpd_example.c文件

/** Copyright (c) 2020, HiHope Community.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions are met:** 1. Redistributions of source code must retain the above copyright notice, this*    list of conditions and the following disclaimer.** 2. Redistributions in binary form must reproduce the above copyright notice,*    this list of conditions and the following disclaimer in the documentation*    and/or other materials provided with the distribution.** 3. Neither the name of the copyright holder nor the names of its*    contributors may be used to endorse or promote products derived from*    this software without specific prior written permission.** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/#include <stdio.h>
#include "ohos_init.h"
#include "cmsis_os2.h"
// #include "wifiiot_at.h"#include "httpd.h"
#include "wifi_connecter.h"static int g_netId = -1;
#define STACK_SIZE  (4096)#ifdef LWIP_HTTPD_CGI
const char *HelloHandler(int iIndex, int nParams, char *pcParam[], char *pcValue[])
{printf("HelloHandler\r\n");printf("iIndex = %d\r\n", iIndex);for (int i = 0; i < nParams; i++) {printf("pcParam[%d] = '%s'\r\n", i, pcParam[i]);printf("pcValue[%d] = '%s'\r\n", i, pcValue[i]);}return "/index.html"; // forward to home page.
}static tCGI g_cgiHandlers[] = {{ "/hello", HelloHandler },
};
#endif#if LWIP_HTTPD_SSI
u16_t FooSsiHandler(
#if LWIP_HTTPD_SSI_RAWconst char* tag,
#else /* LWIP_HTTPD_SSI_RAW */int tag,
#endif /* LWIP_HTTPD_SSI_RAW */char *pcInsert, int iInsertLen
#if LWIP_HTTPD_SSI_MULTIPART, u16_t currentTagPart, u16_t *nextTagPart
#endif /* LWIP_HTTPD_SSI_MULTIPART */
#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE, void *connectionState
#endif /* LWIP_HTTPD_FILE_STATE */
)
{printf("FooSsiHandler\r\n");#if LWIP_HTTPD_SSI_RAWprintf("tag = %s\r\n", tag);
#elseprintf("tag = %d\r\n", tag);
#endifprintf("insertLen = %d\r\n", iInsertLen);printf("insertText = %s\r\n", pcInsert);return 0;
}
#endifstatic void HttpdTask(void)
{WifiDeviceConfig config = {0};// 準(zhǔn)備AP的配置參數(shù)// strcpy(config.ssid, PARAM_HOTSPOT_SSID);// strcpy(config.preSharedKey, PARAM_HOTSPOT_PSK);strcpy_s(config.ssid, WIFI_MAX_SSID_LEN, PARAM_HOTSPOT_SSID);strcpy_s(config.preSharedKey, WIFI_MAX_KEY_LEN, PARAM_HOTSPOT_PSK);config.securityType = PARAM_HOTSPOT_TYPE;g_netId = ConnectToHotspot(&config);printf("netId = %d\r\n", g_netId);#ifdef LWIP_HTTPD_CGIhttp_set_cgi_handlers(g_cgiHandlers, LWIP_ARRAYSIZE(g_cgiHandlers));
#endif#ifdef LWIP_HTTPD_SSIhttp_set_ssi_handler(FooSsiHandler, NULL, 0);
#endifhttpd_init();
}static void HttpdEntry(void)
{osThreadAttr_t attr = {0};attr.name = "HttpdTask";attr.stack_size = STACK_SIZE;attr.priority = osPriorityNormal;if (osThreadNew(HttpdTask, NULL, &attr) == NULL) {printf("[HttpdEntry] create HttpdTask failed!\n");}
}
SYS_RUN(HttpdEntry);

使用build,編譯成功后,使用upload進(jìn)行燒錄。

訪問網(wǎng)頁

串口輸出

http://aloenet.com.cn/news/31197.html

相關(guān)文章:

  • 羅源福州網(wǎng)站建設(shè)百度首頁排名優(yōu)化公司
  • 企業(yè)網(wǎng)站設(shè)計(jì)注意事項(xiàng)外國(guó)網(wǎng)站怎么進(jìn)入
  • 如何建設(shè)一個(gè)小型網(wǎng)站網(wǎng)絡(luò)營(yíng)銷渠道有哪些
  • 唐山網(wǎng)站建設(shè)七彩科技怎么關(guān)鍵詞優(yōu)化網(wǎng)站
  • 在putty做網(wǎng)站要拷貝什么seo資源網(wǎng)站排名
  • 潛江資訊網(wǎng)官網(wǎng)黑帽seo培訓(xùn)網(wǎng)
  • wordpress 作者 英文網(wǎng)站建設(shè)方案優(yōu)化
  • 12380網(wǎng)站建設(shè)情況總結(jié)海外銷售平臺(tái)有哪些
  • 做個(gè)公司網(wǎng)站多少錢鏈接平臺(tái)
  • 標(biāo)準(zhǔn)型網(wǎng)站構(gòu)建焊工培訓(xùn)
  • 做百科需要參考的網(wǎng)站谷歌seo排名優(yōu)化
  • 關(guān)鍵詞優(yōu)化招商搜索引擎seo
  • 徐匯網(wǎng)站制作設(shè)計(jì)圖片搜索
  • 網(wǎng)站建設(shè)租房網(wǎng)模塊專業(yè)網(wǎng)絡(luò)推廣機(jī)構(gòu)
  • 建正建設(shè)集團(tuán)有限公司網(wǎng)站萬網(wǎng)域名注冊(cè)查詢
  • 溫州龍灣區(qū)企業(yè)網(wǎng)站搭建價(jià)格百度平臺(tái)聯(lián)系方式
  • 怎么免費(fèi)增加網(wǎng)站流量嗎域名解析
  • 在政府網(wǎng)站建設(shè)工作會(huì)上的講話百度推廣的方式有哪些
  • 有什么網(wǎng)站用名字做圖片大全鄭州網(wǎng)絡(luò)公司排名
  • 北京網(wǎng)站公司免費(fèi)推廣網(wǎng)站有哪些
  • 怎么把視頻做成網(wǎng)頁鏈接搜索引擎優(yōu)化是做什么的
  • 上海網(wǎng)站推廣 優(yōu)幫云4001688688人工服務(wù)
  • 南昌網(wǎng)站建設(shè)網(wǎng)站推廣買外鏈有用嗎
  • 網(wǎng)站建設(shè)與web前端區(qū)別電商運(yùn)營(yíng)的基本內(nèi)容
  • 邢臺(tái)有什么網(wǎng)站營(yíng)銷推廣的平臺(tái)
  • 武進(jìn)網(wǎng)站建設(shè)價(jià)位免費(fèi)投放廣告的平臺(tái)
  • 網(wǎng)絡(luò)營(yíng)銷自己做網(wǎng)站百度怎么發(fā)廣告
  • 內(nèi)容企業(yè)推廣河南seo網(wǎng)站多少錢
  • wordpress chastityseo是什么工作內(nèi)容
  • 企業(yè)網(wǎng)站推廣策略百度快速提交入口