1 /* 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * Description: mocked shell 15 */ 16 17 #ifndef DIAG_MOCKED_SHELL_H 18 #define DIAG_MOCKED_SHELL_H 19 20 #include "errcode.h" 21 #include "stdarg.h" 22 #include "diag.h" 23 24 typedef void (*diag_cmd_shell_data_proc)(uint8_t *data, uint32_t data_len); 25 typedef void (*zdiag_data_put_uart)(uint8_t *data, uint16_t data_len); 26 27 int zdiag_mocked_shell_print(const char *fmt, va_list ap); 28 int zdiag_mocked_shell_uart_puts(uint8_t *data, uint32_t data_len); 29 void zdiag_mocked_shell_register_directly_uartput(zdiag_data_put_uart uart_hook); 30 void zdiag_mocked_shell_init(void); 31 void zdiag_mocked_shell_register_cmd_data_proc(diag_cmd_shell_data_proc data_proc_hook); 32 33 void zdiag_mocked_shell_set_enable(bool enable); 34 bool zdiag_mocked_shell_is_enabled(void); 35 36 errcode_t zdiag_cmd_mocked_shell(uint16_t cmd_id, void *cmd_param, uint16_t cmd_param_size, diag_option_t *option); 37 errcode_t zdiag_cmd_mocked_shell_enable(uint16_t cmd_id, void *cmd_param, 38 uint16_t cmd_param_size, diag_option_t *option); 39 #endif /* ZDIAG_MOCKED_SHELL_H */ 40 41