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 @@ -666,6 +666,18 @@ command_t *get_next(command_t *command);
666666 */
667667uint32_t get_id (command_t *command);
668668
669+ /* * Set command callback
670+ *
671+ * Set the command callback for the command.
672+ *
673+ * @param[in] command Command handle.
674+ * @param[in] callback Command callback.
675+ *
676+ * @return ESP_OK on success.
677+ * @return error in case of failure.
678+ */
679+ esp_err_t set_callback (command_t *command, callback_t callback);
680+
669681/* * Get command callback
670682 *
671683 * Get the command callback for the command.
You can’t perform that action at this time.
0 commit comments