blob: e45910b2a6ae1bf4b6831b1647597b5a343009f7 [file] [log] [blame]
b.liud440f9f2025-04-18 10:44:31 +08001/*-----------------------------------------------------------------------------------------------*/
2/**
3 @file ql_dm.h
4 @brief device management API
5*/
6/*-----------------------------------------------------------------------------------------------*/
7
8/*-------------------------------------------------------------------------------------------------
9 Copyright (c) 2019 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
10 Quectel Wireless Solution Proprietary and Confidential.
11-------------------------------------------------------------------------------------------------*/
12
13/*-------------------------------------------------------------------------------------------------
14 EDIT HISTORY
15 This section contains comments describing changes made to the file.
16 Notice that changes are listed in reverse chronological order.
17 $Header: $
18 when who what, where, why
19 -------- --- ----------------------------------------------------------
20 20200316 stan.li Optimize the ql_dm_get_modem_state interface
21 20191224 stan.li Add radio on/off API
22 20190625 stan.li Created .
23-------------------------------------------------------------------------------------------------*/
24
25#ifndef __QL_DM_H__
26#define __QL_DM_H__
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#define QL_DM_IMEI_MAX_LEN 32
33#define QL_DM_MEID_MAX_LEN 32
34#define QL_DM_FIRMWARE_REV_MAX_LEN 256
35#define QL_DM_NV_ITEM_NAME_MAX_LEN 127
36#define QL_DM_NV_ITEM_VALUE_MAX_LEN 2048
37
38//enable
39#define QL_DM_QOOS_ENABLE_MAX 2
40#define QL_DM_QOOS_ENABLE_MIN 0
41
42//pre_time
43#define QL_DM_QOOS_PRE_TIME_MAX 600
44#define QL_DM_QOOS_PRE_TIME_MIN 1
45
46//sleep_time
47#define QL_DM_QOOS_SLEEP_TIME_MAX (60*60*12)
48#define QL_DM_QOOS_SLEEP_TIME_MIN 1
49
50//acq_time
51#define QL_DM_QOOS_ACQ_TIME_MAX 600
52#define QL_DM_QOOS_ACQ_TIME_MIN 1
53
54//cir_cnt
55#define QL_DM_QOOS_CIR_CNT_MAX 255
56#define QL_DM_QOOS_CIR_CNT_MIN 1
57
58//sleep_step
59#define QL_DM_QOOS_SLEEP_STEP_MAX 60
60#define QL_DM_QOOS_SLEEP_STEP_MIN 0
61
62//acq_step
63#define QL_DM_QOOS_ACQ_STEP_MAX 60
64#define QL_DM_QOOS_ACQ_STEP_MIN 0
65
66//adj_cnt
67#define QL_DM_QOOS_ADJ_CNT_MAX 5
68#define QL_DM_QOOS_ADJ_CNT_MIN 0
69
70//idle_interval
71#define QL_DM_QOOS_IDLE_INTERVAL_MAX 60
72#define QL_DM_QOOS_IDLE_INTERVAL_MIN 1
73
74typedef enum QL_DW_AIR_PLANE_MODE_TYPE_ENUM
75{
76 QL_DM_AIR_PLANE_MODE_UNKNOWN = 0, /**< Radio online. */
77 QL_DM_AIR_PLANE_MODE_ON = 1, /**< Radio power off or unknown. Airplane ON. */
78 QL_DM_AIR_PLANE_MODE_OFF = 2, /**< Radio online. Airplane OFF. */
79 QL_DM_AIR_PLANE_MODE_NA = 3 /**< Radio Unvailable. */
80}QL_DM_AIR_PLANE_MODE_TYPE_E;
81
82/** modified by kin.tan@20210125 start: matching modem state sent by service **/
83typedef enum QL_DM_MODEM_STATE_TYPE_ENUM
84{
85 QL_DM_MODEM_STATE_OFFLINE = 0,
86 QL_DM_MODEM_STATE_ONLINE = 1,
87 QL_DM_MODEM_STATE_UNKNOWN = 2
88}QL_DM_MODEM_STATE_TYPE_E;
89/** modified by kin.tan@20210125 end: matching modem state sent by service **/
90
91typedef enum QL_DM_QOOS_ENABLE_TYPE_ENUM
92{
93 QL_DM_QOOS_ENABLE_STATE_OFF = 0, /**< close QOOS function. */
94 QL_DM_QOOS_ENABLE_STATE_ON_NO_SERVICE = 1, /**< open QOOS function */
95}QL_DM_QOOS_ENABLE_TYPE_E;
96
97/** bind subscription */
98typedef enum QL_DM_BIND_SUB_TYPE_ENUM
99{
100 QL_DM_BIND_SUB_PRIMARY = 0,
101 QL_DM_BIND_SUB_SECONDARY = 1,
102}QL_DM_BIND_SUB_TYPE_E;
103
104/** boot up reason */
105typedef enum QL_DM_BOOT_UP_REASON_ENUM
106{
107 QL_DM_BOOT_UP_INVALID = -1,
108 QL_DM_BOOT_UP_HARD_RESET = 0,
109 QL_DM_BOOT_UP_SMPL = 1,
110 QL_DM_BOOT_UP_RTC = 2,
111 QL_DM_BOOT_UP_DC_CHG = 3,
112 QL_DM_BOOT_UP_USB_CHG = 4,
113 QL_DM_BOOT_UP_PON1 = 5,
114 QL_DM_BOOT_UP_CBLPWR_N = 6,
115 QL_DM_BOOT_UP_KPDPWR_N = 7,
116}QL_DM_BOOT_UP_REASON_E;
117
118/** shutdown reason */
119typedef enum QL_DM_SHUTDOWN_REASON_ENUM
120{
121 QL_DM_SHUTDOWN_INVALID = -1,
122 QL_DM_SHUTDOWN_SOFT = 0,
123 QL_DM_SHUTDOWN_PS_HOLD = 1,
124 QL_DM_SHUTDOWN_PMIC_WD = 2,
125 QL_DM_SHUTDOWN_GP1 = 3,
126 QL_DM_SHUTDOWN_GP2 = 4,
127 QL_DM_SHUTDOWN_KPDPWR_AND_RESIN = 5,
128 QL_DM_SHUTDOWN_RESIN_N = 6,
129 QL_DM_SHUTDOWN_KPDPWR_N = 7,
130}QL_DM_SHUTDOWN_REASON_E;
131
132
133// typedef struct {
134// uint16_t pre_time; /**< the upper limit of the first search time, range is 1 to 600, default value is 180, in seconds. */
135// uint16_t sleep_time; /**< the first sleep time, range is 1 to 43200, default value is 30, in seconds. */
136// uint16_t acq_time; /**< the first search time, range is 1 to 600, default value is 20, in seconds. */
137// uint8_t cir_cnt; /**< the number of sleep->search cycle, range is 5 to 255, default value is 10, in seconds. */
138// uint8_t sleep_step; /**< the sleep time increment, range is 0 to 60, default vaue is 15, in seconds. */
139// uint8_t acq_step; /**< the acq time increment, range is 0 to 60, default value is 0, in seconds. */
140// uint8_t adj_cnt; /**< the adjustment times for sleep-search cylce, range is 0 to 5, default value is 2, in seconds. */
141// uint8_t idle_interval; /**< when the module is registered, check whether the module if offline, range is 1 to 60,default value is 1, in seconds. */
142// }ql_dm_qoos_config_t;
143
144
145typedef struct {
146 char enable;
147 int phase[3];
148}ql_dm_qoos_config_t;
149
150typedef struct
151{
152 uint8_t imei_valid;
153 char imei[QL_DM_IMEI_MAX_LEN + 1]; /**< imei.*/
154 uint8_t imei2_valid;
155 char imei2[QL_DM_IMEI_MAX_LEN + 1]; /**< imei2.*/
156 uint8_t meid_valid;
157 char meid[QL_DM_MEID_MAX_LEN + 1]; /**< meid.*/
158}ql_dm_device_serial_numbers_info_t;
159
160
161typedef void (*ql_dm_air_plane_mode_ind_cb)(QL_DM_AIR_PLANE_MODE_TYPE_E air_plane_mode);
162
163typedef void (*ql_dm_modem_state_ind_cb)(int modem_state);
164
165typedef void (*ql_dm_service_error_cb_f)(int error);
166
167/*-----------------------------------------------------------------------------------------------*/
168/**
169 @brief Initialize DM service.
170 @note You must call this function before other functions can be used in this module.
171 @return Whether the DM service was successfully intialized.
172 @retval QL_ERR_OK successful.
173 @retval QL_ERR_SERVICE_NOT_READY service is not ready, need to retry.
174 @retval Other error code defined by ql_type.h.
175 */
176/*-----------------------------------------------------------------------------------------------*/
177int ql_dm_init(void);
178
179
180/*-----------------------------------------------------------------------------------------------*/
181/**
182 @brief Denitialize DM service.
183 @return Whether the DM service was successfully deintialized.
184 @retval QL_ERR_OK successful.
185 @retval Other error code defined by ql_type.h.
186 */
187/*-----------------------------------------------------------------------------------------------*/
188int ql_dm_deinit(void);
189
190/*-----------------------------------------------------------------------------------------------*/
191/**
192 @brief get device software version.
193 @param[out] soft_ver Return software version
194 @param[in] soft_ver_len The length of soft_ver
195 @return Whether to successfully get the software version
196 @retval QL_ERR_OK successful
197 @retval QL_ERR_NOT_INIT uninitialized
198 @retval QL_ERR_SERVICE_NOT_READY service is not ready
199 @retval QL_ERR_INVALID_ARG Invalid arguments
200 @retval Other error code defined by ql_type.h
201 */
202/*-----------------------------------------------------------------------------------------------*/
203int ql_dm_get_software_version(char *soft_ver, int soft_ver_len);
204
205
206/*-----------------------------------------------------------------------------------------------*/
207/**
208 @brief get modem state.
209 @details QL_DM_MODEM_STATE_ONLINE,if modem starts normally.
210 @details QL_DM_MODEM_STATE_OFFLINE,in modem starts abnormally.
211 @details QL_DM_MODEM_STATE_UNKNOWN,unknown error.
212 @param[out] modem_state The state of modem
213 @return Whether to successfully get the modem state
214 @retval QL_ERR_OK successful
215 @retval QL_ERR_NOT_INIT uninitialized
216 @retval QL_ERR_SERVICE_NOT_READY service is not ready
217 @retval QL_ERR_INVALID_ARG Invalid arguments
218 @retval Other error code defined by ql_type.h
219 */
220/*-----------------------------------------------------------------------------------------------*/
221int ql_dm_get_modem_state(QL_DM_MODEM_STATE_TYPE_E *modem_state);
222
223/*-----------------------------------------------------------------------------------------------*/
224/**
225 @brief register modem state event.
226 @param[in] cb_func modem state indication callback function
227 @return Whether the modem state event was successfully registered.
228 @retval QL_ERR_OK successful
229 @retval QL_ERR_NOT_INIT uninitialized
230 @retval QL_ERR_SERVICE_NOT_READY service is not ready
231 @retval QL_ERR_INVALID_ARG Invalid arguments
232 @retval Other error code defined by ql_type.h
233 */
234/*-----------------------------------------------------------------------------------------------*/
235int ql_dm_set_modem_state_change_ind_cb(ql_dm_modem_state_ind_cb cb_func);
236
237/*-----------------------------------------------------------------------------------------------*/
238/**
239 @brief get module temperature.
240 @param[out] temperature The current temperature
241 @return Whether to successfully get the temperature
242 @retval QL_ERR_OK successful
243 @retval QL_ERR_NOT_INIT uninitialized
244 @retval QL_ERR_SERVICE_NOT_READY service is not ready
245 @retval QL_ERR_INVALID_ARG Invalid arguments
246 @retval Other error code defined by ql_type.h
247 */
248/*-----------------------------------------------------------------------------------------------*/
249int ql_dm_get_temperature(float *temperature);
250
251
252/*-----------------------------------------------------------------------------------------------*/
253/**
254 @brief get device serial numbers.
255 @param[out] p_info Pointer that point to ql_dm_device_serial_numbers_info_t
256 @return Whether to successfully get the serial numbers
257 @retval QL_ERR_OK successful
258 @retval QL_ERR_NOT_INIT uninitialized
259 @retval QL_ERR_SERVICE_NOT_READY service is not ready
260 @retval QL_ERR_INVALID_ARG Invalid arguments
261 @retval Other error code defined by ql_type.h
262 */
263/*-----------------------------------------------------------------------------------------------*/
264int ql_dm_get_device_serial_numbers(ql_dm_device_serial_numbers_info_t *p_info);
265
266
267/*-----------------------------------------------------------------------------------------------*/
268/**
269 @brief get device firmware revision identification.
270 @param[out] firmware_rev_id Return device firmware revision id
271 @param[in] firmware_rev_id_len The length of firmware_rev_id
272 @return Whether to successfully get the firmware revision id
273 @retval QL_ERR_OK successful
274 @retval QL_ERR_NOT_INIT uninitialized
275 @retval QL_ERR_SERVICE_NOT_READY service is not ready
276 @retval QL_ERR_INVALID_ARG Invalid arguments
277 @retval Other error code defined by ql_type.h
278 */
279/*-----------------------------------------------------------------------------------------------*/
280int ql_dm_get_device_firmware_rev_id(char *firmware_rev_id, int firmware_rev_id_len);
281
282
283/*-----------------------------------------------------------------------------------------------*/
284/**
285 @brief get air plane mode.
286 @param[out] p_info Pointer that point to QL_DM_AIR_PLANE_MODE_TYPE_E
287 @return Whether to successfully get the air plane mode
288 @retval QL_ERR_OK successful
289 @retval QL_ERR_NOT_INIT uninitialized
290 @retval QL_ERR_SERVICE_NOT_READY service is not ready
291 @retval QL_ERR_INVALID_ARG Invalid arguments
292 @retval Other error code defined by ql_type.h
293 */
294/*-----------------------------------------------------------------------------------------------*/
295int ql_dm_get_air_plane_mode(QL_DM_AIR_PLANE_MODE_TYPE_E *p_info);
296
297
298/*-----------------------------------------------------------------------------------------------*/
299/**
300 @brief set air plane mode.
301 @param[in] air_plane_mode 1:ON, 2:OFF
302 @return Whether to successfully set the air plane mode
303 @retval QL_ERR_OK successful
304 @retval QL_ERR_NOT_INIT uninitialized
305 @retval QL_ERR_SERVICE_NOT_READY service is not ready
306 @retval QL_ERR_INVALID_ARG Invalid arguments
307 @retval Other error code defined by ql_type.h
308 */
309/*-----------------------------------------------------------------------------------------------*/
310int ql_dm_set_air_plane_mode(QL_DM_AIR_PLANE_MODE_TYPE_E air_plane_mode);
311
312
313/*-----------------------------------------------------------------------------------------------*/
314/**
315 @brief register air plane mode event.
316 @param[in] cb_func Air plane mode indication callback function
317 @return Whether the air plane mode event was successfully registered.
318 @retval QL_ERR_OK successful
319 @retval QL_ERR_NOT_INIT uninitialized
320 @retval QL_ERR_SERVICE_NOT_READY service is not ready
321 @retval QL_ERR_INVALID_ARG Invalid arguments
322 @retval Other error code defined by ql_type.h
323 */
324/*-----------------------------------------------------------------------------------------------*/
325int ql_dm_set_air_plane_mode_ind_cb(ql_dm_air_plane_mode_ind_cb cb_func);
326
327
328/*-----------------------------------------------------------------------------------------------*/
329/**
330 @brief get cpu occupancy.
331 @param[out] cpu_occupancy The percentage of cpu occupancy
332 @return Whether to successfully get the cpu occupancy
333 @retval QL_ERR_OK successful
334 @retval QL_ERR_NOT_INIT uninitialized
335 @retval QL_ERR_SERVICE_NOT_READY service is not ready
336 @retval QL_ERR_INVALID_ARG Invalid arguments
337 @retval Other error code defined by ql_type.h
338 */
339/*-----------------------------------------------------------------------------------------------*/
340int ql_dm_get_cpu_occupancy(float *cpu_occupancy);
341
342
343/*-----------------------------------------------------------------------------------------------*/
344/**
345 @brief get mem usage.
346 @param[out] mem_use The percentage of mem usage
347 @return Whether to successfully get the memory usage
348 @retval QL_ERR_OK successful
349 @retval QL_ERR_NOT_INIT uninitialized
350 @retval QL_ERR_SERVICE_NOT_READY service is not ready
351 @retval QL_ERR_INVALID_ARG Invalid arguments
352 @retval Other error code defined by ql_type.h
353 */
354/*-----------------------------------------------------------------------------------------------*/
355int ql_dm_get_mem_usage(float *mem_use);
356
357
358/*-----------------------------------------------------------------------------------------------*/
359/**
360 @brief get NV item value.
361 @param[in] nv_item_name The NV item name that is either NV item id or NV item path
362 @param[out] nv_item_value The NV value buf of nv_item_name
363 param[in] nv_item_value_len The length of nv_item_value
364 param[out] nv_len The real length of nv_item_name
365 @return Whether to successfully get the NV value
366 @retval QL_ERR_OK successful
367 @retval QL_ERR_NOT_INIT uninitialized
368 @retval QL_ERR_SERVICE_NOT_READY service is not ready
369 @retval QL_ERR_INVALID_ARG Invalid arguments
370 @retval Other error code defined by ql_type.h
371 */
372/*-----------------------------------------------------------------------------------------------*/
373int ql_dm_get_nv_item_value(char *nv_item_name, unsigned char *nv_item_value, int nv_item_value_len,
374 int *nv_len);
375
376
377/*-----------------------------------------------------------------------------------------------*/
378/**
379 @brief set NV item value.
380 @param[in] nv_item_name The NV item name that is either NV item id or NV item path
381 @param[in] nv_item_value The NV value of nv_item_name
382 @param[in] nv_item_value_len The length of nv_item_value
383 param[out] nv_len The real length of nv_item_name
384 @return Whether to successfully set the NV value
385 @retval QL_ERR_OK successful
386 @retval QL_ERR_NOT_INIT uninitialized
387 @retval QL_ERR_SERVICE_NOT_READY service is not ready
388 @retval QL_ERR_INVALID_ARG Invalid arguments
389 @retval Other error code defined by ql_type.h
390 */
391/*-----------------------------------------------------------------------------------------------*/
392int ql_dm_set_nv_item_value(char *nv_item_name, unsigned char *nv_item_value, int nv_item_value_len,
393 int *nv_len);
394
395
396/*-----------------------------------------------------------------------------------------------*/
397/**
398 @brief set radio on, its function is the same as at+cfun=1.
399 @return Whether to successfully set the radio on
400 @retval QL_ERR_OK successful
401 @retval QL_ERR_NOT_INIT uninitialized
402 @retval QL_ERR_SERVICE_NOT_READY service is not ready
403 @retval QL_ERR_INVALID_ARG Invalid arguments
404 @retval Other error code defined by ql_type.h
405 */
406/*-----------------------------------------------------------------------------------------------*/
407int ql_dm_set_radio_on(void);
408
409/*-----------------------------------------------------------------------------------------------*/
410/**
411 @brief set radio off, its function is the same as at+cfun=0.
412 @return Whether to successfully set the radio off
413 @retval QL_ERR_OK successful
414 @retval QL_ERR_NOT_INIT uninitialized
415 @retval QL_ERR_SERVICE_NOT_READY service is not ready
416 @retval QL_ERR_INVALID_ARG Invalid arguments
417 @retval Other error code defined by ql_type.h
418 */
419/*-----------------------------------------------------------------------------------------------*/
420int ql_dm_set_radio_off(void);
421
422/*-----------------------------------------------------------------------------------------------*/
423/**
424 @brief get modem mem and CPU utilization.
425 @param[out] mem_use The percentage of modem utilization
426 @return Whether to successfully get the modem utilization
427 @retval QL_ERR_OK successful
428 @retval QL_ERR_NOT_INIT uninitialized
429 @retval QL_ERR_SERVICE_NOT_READY service is not ready
430 @retval QL_ERR_INVALID_ARG Invalid arguments
431 @retval Other error code defined by ql_type.h
432 */
433/*-----------------------------------------------------------------------------------------------*/
434int ql_dm_get_modem_cpu_occupancy(float *cpu_occupancy);
435
436/*-----------------------------------------------------------------------------------------------*/
437/**
438 @brief get modem mem utilization.
439 @param[out] mem_use The percentage of modem utilization
440 @return Whether to successfully get the modem utilization
441 @retval QL_ERR_OK successful
442 @retval QL_ERR_NOT_INIT uninitialized
443 @retval QL_ERR_SERVICE_NOT_READY service is not ready
444 @retval QL_ERR_INVALID_ARG Invalid arguments
445 @retval Other error code defined by ql_type.h
446 */
447/*-----------------------------------------------------------------------------------------------*/
448int ql_dm_get_modem_mem_usage(float *mem_use);
449
450/*-----------------------------------------------------------------------------------------------*/
451/**
452 @brief get QOOS enable state
453 @param[out] enable The enable state of QOOS
454 @return Whether to successfully get the QOOS enable state
455 @retval QL_ERR_OK successful
456 @retval QL_ERR_NOT_INIT uninitialized
457 @retval QL_ERR_SERVICE_NOT_READY service is not ready
458 @retval QL_ERR_INVALID_ARG Invalid arguments
459 @retval Other error code defined by ql_type.h
460 */
461/*-----------------------------------------------------------------------------------------------*/
462int ql_dm_get_qoos_enable(char *enable);
463
464/*-----------------------------------------------------------------------------------------------*/
465/**
466 @brief set QOOS enable state
467 @param[in] enable The enable state of QOOS
468 @return Whether to successfully set the QOOS enable state
469 @retval QL_ERR_OK successful
470 @retval QL_ERR_NOT_INIT uninitialized
471 @retval QL_ERR_SERVICE_NOT_READY service is not ready
472 @retval QL_ERR_INVALID_ARG Invalid arguments
473 @retval Other error code defined by ql_type.h
474 */
475/*-----------------------------------------------------------------------------------------------*/
476int ql_dm_set_qoos_enable(char enable);
477
478/*-----------------------------------------------------------------------------------------------*/
479/**
480 @brief get QOOS configuration
481 @param[out] config The configuration of QOOS
482 @return Whether to successfully get the QOOS configuration
483 @retval QL_ERR_OK successful
484 @retval QL_ERR_NOT_INIT uninitialized
485 @retval QL_ERR_SERVICE_NOT_READY service is not ready
486 @retval QL_ERR_INVALID_ARG Invalid arguments
487 @retval Other error code defined by ql_type.h
488 */
489/*-----------------------------------------------------------------------------------------------*/
490//int ql_dm_get_qoos_config(ql_dm_qoos_config_t *config);
491
492/*-----------------------------------------------------------------------------------------------*/
493/**
494 @brief set QOOS configuration
495 @param[in] config The configuration of QOOS
496 @return Whether to successfully set the QOOS configuration
497 @retval QL_ERR_OK successful
498 @retval QL_ERR_NOT_INIT uninitialized
499 @retval QL_ERR_SERVICE_NOT_READY service is not ready
500 @retval QL_ERR_INVALID_ARG Invalid arguments
501 @retval Other error code defined by ql_type.h
502 */
503/*-----------------------------------------------------------------------------------------------*/
504//int ql_dm_set_qoos_config(ql_dm_qoos_config_t config);
505
506/*-----------------------------------------------------------------------------------------------*/
507/**
508 @brief get MSSR(Modem SubSysem Reset) level.
509 @param[out] p_level The MSSR level
510 @return Whether to successfully get the MSSR level
511 @retval QL_ERR_OK successful
512 @retval QL_ERR_NOT_INIT uninitialized
513 @retval QL_ERR_SERVICE_NOT_READY service is not ready
514 @retval QL_ERR_INVALID_ARG Invalid arguments
515 @retval Other error code defined by ql_type.h
516 */
517/*-----------------------------------------------------------------------------------------------*/
518int ql_dm_get_mssr_level(int *p_level);
519
520/*-----------------------------------------------------------------------------------------------*/
521/**
522 @brief set MSSR(Modem SubSysem Reset) level.
523 @param[in] level The MSSR level
524 @return Whether to successfully set the MSSR level
525 @retval QL_ERR_OK successful
526 @retval QL_ERR_NOT_INIT uninitialized
527 @retval QL_ERR_SERVICE_NOT_READY service is not ready
528 @retval QL_ERR_INVALID_ARG Invalid arguments
529 @retval Other error code defined by ql_type.h
530 */
531/*-----------------------------------------------------------------------------------------------*/
532int ql_dm_set_mssr_level(int level);
533
534
535/*-----------------------------------------------------------------------------------------------*/
536/**
537 @brief bind subscription
538 @param[in] sub_type subscription type
539 @return Whether to successfully bind subscription.
540 @retval QL_ERR_OK successful
541 @retval QL_ERR_NOT_INIT uninitialized
542 @retval QL_ERR_SERVICE_NOT_READY service is not ready
543 @retval QL_ERR_INVALID_ARG Invalid arguments
544 @retval Other error code defined by ql_type.h
545 */
546/*-----------------------------------------------------------------------------------------------*/
547int ql_dm_bind_subscription(QL_DM_BIND_SUB_TYPE_E sub_type);
548
549/*-----------------------------------------------------------------------------------------------*/
550/**
551 @brief Registration server error callback. Currently, only if the server exits abnormally,
552 the callback function will be executed, and the error code is QL_ERR_ABORTED;
553 @param[in] cb Callback function
554 @return
555 QL_ERR_OK - successful
556 Other - error code defined by ql_type.h
557 */
558/*-----------------------------------------------------------------------------------------------*/
559int ql_dm_set_service_error_cb(ql_dm_service_error_cb_f cb);
560
561/*-----------------------------------------------------------------------------------------------*/
562/**
563 @brief Get module the last time shutdown reason
564 @param[out] shutdown_reason the shutdown reason
565 @return
566 QL_ERR_OK - successful
567 Other - error code defined by ql_type.h
568 */
569/*-----------------------------------------------------------------------------------------------*/
570int ql_dm_get_shutdown_reason(QL_DM_SHUTDOWN_REASON_E *shutdown_reason);
571
572/*-----------------------------------------------------------------------------------------------*/
573/**
574 @brief Get module this time bootup reason
575 @param[out] bootup_reason the bootup reason
576 @return
577 QL_ERR_OK - successful
578 Other - error code defined by ql_type.h
579 */
580/*-----------------------------------------------------------------------------------------------*/
581int ql_dm_get_bootup_reason(QL_DM_BOOT_UP_REASON_E *bootup_reason);
582
583/*-----------------------------------------------------------------------------------------------*/
584/**
585 @brief set oos config
586 @param[out] oos param
587 @return
588 QL_ERR_OK - successful
589 Other - error code defined by ql_type.h
590 */
591/*-----------------------------------------------------------------------------------------------*/
592int ql_dm_set_qoos_config(int p1, int p2, int p3);
593
594
595/*-----------------------------------------------------------------------------------------------*/
596/**
597 @brief get oos config
598 @param[out] oos param
599 @return
600 QL_ERR_OK - successful
601 Other - error code defined by ql_type.h
602 */
603/*-----------------------------------------------------------------------------------------------*/
604int ql_dm_get_qoos_config(int *p1, int *p2, int *p3);
605
606/*-----------------------------------------------------------------------------------------------*/
607/**
608 @brief set oos enable
609 @param[out] oos param
610 @return
611 QL_ERR_OK - successful
612 Other - error code defined by ql_type.h
613 */
614/*-----------------------------------------------------------------------------------------------*/
615int ql_dm_set_qoos_enable(char enable);
616#ifdef __cplusplus
617}
618#endif
619
620
621#endif
622