From 9e2c045d6118ef264d6cf8fc655b72d7c4c403dc Mon Sep 17 00:00:00 2001 From: Angelo Mantellini Date: Tue, 9 Jun 2020 14:48:02 +0200 Subject: [HICN-626] Return output from libhicnlight Signed-off-by: Angelo Mantellini Change-Id: I2351ce4dcefa1311fa09049f87e8317c8fe449f4 --- .../src/hicn/command_line/controller/hicnLightControl_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'hicn-light/src/hicn/command_line/controller') diff --git a/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c b/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c index 8f56dc60a..31b9674ca 100644 --- a/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c +++ b/hicn-light/src/hicn/command_line/controller/hicnLightControl_main.c @@ -340,6 +340,9 @@ int main(int argc, char *argv[]) { mainState.controlState = controlState_Create(&mainState, _writeAndReadMessage, true, server_ip, server_port); + if (mainState.controlState == NULL) { + exit(EXIT_FAILURE); + } controlState_RegisterCommand(mainState.controlState, controlRoot_HelpCreate(mainState.controlState)); @@ -348,7 +351,9 @@ int main(int argc, char *argv[]) { if (parcList_Size(commands) > 0) { controlState_SetInteractiveFlag(mainState.controlState, false); - controlState_DispatchCommand(mainState.controlState, commands); + char output[8192]; + controlState_DispatchCommand(mainState.controlState, commands, output, sizeof(output)); + printf("%s", output); char **commandOutputMain = controlState_GetCommandOutput(mainState.controlState); if (commandOutputMain != NULL && commandOutputLen > 0) { -- cgit 1.2.3-korg