File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1313,6 +1313,17 @@ uint32_t get_id(command_t *command)
13131313 return current_command->command_id ;
13141314}
13151315
1316+ esp_err_t set_callback (command_t *command, callback_t callback)
1317+ {
1318+ if (!command) {
1319+ ESP_LOGE (TAG, " Command cannot be NULL" );
1320+ return ESP_ERR_INVALID_ARG;
1321+ }
1322+ _command_t *current_command = (_command_t *)command;
1323+ current_command->callback = callback;
1324+ return ESP_OK;
1325+ }
1326+
13161327callback_t get_callback (command_t *command)
13171328{
13181329 if (!command) {
Original file line number Diff line number Diff line change @@ -679,6 +679,18 @@ command_t *get_next(command_t *command);
679679 */
680680uint32_t get_id (command_t *command);
681681
682+ /* * Set command callback
683+ *
684+ * Set the command callback for the command.
685+ *
686+ * @param[in] command Command handle.
687+ * @param[in] callback Command callback.
688+ *
689+ * @return ESP_OK on success.
690+ * @return error in case of failure.
691+ */
692+ esp_err_t set_callback (command_t *command, callback_t callback);
693+
682694/* * Get command callback
683695 *
684696 * Get the command callback for the command.
You can’t perform that action at this time.
0 commit comments