b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame^] | 1 | #ifdef MBTK_FUNC_TYPEDEF |
| 2 | // Add function define start. |
| 3 | typedef bool (*mbtk_cmd_line_ex)(const char*, void (*)(char*, int)); |
| 4 | //typedef int (*mbtk_at_play)(const char*); |
| 5 | //typedef int (*mbtk_at_rec)(const char*); |
| 6 | //typedef int (*mbtk_at_loopback)(int type); // 1 : Start 0 : Stop |
| 7 | //typedef int (*mbtk_at_adc)(int); |
| 8 | //typedef int (*mbtk_at_gnss)(int, void*); |
| 9 | //typedef int (*mbtk_mgpsc_set)(int); |
| 10 | //typedef int (*mbtk_at_gnss_reset)(int); |
| 11 | //typedef int (*mbtk_at_gpio)(bool, void*); |
| 12 | //typedef int (*mbtk_at_gnss_start_ttff)(int, int, int); |
| 13 | |
| 14 | typedef int (*mbtk_audio_loopback_start)(int); |
| 15 | typedef int (*mbtk_audio_loopback_stop)(); |
| 16 | typedef int (*mbtk_audio_mode_set)(int); |
| 17 | typedef int (*mbtk_audio_ubus_init)(); |
| 18 | typedef int (*mbtk_audio_ubus_deinit)(); |
| 19 | typedef int (*mbtk_audio_wav_init)(); |
| 20 | typedef int (*mbtk_audio_wav_play_start)(const void *); |
| 21 | typedef int (*mbtk_audio_wav_deinit)(); |
| 22 | typedef int (*mbtk_audio_wav_recorder_start)(const void *, int); |
| 23 | |
| 24 | typedef void (*mbtk_log_init)(char*, char*); |
| 25 | typedef void (*log_hex)(const char *tag, const void *data, int data_len); |
| 26 | typedef int (*mbtk_at_ftp)(int, int, char*, char*, char*, int, bool, bool); |
| 27 | typedef int (*mbtk_at_get_ftp_info)(int ,int *,char *, char *, char *,int * ,int *, int *); |
| 28 | typedef int (*mbtk_at_ftp_mkrmdel)(int ,char *); |
| 29 | typedef int (*mbtk_at_ftp_upload)(char *,char *, int, int); |
| 30 | typedef int (*mbtk_at_ftp_download)(void *, void *, int , int , int ); |
| 31 | typedef int (*mbtk_at_ftp_list)(char *); |
| 32 | typedef int (*mbtk_at_get_ftp_data_info)(char *, char *, int *, int *, int *); |
| 33 | typedef int (*mbtk_at_msgid)(int *); |
| 34 | //typedef int (*mbtk_system_sleep)(void); |
| 35 | |
| 36 | |
| 37 | //typedef int (*mbtk_http_handle_get)(int, void(*)(int, int, void*, int)); |
| 38 | typedef int (*mbtk_http_handle_get)(int, void*); |
| 39 | typedef int (*mbtk_http_handle_free)(int); |
| 40 | typedef int (*mbtk_http_session_url_set)(int,int,void *); |
| 41 | typedef int (*mbtk_http_session_create)(int,int,int); |
| 42 | typedef int (*mbtk_http_session_option_reset)(int,int,int); |
| 43 | typedef int (*mbtk_http_session_ingnore_cert_set)(int,int,bool); |
| 44 | typedef int (*mbtk_http_session_start)(int,int); |
| 45 | typedef int (*mbtk_http_session_head_add)(int,int,char *, char *); |
| 46 | typedef int (*mbtk_http_session_content_set)(int,int,char *, int); |
| 47 | typedef int (*mbtk_http_session_get)(int,int); |
| 48 | |
| 49 | |
| 50 | #include "mbtk_at_tcpip.h" |
| 51 | |
| 52 | typedef int (*mbtk_task_queue_start)(void * ,void *(*)(void *) ); |
| 53 | typedef void (*mbtk_task_queue_stop)(void * ); |
| 54 | typedef int (*mbtk_signal_send)(void * ,mbtk_signal_info* ); |
| 55 | typedef mbtk_signal_info* (*mbtk_signal_get)(void * ); |
| 56 | |
| 57 | typedef mbtk_tcpip_err_enum (*mbtk_tcpip_net_open)(void (*)(int ,const char * ), void (*)(int , int )); |
| 58 | typedef mbtk_tcpip_err_enum (*mbtk_tcpip_net_close)(); |
| 59 | |
| 60 | typedef mbtk_tcpip_err_enum (*mbtk_tcpip_sock_open)(const mbtk_tcpip_info_t *); |
| 61 | typedef mbtk_tcpip_err_enum (*mbtk_tcpip_sock_close)(int ); |
| 62 | typedef int (*mbtk_tcpip_send)(int , const char* , int , const char* , int ); |
| 63 | typedef int (*mbtk_tcpip_read)(int , char* , int ); |
| 64 | typedef int (*mbtk_tcpip_info_get)(int , mbtk_tcpip_tcp_state_info_s *); |
| 65 | typedef void (*mbtk_tcpip_set_read_cb)(int , mbtk_tcpip_read_callback_func ); |
| 66 | typedef int (*mbtk_tcpip_data_traffic_get)(int ); |
| 67 | typedef mbtk_tcpip_err_enum (*mbtk_tcpip_data_traffic_reset)(int ); |
| 68 | typedef int (*mbtk_tcpip_link_state_get)(int ); |
| 69 | // Add function define end. |
| 70 | #endif |
| 71 | |
| 72 | |
| 73 | #ifdef MBTK_FUNC_INIT |
| 74 | // Add function start. |
| 75 | // libmbtk_lib.so |
| 76 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_cmd_line_ex); |
| 77 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_log_init); |
| 78 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, log_hex); |
| 79 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_task_queue_start); |
| 80 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_task_queue_stop); |
| 81 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_signal_send); |
| 82 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_signal_get); |
| 83 | |
| 84 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_loopback_start); |
| 85 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_loopback_stop); |
| 86 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_mode_set); |
| 87 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_ubus_init); |
| 88 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_ubus_deinit); |
| 89 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_wav_init); |
| 90 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_wav_deinit); |
| 91 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_wav_play_start); |
| 92 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_wav_recorder_start); |
| 93 | |
| 94 | // libmbtk_factory.so |
| 95 | //MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_FACTORY, mbtk_at_adc); |
| 96 | //MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_FACTORY, mbtk_at_gpio); |
| 97 | //MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_FACTORY, mbtk_at_play); |
| 98 | //MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_FACTORY, mbtk_at_rec); |
| 99 | //MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_FACTORY, mbtk_at_loopback); |
| 100 | //MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_FACTORY, mbtk_system_sleep); |
| 101 | //MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_FACTORY, mbtk_mgpsc_set); |
| 102 | |
| 103 | // libmbtk_ftp.so |
| 104 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_ftp); |
| 105 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_get_ftp_info); |
| 106 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_ftp_mkrmdel); |
| 107 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_ftp_upload); |
| 108 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_ftp_download); |
| 109 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_ftp_list); |
| 110 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_get_ftp_data_info); |
| 111 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_msgid); |
| 112 | |
| 113 | // libmbtk_http.so |
| 114 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_handle_get); |
| 115 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_handle_free); |
| 116 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_url_set); |
| 117 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_create); |
| 118 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_option_reset); |
| 119 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_ingnore_cert_set); |
| 120 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_start); |
| 121 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_head_add); |
| 122 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_content_set); |
| 123 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_get); |
| 124 | |
| 125 | // libmbtk_tcpip.so |
| 126 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_net_open); |
| 127 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_net_close); |
| 128 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_sock_open); |
| 129 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_sock_close); |
| 130 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_send); |
| 131 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_read); |
| 132 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_info_get); |
| 133 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_set_read_cb); |
| 134 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_data_traffic_get); |
| 135 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_data_traffic_reset); |
| 136 | MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_link_state_get); |
| 137 | |
| 138 | // Add function end. |
| 139 | #endif |