Skip to content

Commit 15e2181

Browse files
committed
fix(esp_commands): Incorporate review comments
1 parent a8199e1 commit 15e2181

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

esp_commands/.build-test-rules.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
esp_commands/test_apps:
22
enable:
3-
- if: (IDF_TARGET == "linux") and (IDF_VERSION_MAJOR == 5 and IDF_VERSION_MINOR >= 3)
4-
reason: "Test the main logic of the component (not target dependent)"
5-
- if: IDF_TARGET == "esp32"
6-
reason: "Test the placement of statically registered commands in dedicated flash section"
3+
- if: (IDF_TARGET in ["esp32", "linux"]) and (IDF_VERSION_MAJOR == 5 and IDF_VERSION_MINOR >= 3)

esp_commands/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ typedef struct esp_command {
6060
Use the `ESP_COMMAND_REGISTER` macro to register a command at compile time:
6161

6262
```c
63-
static int my_cmd(void *ctx, int argc, char **argv) {
63+
static int my_cmd(void *context, esp_commands_exec_arg_t *cmd_arg, int argc, char **argv) {
6464
printf("Hello from my_cmd!\n");
6565
return 0;
6666
}
6767

6868
ESP_COMMAND_REGISTER(my_cmd, tools, "Prints hello", my_cmd, NULL, NULL, NULL);
6969
```
7070
71-
This places the command into the `.esp_commands` section.
71+
This places the command into the `.esp_commands` section in flash.
7272
7373
### Dynamic Registration
7474

esp_commands/include/esp_commands.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ typedef ssize_t (*esp_commands_write_t)(int fd, const void *buf, size_t count);
3030
* command callback to execute properly
3131
*/
3232
typedef struct esp_commands_exec_arg {
33-
int out_fd; /*!< file descriptor that the command function has to use to output data */
33+
int out_fd; /*!< file descriptor that the command function has to use to print data in the environment it was called from */
3434
esp_commands_write_t write_func; /*!< write function the command function has to use to output datga */
3535
void *dynamic_ctx; /*!< dynamic context passed to the command function */
3636
} esp_commands_exec_arg_t;

esp_commands/test_apps/pytest_esp_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
not bool(glob.glob(f'{Path(__file__).parent.absolute()}/build*/')),
1111
reason="Skip the idf version that did not build"
1212
)
13-
@idf_parametrize('target', ['linux'], indirect=['target'])
13+
@idf_parametrize('target', ['linux', 'esp32'], indirect=['target'])
1414
def test_esp_commands(dut) -> None:
1515
dut.run_all_single_board_cases()

0 commit comments

Comments
 (0)