This commit is contained in:
stephb9959
2021-02-12 09:47:35 -08:00
parent efe29b15b7
commit c5dc3aa5d3
9 changed files with 75 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.10)
project(ucentral)
set(CMAKE_CXX_STANDARD 20)
@@ -6,17 +6,13 @@ set(CMAKE_CXX_STANDARD 20)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(cpprestsdk_DIR /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/cmake/)
find_package(cpprestsdk REQUIRED)
find_package(Boost REQUIRED COMPONENTS thread system)
find_package(Boost REQUIRED system)
find_package(OpenSSL REQUIRED)
include_directories(/usr/local/include /usr/local/opt/openssl/include)
# link_directories(/usr/local/lib /usr/local/opt/openssl/lib)
add_executable(ucentral main.cpp)
target_link_libraries(ucentral PRIVATE cpprestsdk::cpprest ${Boost_LIBRARIES})
add_executable(ucentral src/main.cpp src/gateway.cpp src/gateway.h src/ucentralServer.cpp src/ucentralServer.h src/tipApi.cpp src/tipApi.h)
target_link_libraries(ucentral PRIVATE cpprestsdk::cpprest ${Boost_LIBRARIES})

View File

@@ -1,8 +1,27 @@
# ucentralgw
# uCentralGW
## What is this?
The uCentralGW is an added service for the TIP controller that allows integration with the
uCentral protocol. It is meant to run as a pod inside a TIP controller container. It should
have a single port open to provide connection from uCentral enabled devices.
## Building
In order to build the uCentralGW, you will need to install some of its dependencies, which includes
the following
- cmake
- boost
- cpprest
- a C++20 compiler
### Ubuntu build
```
sudo apt install libboost-dev cpprestsdk-dev cmake gcc
git clone <this repo name>
cd ucentralgw
mmkdir cmake-build-debug
cd cmake-build-debug
cmake ..
make
```
conan install . -s build_type=Debug --install-folder=cmake-build-debug
conan install . -s build_type=Release --install-folder=cmake-build-release
```

8
src/gateway.cpp Normal file
View File

@@ -0,0 +1,8 @@
//
// Created by stephane bourque on 2021-02-12.
//
// This is the implementation of the tipapi/gw/equipment-gateway-service-openapi.yaml
#include "gateway.h"

8
src/gateway.h Normal file
View File

@@ -0,0 +1,8 @@
//
// Created by stephane bourque on 2021-02-12.
//
#ifndef UCENTRAL_GATEWAY_H
#define UCENTRAL_GATEWAY_H
#endif //UCENTRAL_GATEWAY_H

5
src/tipApi.cpp Normal file
View File

@@ -0,0 +1,5 @@
//
// Created by stephane bourque on 2021-02-12.
//
#include "tipApi.h"

10
src/tipApi.h Normal file
View File

@@ -0,0 +1,10 @@
//
// Created by stephane bourque on 2021-02-12.
//
// This implements the various calls to the tipController
#ifndef UCENTRAL_TIPAPI_H
#define UCENTRAL_TIPAPI_H
#endif //UCENTRAL_TIPAPI_H

7
src/ucentralServer.cpp Normal file
View File

@@ -0,0 +1,7 @@
//
// Created by stephane bourque on 2021-02-12.
//
// This receives all the connections from the uCentral enabled devices
#include "ucentralServer.h"

8
src/ucentralServer.h Normal file
View File

@@ -0,0 +1,8 @@
//
// Created by stephane bourque on 2021-02-12.
//
#ifndef UCENTRAL_UCENTRALSERVER_H
#define UCENTRAL_UCENTRALSERVER_H
#endif //UCENTRAL_UCENTRALSERVER_H