Skip to content

Commit

Permalink
[shell] PR comment resolution. Add TODO(project-chip#1586) to stack l…
Browse files Browse the repository at this point in the history
…arge bufs.
  • Loading branch information
turon committed Jul 13, 2020
1 parent b00bf01 commit 38e7736
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/shell/cmd_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ using namespace chip::DeviceLayer;
using namespace chip::Logging;
using namespace chip::ArgParser;

static chip::Shell::Shell theShellDevice;
static chip::Shell::Shell sShellDeviceSubcommands;

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

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

Expand Down Expand Up @@ -171,6 +171,7 @@ static CHIP_ERROR ConfigGetDeviceCert(bool printHeader)
{
CHIP_ERROR error = CHIP_NO_ERROR;
streamer_t * sout = streamer_get();
// TODO(#1586): MemoryAlloc temp buffer rather than use stack.
uint8_t buf[512];
size_t bufSize;

Expand All @@ -189,6 +190,7 @@ static CHIP_ERROR ConfigGetDeviceCaCerts(bool printHeader)
{
CHIP_ERROR error = CHIP_NO_ERROR;
streamer_t * sout = streamer_get();
// TODO(#1586): MemoryAlloc temp buffer rather than use stack.
uint8_t buf[512];
size_t bufSize;

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

VerifyOrExit(argc > 0, error = CHIP_ERROR_INVALID_ARGUMENT);

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

exit:
return error;
Expand All @@ -365,7 +367,7 @@ void cmd_device_init(void)
{
#if CONFIG_DEVICE_LAYER
// Register `device` subcommands with the local shell dispatcher.
theShellDevice.RegisterCommands(cmds_device, ARRAY_SIZE(cmds_device));
sShellDeviceSubcommands.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 38e7736

Please sign in to comment.