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 @@ -1234,6 +1234,17 @@ uint32_t get_id(command_t *command)
12341234 return current_command->command_id ;
12351235}
12361236
1237+ esp_err_t set_callback (command_t *command, callback_t callback)
1238+ {
1239+ if (!command) {
1240+ ESP_LOGE (TAG, " Command cannot be NULL" );
1241+ return ESP_ERR_INVALID_ARG;
1242+ }
1243+ _command_t *current_command = (_command_t *)command;
1244+ current_command->callback = callback;
1245+ return ESP_OK;
1246+ }
1247+
12371248callback_t get_callback (command_t *command)
12381249{
12391250 if (!command) {
Original file line number Diff line number Diff line change @@ -664,6 +664,18 @@ command_t *get_next(command_t *command);
664664 */
665665uint32_t get_id (command_t *command);
666666
667+ /* * Set command callback
668+ *
669+ * Set the command callback for the command.
670+ *
671+ * @param[in] command Command handle.
672+ * @param[in] callback Command callback.
673+ *
674+ * @return ESP_OK on success.
675+ * @return error in case of failure.
676+ */
677+ esp_err_t set_callback (command_t *command, callback_t callback);
678+
667679/* * Get command callback
668680 *
669681 * Get the command callback for the command.
You can’t perform that action at this time.
0 commit comments