Skip to content

Commit

Permalink
Merge pull request #10 from Azure-Samples/netxduo
Browse files Browse the repository at this point in the history
Add projects for TCP echo client and server
  • Loading branch information
TiejunMS authored Jun 15, 2023
2 parents 290699f + 45cf459 commit fe8247f
Show file tree
Hide file tree
Showing 8 changed files with 761 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@
{
"label": "03",
"value": "ProjectUDPEchoServer"
},
{
"label": "04",
"value": "ProjectTCPEchoClient"
},
{
"label": "05",
"value": "ProjectTCPEchoServer"
}
],
"default": "ProjectHelloWorld"
Expand Down
34 changes: 34 additions & 0 deletions courses/netxduo/ProjectTCPEchoClient/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

cmake_minimum_required(VERSION 3.13..3.22 FATAL_ERROR)
set(CMAKE_C_STANDARD 99)

# Define paths
set(BASE_DIR ${CMAKE_SOURCE_DIR}/../../..)
set(LIBS_DIR ${BASE_DIR}/libs)

include(${BASE_DIR}/cmake/linux.cmake)

if(NOT DEFINED IF_NAME)
set(IF_NAME "veth1")
endif()
message(STATUS "Bind to interface: ${IF_NAME}")

set(NX_USER_FILE ${CMAKE_SOURCE_DIR}/nx_user.h)

set(NXD_ENABLE_FILE_SERVERS
OFF
CACHE BOOL "Includes a dependency on FileX to support 'server' protocol handlers (default is ON)")

# Project
set(PROJECT ProjectTCPEchoClient)
project(${PROJECT} VERSION 0.1.0 LANGUAGES C)

add_subdirectory(${LIBS_DIR}/threadx lib/threadx)
add_subdirectory(${LIBS_DIR}/netxduo lib/netxduo)

add_executable(${PROJECT} main.c ../Driver/nx_linux_network_driver.c)

target_link_libraries(${PROJECT} PUBLIC azrtos::netxduo)
target_compile_definitions(${PROJECT} PUBLIC -DNX_LINUX_INTERFACE_NAME=\"${IF_NAME}\")
Loading

0 comments on commit fe8247f

Please sign in to comment.