File tree 2 files changed +23
-0
lines changed
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)
1313
1313
return current_command->command_id ;
1314
1314
}
1315
1315
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
+
1316
1327
callback_t get_callback (command_t *command)
1317
1328
{
1318
1329
if (!command) {
Original file line number Diff line number Diff line change @@ -679,6 +679,18 @@ command_t *get_next(command_t *command);
679
679
*/
680
680
uint32_t get_id (command_t *command);
681
681
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
+
682
694
/* * Get command callback
683
695
*
684
696
* Get the command callback for the command.
You can’t perform that action at this time.
0 commit comments