Add skeleton of program.
This commit is contained in:
25
src/CMakeLists.txt
Normal file
25
src/CMakeLists.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(domo-iot)
|
||||
|
||||
set (CMAKE_MODULE_PATH "${MODULE_PATH}")
|
||||
set (CMAKE_CXX_STANDARD 11)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/../nats.c/src)
|
||||
|
||||
#set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Werror=strict-aliasing")
|
||||
|
||||
file(
|
||||
GLOB_RECURSE
|
||||
source_files
|
||||
domo-iot.c
|
||||
)
|
||||
|
||||
add_executable (domo-iot ${source_files})
|
||||
|
||||
target_link_libraries (domo-iot
|
||||
LINK_PUBLIC
|
||||
rt
|
||||
)
|
||||
|
||||
install (TARGETS domo-iot DESTINATION local/bin)
|
||||
45
src/domo-iot.c
Normal file
45
src/domo-iot.c
Normal file
@@ -0,0 +1,45 @@
|
||||
/*!
|
||||
* domi-iot.cpp
|
||||
*
|
||||
* Copyright (c) 2015-2019, NADAL Jean-Baptiste. All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*
|
||||
* @Author: NADAL Jean-Baptiste
|
||||
* @Date: 08/11/2019
|
||||
*
|
||||
*/
|
||||
|
||||
/*-------------------------------- INCLUDES ---------------------------------*/
|
||||
|
||||
#include <nats.h>
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
* @fn main
|
||||
*
|
||||
* @brief Main function of domo-iot daemon.
|
||||
*/
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
natsConnection *conn = NULL;
|
||||
natsSubscription *sub = NULL;
|
||||
natsStatus s;
|
||||
volatile bool done = false;
|
||||
|
||||
printf("Listening on subject 'foo'\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user