-
Notifications
You must be signed in to change notification settings - Fork 191
Add set and get commands for ESP RainMaker console (MEGH-6740) #358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add set and get commands for ESP RainMaker console (MEGH-6740) #358
Conversation
#include <esp_log.h> | ||
#include <esp_wifi.h> | ||
#include <esp_console.h> | ||
#include <string.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed duplicate string.h
There was a problem hiding this 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
andregister_set
for theset
command - Implements
get_handler
andregister_get
for theget
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 otherregister_*_command
functions. Consider renaming toregister_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
This PR adds two new console commands to ESP RainMaker: