blob: b696b1d24d97bc82aa6689fdac68377627f8c3a1 [file] [log] [blame]
b.liud440f9f2025-04-18 10:44:31 +08001#ifdef MBTK_FUNC_TYPEDEF
2// Add function define start.
3typedef 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
14typedef int (*mbtk_audio_loopback_start)(int);
15typedef int (*mbtk_audio_loopback_stop)();
16typedef int (*mbtk_audio_mode_set)(int);
17typedef int (*mbtk_audio_ubus_init)();
18typedef int (*mbtk_audio_ubus_deinit)();
19typedef int (*mbtk_audio_wav_init)();
20typedef int (*mbtk_audio_wav_play_start)(const void *);
21typedef int (*mbtk_audio_wav_deinit)();
22typedef int (*mbtk_audio_wav_recorder_start)(const void *, int);
23
24typedef void (*mbtk_log_init)(char*, char*);
25typedef void (*log_hex)(const char *tag, const void *data, int data_len);
26typedef int (*mbtk_at_ftp)(int, int, char*, char*, char*, int, bool, bool);
27typedef int (*mbtk_at_get_ftp_info)(int ,int *,char *, char *, char *,int * ,int *, int *);
28typedef int (*mbtk_at_ftp_mkrmdel)(int ,char *);
29typedef int (*mbtk_at_ftp_upload)(char *,char *, int, int);
30typedef int (*mbtk_at_ftp_download)(void *, void *, int , int , int );
31typedef int (*mbtk_at_ftp_list)(char *);
32typedef int (*mbtk_at_get_ftp_data_info)(char *, char *, int *, int *, int *);
33typedef 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));
38typedef int (*mbtk_http_handle_get)(int, void*);
39typedef int (*mbtk_http_handle_free)(int);
40typedef int (*mbtk_http_session_url_set)(int,int,void *);
41typedef int (*mbtk_http_session_create)(int,int,int);
42typedef int (*mbtk_http_session_option_reset)(int,int,int);
43typedef int (*mbtk_http_session_ingnore_cert_set)(int,int,bool);
44typedef int (*mbtk_http_session_start)(int,int);
45typedef int (*mbtk_http_session_head_add)(int,int,char *, char *);
46typedef int (*mbtk_http_session_content_set)(int,int,char *, int);
47typedef int (*mbtk_http_session_get)(int,int);
48
49
50#include "mbtk_at_tcpip.h"
51
52typedef int (*mbtk_task_queue_start)(void * ,void *(*)(void *) );
53typedef void (*mbtk_task_queue_stop)(void * );
54typedef int (*mbtk_signal_send)(void * ,mbtk_signal_info* );
55typedef mbtk_signal_info* (*mbtk_signal_get)(void * );
56
57typedef mbtk_tcpip_err_enum (*mbtk_tcpip_net_open)(void (*)(int ,const char * ), void (*)(int , int ));
58typedef mbtk_tcpip_err_enum (*mbtk_tcpip_net_close)();
59
60typedef mbtk_tcpip_err_enum (*mbtk_tcpip_sock_open)(const mbtk_tcpip_info_t *);
61typedef mbtk_tcpip_err_enum (*mbtk_tcpip_sock_close)(int );
62typedef int (*mbtk_tcpip_send)(int , const char* , int , const char* , int );
63typedef int (*mbtk_tcpip_read)(int , char* , int );
64typedef int (*mbtk_tcpip_info_get)(int , mbtk_tcpip_tcp_state_info_s *);
65typedef void (*mbtk_tcpip_set_read_cb)(int , mbtk_tcpip_read_callback_func );
66typedef int (*mbtk_tcpip_data_traffic_get)(int );
67typedef mbtk_tcpip_err_enum (*mbtk_tcpip_data_traffic_reset)(int );
68typedef 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
76MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_cmd_line_ex);
77MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_log_init);
78MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, log_hex);
79MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_task_queue_start);
80MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_task_queue_stop);
81MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_signal_send);
82MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_signal_get);
83
84MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_loopback_start);
85MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_loopback_stop);
86MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_mode_set);
87MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_ubus_init);
88MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_ubus_deinit);
89MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_wav_init);
90MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_wav_deinit);
91MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_audio_wav_play_start);
92MBTK_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
104MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_ftp);
105MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_get_ftp_info);
106MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_ftp_mkrmdel);
107MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_ftp_upload);
108MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_ftp_download);
109MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_ftp_list);
110MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_get_ftp_data_info);
111MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_at_msgid);
112
113// libmbtk_http.so
114MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_handle_get);
115MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_handle_free);
116MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_url_set);
117MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_create);
118MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_option_reset);
119MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_ingnore_cert_set);
120MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_start);
121MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_head_add);
122MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_content_set);
123MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_http_session_get);
124
125// libmbtk_tcpip.so
126MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_net_open);
127MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_net_close);
128MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_sock_open);
129MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_sock_close);
130MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_send);
131MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_read);
132MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_info_get);
133MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_set_read_cb);
134MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_data_traffic_get);
135MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_data_traffic_reset);
136MBTK_FUNC_ADD(MBTK_AT_FUNC_TYPE_BASIC, mbtk_tcpip_link_state_get);
137
138// Add function end.
139#endif