1 /*************************************************************************** 2 * 3 * Copyright 2019-2025 BES. 4 * All rights reserved. All unpublished rights reserved. 5 * 6 * No part of this work may be used or reproduced in any form or by any 7 * means, or stored in a database or retrieval system, without prior written 8 * permission of BES. 9 * 10 * Use of this work is governed by a license granted by BES. 11 * This work contains confidential and proprietary information of 12 * BES. which is protected by copyright, trade secret, 13 * trademark and other intellectual property rights. 14 * 15 ****************************************************************************/ 16 #ifndef _DATA_DUMP_H_ 17 #define _DATA_DUMP_H_ 18 19 #include <stdint.h> 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 typedef void (*data_dump_cb_t)(unsigned char *data, unsigned int len, void *param); 26 typedef void (*data_dump_cb_register_t)(data_dump_cb_t cbf, void *param); 27 typedef void (*data_dump_cb_unregister_t)(data_dump_cb_t cbf, void *param); 28 29 void *data_dump_open(data_dump_cb_register_t register_cbf, int kfifo_len_KB, int samplerate, int auto_start); 30 void *data_dump_open_withfifo(data_dump_cb_register_t register_cbf, void *val_fifo, int samplerate, int auto_start); 31 int data_dump_set_timeout(void *handle, int timeout); 32 int data_dump_start(void *handle); 33 int data_dump_get_size(void *handle); 34 int data_dump_write(void *handle, void *buf, unsigned int size); 35 int data_dump_read(void *handle, void *buf, unsigned int size); 36 int data_dump_stop(void *handle); 37 void data_dump_close(void *handle, data_dump_cb_unregister_t unregister_cbf); 38 39 #ifdef __cplusplus 40 } 41 #endif 42 43 #endif /* _DATA_DUMP_H_ */ 44