Skip to content

Commit

Permalink
[shell] PR comment resolution.
Browse files Browse the repository at this point in the history
  • Loading branch information
turon committed Jul 13, 2020
1 parent e15c2de commit b00bf01
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions examples/shell/cmd_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ using namespace chip::DeviceLayer;
using namespace chip::Logging;
using namespace chip::ArgParser;

#define THE_SHELL_SUBMODULE theShellDevice
static chip::Shell::Shell THE_SHELL_SUBMODULE;
static chip::Shell::Shell theShellDevice;

int cmd_device_help_iterator(shell_command_t * command, void * arg)
{
Expand All @@ -49,7 +48,7 @@ int cmd_device_help_iterator(shell_command_t * command, void * arg)

int cmd_device_help(int argc, char ** argv)
{
THE_SHELL_SUBMODULE.ForEachCommand(cmd_device_help_iterator, NULL);
theShellDevice.ForEachCommand(cmd_device_help_iterator, NULL);
return 0;
}

Expand Down Expand Up @@ -262,21 +261,21 @@ int cmd_device_config(int argc, char ** argv)

VerifyOrExit(argc == 0, error = CHIP_ERROR_INVALID_ARGUMENT);

error = ConfigGetVendorId(true);
error = ConfigGetProductId(true);
error = ConfigGetProductRevision(true);
error = ConfigGetSerialNumber(true);
error |= ConfigGetVendorId(true);
error |= ConfigGetProductId(true);
error |= ConfigGetProductRevision(true);
error |= ConfigGetSerialNumber(true);

error = ConfigGetServiceId(true);
error = ConfigGetFabricId(true);
error = ConfigGetPairingCode(true);
error |= ConfigGetServiceId(true);
error |= ConfigGetFabricId(true);
error |= ConfigGetPairingCode(true);

error = ConfigGetDeviceId(true);
error = ConfigGetDeviceCert(true);
error = ConfigGetDeviceCaCerts(true);
error |= ConfigGetDeviceId(true);
error |= ConfigGetDeviceCert(true);
error |= ConfigGetDeviceCaCerts(true);

exit:
return error;
return (error) ? CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND : CHIP_NO_ERROR;
}

int cmd_device_get(int argc, char ** argv)
Expand Down Expand Up @@ -344,7 +343,7 @@ int cmd_device_dispatch(int argc, char ** argv)

VerifyOrExit(argc > 0, error = CHIP_ERROR_INVALID_ARGUMENT);

error = THE_SHELL_SUBMODULE.ExecCommand(argc, argv);
error = theShellDevice.ExecCommand(argc, argv);

exit:
return error;
Expand All @@ -366,7 +365,7 @@ void cmd_device_init(void)
{
#if CONFIG_DEVICE_LAYER
// Register `device` subcommands with the local shell dispatcher.
THE_SHELL_SUBMODULE.RegisterCommands(cmds_device, ARRAY_SIZE(cmds_device));
theShellDevice.RegisterCommands(cmds_device, ARRAY_SIZE(cmds_device));

// Register the root `base64` command with the top-level shell.
shell_register(&cmds_base64_root, 1);
Expand Down

0 comments on commit b00bf01

Please sign in to comment.