Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Infishiv
Copy link

@Infishiv Infishiv commented Jun 11, 2025

This PR adds two new console commands to ESP RainMaker:

 - `set`: Allows setting parameter values for devices
   Usage: set <device_name> <param_name> <value>
 
 - `get`: Allows getting parameter values from devices
   Usage: get <device_name> <param_name>
 
 These commands make it easier to interact with ESP RainMaker devices through the console interface.

@CLAassistant
Copy link

CLAassistant commented Jun 11, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot changed the title Add smart-set and smart-get commands for ESP RainMaker console Add smart-set and smart-get commands for ESP RainMaker console (MEGH-6740) Jun 11, 2025
#include <esp_log.h>
#include <esp_wifi.h>
#include <esp_console.h>
#include <string.h>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed duplicate string.h

@Infishiv Infishiv changed the title Add smart-set and smart-get commands for ESP RainMaker console (MEGH-6740) Add set and get commands for ESP RainMaker console (MEGH-6740) Jun 11, 2025
@mahavirj mahavirj requested a review from Copilot July 4, 2025 08:20
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds set and get console commands to allow users to modify and retrieve ESP RainMaker device parameters via the console interface.

  • Implements set_handler and register_set for the set command
  • Implements get_handler and register_get for the get command
  • Updates register_commands to include the new commands and adds <stdlib.h> for conversions
Comments suppressed due to low confidence (4)

components/esp_rainmaker/src/console/esp_rmaker_commands.c:268

  • [nitpick] The help string is generic. Consider including the usage pattern (e.g., Usage: set <device_name> <param_name> <value>) to guide users.
        .help = "Set command for ESP RainMaker device parameters",

components/esp_rainmaker/src/console/esp_rmaker_commands.c:333

  • [nitpick] Include the usage syntax (e.g., Usage: get <device_name> <param_name>) in the help string for clarity.
        .help = "Get command for ESP RainMaker device parameters",

components/esp_rainmaker/src/console/esp_rmaker_commands.c:198

  • Consider adding unit or integration tests for the new set command handler to validate parsing, type conversion, and error handling.
static int set_handler(int argc, char** argv)

components/esp_rainmaker/src/console/esp_rmaker_commands.c:264

  • [nitpick] register_set is ambiguous and inconsistent with other register_*_command functions. Consider renaming to register_set_command for clarity and consistency.
static void register_set()

- Update help strings with clear usage patterns
- Improve function naming consistency
- Add proper error handling and validation
- Implement type-safe value conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants