Commit e35e8913 authored by Alexander Kozhinov's avatar Alexander Kozhinov Committed by Jukka Rissanen
Browse files

samples: net: civetweb: Refractor code structure


move all CivetWeb samples to one directory
add directory with CivetWeb common includes
update cmake files
move civetweb sample folder to samples/net
Signed-off-by: default avatarAlexander Kozhinov <AlexanderKozhinov@yandex.com>
parent 52ad9a46
/*
* Copyright (c) 2019 Antmicro Ltd
* Copyright (c) 2020 Alexander Kozhinov
* Mail: AlexanderKozhinov@yandex.com
*
......
/*
* Copyright (c) 2019 Antmicro Ltd
* Copyright (c) 2020 Alexander Kozhinov
* Mail: AlexanderKozhinov@yandex.com
*
......
# Copyright (c) 2020 Alexander Kozhinov
# Mail: AlexanderKozhinov@yandex.com
#
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.13.1)
set(common_dir ${CMAKE_CURRENT_SOURCE_DIR}/../common)
set(common_src_dir ${common_dir}/src)
set(common_include_dir ${common_dir}/include)
include_directories(
${common_include_dir}
)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(civetweb_http_server)
target_sources(app PRIVATE
src/main.c
${common_src_dir}/libc_extensions.c
)
.. _sockets-civetweb-sample:
.. _civetweb-http_server-sample:
Civetweb sample
###############
......@@ -10,7 +10,7 @@ This sample application uses the HTTP APIs provided by the external `Civetweb <h
The Civetweb module is available as a west :ref:`module <modules>`.
The source code for this sample application can be found at:
:zephyr_file:`samples/net/sockets/civetweb`.
:zephyr_file:`samples/net/civetweb/http_server`.
Requirements
************
......@@ -26,7 +26,7 @@ This sample was tested on the Atmel SAM E70 Xplained board, so this is the recom
Build it with:
.. zephyr-app-commands::
:zephyr-app: samples/net/sockets/civetweb
:zephyr-app: samples/net/civetweb/http_server
:board: sam_e70_xplained
:goals: build
:compact:
......
sample:
description: Civetweb HTTP API sample
name: civetweb
name: http_server
tests:
sample.net.sockets.civetweb:
sample.net.civetweb.http_server:
platform_allow: sam_e70_xplained
......@@ -5,10 +5,17 @@
cmake_minimum_required(VERSION 3.13.1)
set(common_dir ${CMAKE_CURRENT_SOURCE_DIR}/../common)
set(common_src_dir ${common_dir}/src)
set(common_include_dir ${common_dir}/include)
set(inc_dir ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(src_dir ${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${inc_dir})
include_directories(
${inc_dir}
${common_include_dir}
)
option(CIVETWEB_ENABLE_WEBSOCKETS "Enable websockets connections" ON)
......@@ -17,7 +24,7 @@ project(civetweb_websocket_server)
target_sources(app PRIVATE
${src_dir}/main.c
${src_dir}/libc_extensions.c
${common_src_dir}/libc_extensions.c
${src_dir}/http_server_handlers.c
${src_dir}/websocket_server_handlers.c)
......
.. _sockets-civetweb-websocket-server-sample:
.. _civetweb-websocket-server-sample:
Civetweb WebSocket Server sample
################################
......@@ -12,7 +12,7 @@ server demonstrating selected Civetweb features.
The Civetweb module is available as a west :ref:`module <modules>`.
The source code for this sample application can be found at:
:zephyr_file:`samples/net/sockets/civetweb_websocket_server`.
:zephyr_file:`samples/net/civetweb/websocket_server`.
Requirements
************
......@@ -28,7 +28,7 @@ This sample was tested on the NUCLEO H745ZI-Q board, so this is the recommended
Build it with:
.. zephyr-app-commands::
:zephyr-app: samples/net/sockets/civetweb_websocket_server
:zephyr-app: samples/net/civetweb/websocket_server
:board: nucleo_h745zi_q_m7
:goals: build
:compact:
......@@ -37,8 +37,8 @@ The sample application uses a static IP configuration.
After flashing the board, the server can be accessed with the web browser
of your choice (preferably Chrome) under ``192.0.2.1`` IPv4 address.
The IP address can be changed in :zephyr_file:`samples/net/sockets/civetweb_websocket_server/prj.conf`
The port number can be changed in :zephyr_file:`samples/net/sockets/civetweb_websocket_server/main.c`
The IP address can be changed in :zephyr_file:`samples/net/civetweb/websocket_server/prj.conf`
The port number can be changed in :zephyr_file:`samples/net/civetweb/websocket_server/main.c`
This sample application consists of two main parts:
......
sample:
description: Civetweb WebSocket Server sample
name: civetweb_websocket_server
name: websocket_server
tests:
sample.net.sockets.civetweb_websocket_server:
sample.net.civetweb.websocket_server:
platform_allow: nucleo_h745zi_q_m7
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment