liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 1 | /** |
| 2 | @file |
| 3 | ql_dev.h |
| 4 | |
| 5 | @brief |
| 6 | This file provides the definitions for device, and declares the |
| 7 | API functions. |
| 8 | |
| 9 | */ |
| 10 | /*============================================================================ |
| 11 | Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd. All Rights Reserved. |
| 12 | Quectel Wireless Solution Proprietary and Confidential. |
| 13 | =============================================================================*/ |
| 14 | /*=========================================================================== |
| 15 | |
| 16 | EDIT HISTORY FOR MODULE |
| 17 | |
| 18 | This section contains comments describing changes made to the module. |
| 19 | Notice that changes are listed in reverse chronological order. |
| 20 | |
| 21 | |
| 22 | WHEN WHO WHAT, WHERE, WHY |
| 23 | ---------- ------------ ---------------------------------------------------- |
| 24 | 11/10/2019 Nebula.li create |
| 25 | =============================================================================*/ |
| 26 | |
| 27 | #ifndef __QL_DEV_H__ |
| 28 | #define __QL_DEV_H__ |
| 29 | |
| 30 | #include <stdlib.h> |
| 31 | #include <stdint.h> |
| 32 | #include <string.h> |
| 33 | |
| 34 | #ifdef __cplusplus |
| 35 | extern "C" { |
| 36 | #endif |
| 37 | |
| 38 | typedef enum |
| 39 | { |
| 40 | QL_DEV_SUCCESS, |
| 41 | QL_DEV_GENERIC_FAILURE, |
| 42 | QL_DEV_RADIO_NOT_AVAILABLE, |
| 43 | }QL_DEV_ERROR_CODE; |
| 44 | |
| 45 | typedef enum |
| 46 | { |
| 47 | QL_DEV_MODEM_MIN_FUN, |
| 48 | QL_DEV_MODEM_FULL_FUN, |
| 49 | QL_DEV_MODEM_DISABLE_RECEIVE_RF_CIRCUITS = 3, |
| 50 | QL_DEV_MODEM_DISABLE_TRANSMIT_AND_RECEIVE_RF_CIRCUITS, |
| 51 | QL_DEV_MODEM_DISABLE_SIM, |
| 52 | QL_DEV_MODEM_TURN_OFF_FULL_SECONDARY_RECEIVE, |
| 53 | }QL_DEV_MODEM_FUNCTION; |
| 54 | |
| 55 | QL_DEV_ERROR_CODE ql_dev_init (); |
| 56 | QL_DEV_ERROR_CODE ql_dev_release(); |
| 57 | |
| 58 | /* |
| 59 | Get the IMEI string. |
| 60 | -imei : input buffer |
| 61 | */ |
| 62 | QL_DEV_ERROR_CODE ql_dev_get_imei(char* imei); |
| 63 | |
| 64 | |
| 65 | /* |
| 66 | Get the FirmwareVersion string. |
| 67 | -version : input buffer |
| 68 | */ |
| 69 | QL_DEV_ERROR_CODE ql_dev_get_firmware_version(char* version); |
| 70 | |
| 71 | |
| 72 | /* |
| 73 | Get the DeviceModel string. |
| 74 | -model : input buffer |
| 75 | */ |
| 76 | QL_DEV_ERROR_CODE ql_dev_get_model(char* model); |
| 77 | |
| 78 | |
| 79 | /* |
| 80 | Get the SN string. |
| 81 | -sn : input buffer |
| 82 | */ |
| 83 | QL_DEV_ERROR_CODE ql_dev_get_sn(char* sn); |
| 84 | |
| 85 | /* |
| 86 | Set the modem function. |
| 87 | -function :[in] modem function |
| 88 | -rst :[in] if it is to reset modem before setting modem function. (0: not to reset; 1: reset) |
| 89 | */ |
| 90 | QL_DEV_ERROR_CODE ql_dev_set_modem_fun(QL_DEV_MODEM_FUNCTION function,int rst); |
| 91 | |
| 92 | /* |
| 93 | Get the modem function. |
| 94 | -function :[out] modem function |
| 95 | */ |
| 96 | QL_DEV_ERROR_CODE ql_dev_get_modem_fun(int *function); |
| 97 | |
| 98 | /* |
| 99 | Set the modem forbid urc. |
| 100 | forbid NETWORK 0x01 |
| 101 | forbid SIM 0x02 |
| 102 | forbid SMS 0x04 |
| 103 | forbid CS CALL 0x08 |
| 104 | forbid PS DATA 0x10 |
| 105 | -bitmask :[in] modem forbid urc |
| 106 | Set bitmask to 31 before sleep and 1 after wake up |
| 107 | */ |
| 108 | QL_DEV_ERROR_CODE ql_dev_forbidind(int bitmask); |
| 109 | |
| 110 | #ifdef __cplusplus |
| 111 | } |
| 112 | #endif |
| 113 | |
| 114 | #endif |