liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 1 |
|
| 2 | /**
|
| 3 | @file
|
| 4 | ql_common.h
|
| 5 |
|
| 6 | @brief
|
| 7 | This file provides the definitions for common functions, and declares the
|
| 8 | common functions.
|
| 9 |
|
| 10 | */
|
| 11 | /*============================================================================
|
| 12 | Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
|
| 13 | Quectel Wireless Solution Proprietary and Confidential.
|
| 14 | =============================================================================*/
|
| 15 | /*===========================================================================
|
| 16 |
|
| 17 | EDIT HISTORY FOR MODULE
|
| 18 |
|
| 19 | This section contains comments describing changes made to the module.
|
| 20 | Notice that changes are listed in reverse chronological order.
|
| 21 |
|
| 22 |
|
| 23 | WHEN WHO WHAT, WHERE, WHY
|
| 24 | ---------- ------------ ----------------------------------------------------
|
| 25 | 23/08/2019 Nebula.li create
|
| 26 | =============================================================================*/
|
| 27 |
|
| 28 | #ifndef __QL_COMMON_H__
|
| 29 | #define __QL_COMMON_H__
|
| 30 |
|
| 31 | #include <sys/types.h>
|
| 32 | #include <unistd.h>
|
| 33 | #include <sys/syscall.h>
|
| 34 |
|
| 35 | #include <libubox/ustream.h>
|
| 36 | #include <libubox/blobmsg_json.h>
|
| 37 | #include <libubox/kvlist.h>
|
| 38 | #include "libubus.h"
|
| 39 | #include "uci_blob.h"
|
| 40 | #include "libubox/uloop.h"
|
| 41 | #include "rilutil.h"
|
| 42 |
|
| 43 | #ifdef __cplusplus
|
| 44 | extern "C" {
|
| 45 | #endif
|
| 46 |
|
| 47 | void Ql_Powerdown(int mode);
|
| 48 |
|
| 49 | int ql_start_main_thread();
|
| 50 | int ql_exit_main_thread();
|
| 51 | int ql_ril_sync_request(unsigned int requestid, const void * data, int len,void* priv,void * cb,int timeout);
|
| 52 | int ql_ril_async_request(unsigned int requestid, const void * data, int len,void* priv,void * cb);
|
| 53 | int ql_ubus_sync_request(char *obj_name, char *method,struct blob_buf *blob_buf,void* priv,void *cb,int timeout);
|
| 54 | int ql_ubus_async_request(char *obj_name, char *method,struct blob_buf *blob_buf,void* priv,void *cb);
|
| 55 | int ql_ubus_subscribe_reg(char *subscriber_name, struct ubus_subscriber *event_obj);
|
| 56 | int ql_ubus_subscribe_remove(char *subscriber_name, struct ubus_subscriber *event_obj);
|
| 57 |
|
| 58 | int atcmd_get_line_num(char * result, int result_len);
|
| 59 | char * atcmd_get_line(char * result, int result_len,int index);
|
| 60 | int atcmd_get_para_num(char * line);
|
| 61 | void atcmd_get_para_value_str(char * line,int index, char *para_value);
|
| 62 | void ql_set_response(struct kvlist *result_list,int reqid, int resp_type, int ret, void *data, int data_len);
|
| 63 | int ql_get_response(struct kvlist *result_list,int reqid, int * resp_type, void *data);
|
| 64 | int kvlist_get_len(struct kvlist *kv, const void *data);
|
| 65 |
|
| 66 | int utf8_to_usc2(unsigned char *utf8_data,int utf8_data_len, unsigned int *usc2_data);
|
| 67 | int usc2_to_utf8(unsigned int *usc2_data, int usc2_data_len, unsigned char *utf8_data);
|
| 68 |
|
| 69 | int set_config_option(const char *package, const char *section, const char *option, const char *value);
|
| 70 | char *get_config_option(char *package, char *section, char *option);
|
| 71 |
|
| 72 | #ifdef __cplusplus
|
| 73 | }
|
| 74 | #endif
|
| 75 |
|
| 76 | #endif |