Skip to content

Commit

Permalink
Added IChatBot thrift communication protocol
Browse files Browse the repository at this point in the history
Added the thrift file and the generated c++ code for the communication protocol between chatBot_nws_yarp and chatBot_nwc_yarp
  • Loading branch information
elandini84 committed Sep 6, 2023
1 parent e2b541a commit df1e72d
Show file tree
Hide file tree
Showing 20 changed files with 4,643 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/devices/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ yarp_begin_plugin_library(yarpmod
add_subdirectory(portaudioPlayer)
add_subdirectory(portaudioRecorder)
add_subdirectory(imuBosch_BNO055)
add_subdirectory(IChatBotMsgs)
add_subdirectory(ILLMMsgs)
add_subdirectory(IAudioGrabberMsgs)
add_subdirectory(IMap2DMsgs)
Expand Down
24 changes: 24 additions & 0 deletions src/devices/IChatBotMsgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
# SPDX-License-Identifier: BSD-3-Clause

if(NOT YARP_COMPILE_DEVICE_PLUGINS)
return()
endif()

include(YarpChooseIDL)
yarp_choose_idl(ICHATBOTMSGS_THRIFT IChatBotMsgs.thrift)

add_library(IChatBotMsgs OBJECT)

target_sources(IChatBotMsgs PRIVATE ${ICHATBOTMSGS_THRIFT_GEN_FILES})

target_link_libraries(IChatBotMsgs
PRIVATE
YARP::YARP_dev
YARP::YARP_os
YARP::YARP_sig
)

target_include_directories(IChatBotMsgs PUBLIC ${ICHATBOTMSGS_THRIFT_BUILD_INTERFACE_INCLUDE_DIRS})

set_property(TARGET IChatBotMsgs PROPERTY FOLDER "Devices/Shared")
28 changes: 28 additions & 0 deletions src/devices/IChatBotMsgs/IChatBotMsgs.thrift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
* SPDX-License-Identifier: BSD-3-Clause
*/

struct return_interact{
1: bool result;
2: string messageOut;
}

struct return_getLanguage{
1: bool result;
2: string language;
}

struct return_backupBot{
1: bool result;
2: string backupString;
}

service IChatBotMsgs {
return_interact interactRPC(1: string messageIn);
bool setLanguageRPC(1: string language);
return_getLanguage getLanguageRPC();
bool resetBotRPC();
return_backupBot backupBotRPC();
bool restoreBotRPC(1: string botToRestore);
}
Loading

0 comments on commit df1e72d

Please sign in to comment.