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 --- hicn-light/src/hicn/config/controlMapMeDiscovery.c | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'hicn-light/src/hicn/config/controlMapMeDiscovery.c') diff --git a/hicn-light/src/hicn/config/controlMapMeDiscovery.c b/hicn-light/src/hicn/config/controlMapMeDiscovery.c index 814c380de..6ec941141 100644 --- a/hicn-light/src/hicn/config/controlMapMeDiscovery.c +++ b/hicn-light/src/hicn/config/controlMapMeDiscovery.c @@ -29,10 +29,14 @@ static CommandReturn _controlMapMeDiscovery_Execute(CommandParser *parser, CommandOps *ops, - PARCList *args); + PARCList *args, + char *output, + size_t output_size); static CommandReturn _controlMapMeDiscovery_HelpExecute(CommandParser *parser, CommandOps *ops, - PARCList *args); + PARCList *args, + char *output, + size_t output_size); static const char *_commandMapMeDiscovery = "mapme discovery"; static const char *_commandMapMeDiscoveryHelp = "help mapme discovery"; @@ -54,18 +58,21 @@ CommandOps *controlMapMeDiscovery_HelpCreate(ControlState *state) { static CommandReturn _controlMapMeDiscovery_HelpExecute(CommandParser *parser, CommandOps *ops, - PARCList *args) { - printf("mapme discovery [on|off]\n"); - printf("\n"); + PARCList *args, + char *output, + size_t output_size) { + snprintf(output, output_size, "mapme discovery [on|off]\n\n"); return CommandReturn_Success; } static CommandReturn _controlMapMeDiscovery_Execute(CommandParser *parser, CommandOps *ops, - PARCList *args) { + PARCList *args, + char *output, + size_t output_size) { if (parcList_Size(args) != 3) { - _controlMapMeDiscovery_HelpExecute(parser, ops, args); + _controlMapMeDiscovery_HelpExecute(parser, ops, args, output, output_size); return CommandReturn_Failure; } @@ -75,7 +82,7 @@ static CommandReturn _controlMapMeDiscovery_Execute(CommandParser *parser, } else if (strcmp(parcList_GetAtIndex(args, 2), "off") == 0) { active = false; } else { - _controlMapMeDiscovery_HelpExecute(parser, ops, args); + _controlMapMeDiscovery_HelpExecute(parser, ops, args, output, output_size); return CommandReturn_Failure; } -- cgit 1.2.3-korg