Add toolchain and mbtk source

Change-Id: Ie12546301367ea59240bf23d5e184ad7e36e40b3
diff --git a/mbtk/include/ql/DSI_ConnectManager.h b/mbtk/include/ql/DSI_ConnectManager.h
new file mode 100755
index 0000000..3a8029f
--- /dev/null
+++ b/mbtk/include/ql/DSI_ConnectManager.h
@@ -0,0 +1,259 @@
+/**  
+  @file
+  DSI_ConnectManager.h
+
+  @brief
+  This file provides the definitions for dsi, and declares the 
+  API functions.
+
+*/
+/*============================================================================
+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+ =============================================================================*/
+/*===========================================================================
+
+                        EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+
+WHEN        WHO            WHAT, WHERE, WHY
+----------  ------------   ----------------------------------------------------
+24/07/2019  Nebula.li      create
+=============================================================================*/
+
+#ifndef __DSI_CONNECTMANAGER_H__
+#define __DSI_CONNECTMANAGER_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define QL_WAN_SUCCESS                      (0)
+#define QL_WAN_ERROR                        (-1)
+#define QL_INTERFACE_NAME_LEN               16
+#define QL_IPV4_MAX_ADDR_LEN                32
+#define QL_IPV6_MAX_ADDR_LEN                128
+
+
+/**
+ * used to check network status, when timeout, start data call again.
+*/
+#define QL_WAN_NETWORK_STATUS_MAX_TIMEOUT   (60)
+
+
+/**
+ * DSI event define
+ */ 
+typedef enum
+{
+  CONNECT_DISCON = 0x00,
+  CONNECT_CONSUCCESS,
+  CONNECT_CONNING,
+  CONNECT_REDIAL,
+  CONNECT_DIAL_IMMEDIATELY,
+  CONNECT_ROAM,
+  CONNECT_WAIT_NWCHANGE,
+  CONNECT_GET_GLOBALIP_ERR,
+  CONNECT_DEACTIVATED,
+  CONNECT_WAIT_PS_ATTACH,
+
+  FAIL_BASE_INDEX=0x10,
+  SIM_NOT_READY=FAIL_BASE_INDEX+0x01,
+  NW_NOT_READY=FAIL_BASE_INDEX+0x02,
+  PDP_OPERATOR_BARRED =FAIL_BASE_INDEX+0x08,               /* no retry */
+  PDP_INSUFFICIENT_RESOURCES =FAIL_BASE_INDEX+0x1A,
+  PDP_MISSING_UKNOWN_APN = FAIL_BASE_INDEX+0x1B,            /* no retry */
+  PDP_UNKNOWN_PDP_ADDRESS_TYPE = FAIL_BASE_INDEX+0x1C,      /* no retry */
+  PDP_USER_AUTHENTICATION = FAIL_BASE_INDEX+0x1D,           /* no retry */
+  PDP_ACTIVATION_REJECT_GGSN = FAIL_BASE_INDEX+0x1E,        /* no retry */
+  PDP_ACTIVATION_REJECT_UNSPECIFIED = FAIL_BASE_INDEX+0x1F,
+  PDP_SERVICE_OPTION_NOT_SUPPORTED = FAIL_BASE_INDEX+0x20,  /* no retry */
+  PDP_SERVICE_OPTION_NOT_SUBSCRIBED = FAIL_BASE_INDEX+0x21, /* no retry */
+  PDP_SERVICE_OPTION_OUT_OF_ORDER = FAIL_BASE_INDEX+0x22,
+  PDP_NSAPI_IN_USE = FAIL_BASE_INDEX+0x23,                  /* no retry */
+  PDP_REGULAR_DEACTIVATION = FAIL_BASE_INDEX+0x24,          /* possibly restart radio,
+                                                    based on framework config */
+  PDP_ONLY_IPV4_ALLOWED = FAIL_BASE_INDEX+0x32,             /* no retry */
+  PDP_ONLY_IPV6_ALLOWED = FAIL_BASE_INDEX+0x33,             /* no retry */
+  PDP_ONLY_SINGLE_BEARER_ALLOWED = FAIL_BASE_INDEX+0x34,
+  PDP_PROTOCOL_ERRORS   = FAIL_BASE_INDEX+0x6F,             /* no retry */
+
+  /* Not mentioned in the specification */
+  PDP_VOICE_REGISTRATION_FAIL = -1,
+  PDP_DATA_REGISTRATION_FAIL = -2,
+
+  /* reasons for data call drop - network/modem disconnect */
+  PDP_SIGNAL_LOST = -3,
+  PDP_PREF_RADIO_TECH_CHANGED = -4,/* preferred technology has changed, should retry
+                                            with parameters appropriate for new technology */
+  PDP_RADIO_POWER_OFF = -5,        /* data call was disconnected because radio was resetting,
+                                            powered off - no retry */
+  PDP_TETHERED_CALL_ACTIVE = -6,   /* data call was disconnected by modem because tethered
+                                            mode was up on same APN/data profile - no retry until
+                                            tethered call is off */
+	PDP_CID_EXIST_FAIL = -7,		  /* cid is exist already*/
+
+  PDP_NO_CCINET=-10,
+  PDP_DHCP_SERVER_ERR_PIPE=-11,
+
+  PDP_ERROR_UNSPECIFIED = 0xffff,  /* retry silently */
+  QL_DSI_EVT_MAX
+} QL_DSI_NET_EVT_T;
+
+#define SIM_REMOVED SIM_NOT_READY
+
+typedef struct
+{
+	char ip[QL_IPV4_MAX_ADDR_LEN];
+	char pri_dns[QL_IPV4_MAX_ADDR_LEN];
+	char sec_dns[QL_IPV4_MAX_ADDR_LEN];
+  char name[QL_INTERFACE_NAME_LEN];
+  char gateway[QL_IPV4_MAX_ADDR_LEN];
+}v4_address_status;
+
+typedef struct
+{
+	int state; //dial status
+	v4_address_status addr; //IPv4 address information
+}v4_info;
+
+typedef struct
+{
+	char ip[QL_IPV6_MAX_ADDR_LEN];
+	char pri_dns[QL_IPV6_MAX_ADDR_LEN];
+	char sec_dns[QL_IPV6_MAX_ADDR_LEN];
+  char name[QL_INTERFACE_NAME_LEN];
+  char gateway[QL_IPV6_MAX_ADDR_LEN];
+}v6_address_status;
+
+typedef struct
+{
+	int state; //dial status
+	v6_address_status addr; //IPv6 address information
+}v6_info;
+
+typedef struct
+{
+	int profile_idx;
+	int ip_type;
+	v4_info v4;
+	v6_info v6;
+}ql_data_call_info;
+
+/**
+ * DSI auth pref define
+*/
+typedef enum
+{
+  QL_DSI_AUTH_PREF_NULL = 0,
+  QL_DSI_AUTH_PREF_ONLY_PAP,
+  QL_DSI_AUTH_PREF_ONLY_CHAP,
+  //QL_DSI_AUTH_PREF_BOTH_PAP_CHAP
+} QL_DSI_AUTH_PREF_T;
+
+/** 
+ * callback function used in  ql_wan_start, when data call status changed, 
+ * Use callback functions for notifications, see enum QL_DSI_NET_EVT_T
+*/
+typedef void (*nw_status_cb)(int status);
+
+
+typedef void (*ex_conn_status_cb)(int cid,int iptype,int status,int cause);
+
+
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief data call init function, must call first.
+  @return if success return QL_WAN_SUCCESS, else return QL_WAN_ERROR
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_wan_init();
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief data call release function, must call finally.
+  @return if success return QL_WAN_SUCCESS, else return QL_WAN_ERROR
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_wan_release();
+
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief data call auto connect set, include auto status and interval(seconds).
+  @param[in] auto_status  When it is 0, the network cannot be automatically reconnected 
+                                after disconnection; when it is 1, it can be automatically reconnected
+  @param[in] interval_sec data call status check interval
+                                the max value is QL_WAN_NETWORK_STATUS_MAX_TIMEOUT
+  @return if success return QL_WAN_SUCCESS, else return QL_WAN_ERROR
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_wan_set_autoconnect(int auto_status, int interval_sec);
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief start data call, must call ql_wan_init first.
+  @param[in] nw_cb this is a callback function, when data call status changed, Use callback 
+                   functions for notifications
+  @return if success return QL_WAN_SUCCESS, else return QL_WAN_ERROR
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_wan_start(int profile_idx, int op, nw_status_cb nw_cb);
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief start data call, must call ql_wan_init first.
+  @param[in] nw_cb this is a callback function, when data call status changed, Use callback 
+                   functions for notifications
+  @return if success return QL_WAN_SUCCESS, else return QL_WAN_ERROR
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_wan_start_ex(int profile_idx, int op, ex_conn_status_cb nw_cb);
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief data call stop function.
+  @return if success return QL_WAN_SUCCESS, else return QL_WAN_ERROR
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_wan_stop(int profile_idx);
+
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief function to set apn.
+  @param[in] apn        apn name want to set
+  @param[in] username   user name of apn
+  @param[in] password   password of apn
+  @param[in] auth       auth type of apn, see enum QL_DSI_AUTH_PREF_T
+  @return if success return QL_WAN_SUCCESS, else return QL_WAN_ERROR
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_wan_setapn(int profile_idx, int ip_type, const char *apn, const char *userName, const char *password, QL_DSI_AUTH_PREF_T auth);
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief function to get first apn infomation.
+  @param[out] apn       apn name to return
+  @param[in ] apnLen    apn name buffer size
+  @param[out] userName  username of apn to return
+  @param[in ] userLen   username buffer size
+  @param[out] password  password to return
+  @param[in ] pwdLen    password buffer size 
+  @return if success return QL_WAN_SUCCESS, else return QL_WAN_ERROR
+  */
+/*-----------------------------------------------------------------------------------------------*/
+
+#define ql_wan_getapn(profile_idx,ip_type,apn,apnLen,userName,userLen,password,pwdLen,...)   __ql_wan_getapn(profile_idx,ip_type,apn,apnLen,userName,userLen,password,pwdLen,(NULL,##__VA_ARGS__))
+
+int __ql_wan_getapn(int profile_idx, int *ip_type, char *apn, int apnLen, char *userName, int userLen, char *password, int pwdLen,int* auth);
+int ql_get_data_call_info(int profile_idx, ql_data_call_info *info);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/mbtk/include/ql/ql_adc.h b/mbtk/include/ql/ql_adc.h
new file mode 100755
index 0000000..a2c71df
--- /dev/null
+++ b/mbtk/include/ql/ql_adc.h
@@ -0,0 +1,47 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of Quectel Co., Ltd. 2019
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ *   ql_adc.h 
+ *
+ * Project:
+ * --------
+ *   OpenLinux
+ *
+ * Description:
+ * ------------
+ *   ADC API defines.
+ *
+ *
+ *============================================================================
+ *             HISTORY
+ *----------------------------------------------------------------------------
+ * WHO            WHEN                WHAT
+ *----------------------------------------------------------------------------
+ * Carola.Zhang   20/11/2019		  Create.
+ ****************************************************************************/
+
+#ifndef __QL_ADC_H__
+#define __QL_ADC_H__
+
+typedef enum {
+    QADC_NONE = -1,
+    ADC0 = 0,
+    ADC1 = 1,
+    QADC_END
+}Enum_QADC;
+
+
+int ql_adc_show(Enum_QADC qadc);
+
+
+#endif
\ No newline at end of file
diff --git a/mbtk/include/ql/ql_at.h b/mbtk/include/ql/ql_at.h
new file mode 100755
index 0000000..9cd6e8f
--- /dev/null
+++ b/mbtk/include/ql/ql_at.h
@@ -0,0 +1,91 @@
+
+#ifndef __QL_AT_H__
+#define __QL_AT_H__
+
+//#include <stdint.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TRUE  1
+#define FALSE 0
+
+#define BUF_LEN     1024
+
+#define MAX_URC_EVENT_HANDLER_ARRAY_SIZE    10
+
+//typedef unsigned int size_t;
+typedef int URC_EVENT_HANDLE;
+typedef void (*ql_urc_event_handle_func_t)(const char* urc_content);
+
+typedef struct
+{
+    char*      urc_event;
+    ql_urc_event_handle_func_t    pfun;
+} st_urc_handle_node;
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Standard result codes.
+ *
+ * @note All error codes are negative integers. They allow functions with signed
+ *  integers to return non-negative values when successful or standard error codes on failure.
+ * @deprecated the result code LE_NOT_POSSIBLE is scheduled to be removed.
+ */
+//--------------------------------------------------------------------------------------------------
+typedef enum
+{
+    E_QL_OK                 = 0,    ///< Successful.
+    E_QL_NOT_FOUND          = -1,   ///< Referenced item does not exist or could not be found.
+    E_QL_NOT_POSSIBLE       = -2,   ///< @deprecated It is not possible to perform the requested action.
+    E_QL_OUT_OF_RANGE       = -3,   ///< An index or other value is out of range.
+    E_QL_NO_MEMORY          = -4,   ///< Insufficient memory is available.
+    E_QL_NOT_PERMITTED      = -5,   ///< Current user does not have permission to perform requested action.
+    E_QL_FAULT              = -6,   ///< Unspecified internal error.
+    E_QL_COMM_ERROR         = -7,   ///< Communications error.
+    E_QL_TIMEOUT            = -8,   ///< A time-out occurred.
+    E_QL_OVERFLOW           = -9,   ///< An overflow occurred or would have occurred.
+    E_QL_UNDERFLOW          = -10,  ///< An underflow occurred or would have occurred.
+    E_QL_WOULD_BLOCK        = -11,  ///< Would have blocked if non-blocking behaviour was not requested.
+    E_QL_DEADLOCK           = -12,  ///< Would have caused a deadlock.
+    E_QL_FORMAT_ERROR       = -13,  ///< Format error.
+    E_QL_DUPLICATE          = -14,  ///< Duplicate entry found or operation already performed.
+    E_QL_BAD_PARAMETER      = -15,  ///< Parameter is invalid.
+    E_QL_CLOSED             = -16,  ///< The resource is closed.
+    E_QL_BUSY               = -17,  ///< The resource is busy.
+    E_QL_UNSUPPORTED        = -18,  ///< The underlying resource does not support this operation.
+    E_QL_IO_ERROR           = -19,  ///< An IO operation failed.
+    E_QL_NOT_IMPLEMENTED    = -20,  ///< Unimplemented functionality.
+    E_QL_UNAVAILABLE        = -21,  ///< A transient or temporary loss of a service or resource.
+    E_QL_TERMINATED         = -22,  ///< The process, operation, data stream, session, etc. has stopped.
+}E_QL_RESULT;
+
+extern const char strDelimit[];
+
+extern st_urc_handle_node g_urc_handler[];
+
+/*
+    Specify the AT port name used for sending/receiving AT cmd.
+*/
+extern int QL_AT_PortInit(char *device_path);   
+
+extern void QL_AT_PortDeinit(void);
+
+/*
+    register the URC event call back, such as "+CMT: ;+CDS: ;+CBM: ;+CMTI: ;" seperated by ";" for sms.
+*/
+extern URC_EVENT_HANDLE register_urc_callback_func(const char* urc_event, ql_urc_event_handle_func_t pfun);
+
+/*
+    unregister the URC event call back.
+*/
+extern void unregister_urc_callback_func(URC_EVENT_HANDLE h_handle);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__QL_AT_H__
diff --git a/mbtk/include/ql/ql_atc.h b/mbtk/include/ql/ql_atc.h
new file mode 100755
index 0000000..4c8d8a8
--- /dev/null
+++ b/mbtk/include/ql/ql_atc.h
@@ -0,0 +1,63 @@
+/**

+  @file

+  ql_atc.h

+  @brief

+  send at command api

+

+*/

+/*============================================================================

+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.

+  Quectel Wireless Solution Proprietary and Confidential.

+ =============================================================================*/

+/*===========================================================================

+

+                        EDIT HISTORY FOR MODULE

+

+This section contains comments describing changes made to the module.

+Notice that changes are listed in reverse chronological order.

+

+

+WHEN        WHO            WHAT, WHERE, WHY

+----------  ------------   ----------------------------------------------------

+06/07/2022  Wayen.xu      create

+=============================================================================*/

+

+#ifndef QL_ATC_H

+#define QL_ATC_H

+

+/*******************************************************

+* @method: ql_atc_init

+* @Description: initialize environment variables.                

+* @param: void

+* @return: 

+         success: return 0

+         error: return !0

+********************************************************/

+int ql_atc_init();

+

+/*******************************************************

+* @method: ql_atc_release

+* @Description: release environment variables.                

+* @param: void

+* @return: 

+         success: return 0

+         error: return !0

+********************************************************/

+int ql_atc_release();

+

+/*******************************************************

+* @method: ql_atc_send

+* @Description: send at command(synchronous)

+                use this api should first call init api and finish call release api                

+* @param:

+         cmd: at command

+         resp: at return value

+         len: response value length

+* @return: 

+         success: return 0

+         error: return !0

+********************************************************/

+int ql_atc_send(char* cmd, char* resp, int resp_len);

+

+

+#endif

diff --git a/mbtk/include/ql/ql_audio.h b/mbtk/include/ql/ql_audio.h
new file mode 100755
index 0000000..68c2190
--- /dev/null
+++ b/mbtk/include/ql/ql_audio.h
@@ -0,0 +1,627 @@
+/**
+  @file
+  ql_audio.h
+
+  @brief
+  This file provides the definitions for audio & record, and declares the
+  API functions.
+
+*/
+/*============================================================================
+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+ =============================================================================*/
+/*===========================================================================
+
+                        EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+
+WHEN        WHO            WHAT, WHERE, WHY
+----------  ------------   ----------------------------------------------------
+07/06/2018  Stanley.yong   Revise the comments for API.
+19/04/2018  Zichar.zhang   Add Ql_Update_wav_size function.
+                           Add Ql_AudPlayer_OpenExt function.
+                           Add Ql_AudRecorder_OpenExt function.
+19/12/2016  Stanley.yong   Optimize the APIs, and add comments.
+13/12/2016  Running.qian   Implement newly-designed APIs.
+18/07/2016	Jun.wu         Create
+=============================================================================*/
+
+#ifndef __AUD_H__
+#define __AUD_H__
+
+//this two headers for alsa params setting
+// #include "asoundlib.h"
+//#include "alsa-intf/alsa_audio.h"
+
+#include "mbtk_type.h"
+
+#define QUEC_PCM_8K 8000
+#define QUEC_PCM_16K 16000
+#define QUEC_PCM_44k 44100
+#define QUEC_PCM_MONO 1
+#define QUEC_PCM_STEREO 2
+
+typedef enum {
+        AUD_UP_LINK = 0,
+        AUD_DOWN_LINK,
+} Enum_AudDlink;
+
+typedef enum {
+	AUD_PLAYER_ERROR = -1,
+	AUD_PLAYER_START = 0,
+	AUD_PLAYER_PAUSE,
+	AUD_PLAYER_RESUME,
+	AUD_PLAYER_NODATA,  //Buff no data and play tread will sleep
+    AUD_PLAYER_LESSDATA, //Buff has less data
+	AUD_PLAYER_FINISHED,
+} Enum_AudPlayer_State;
+
+typedef enum {
+	AUD_RECORDER_ERROR = -1,
+	AUD_RECORDER_START = 0,
+	AUD_RECORDER_PAUSE,
+	AUD_RECORDER_RESUME,
+	AUD_RECORDER_FINISHED,
+} Enum_AudRecorder_State;
+
+
+/****************************************************************************
+*  Audio Volume Level Definition
+***************************************************************************/
+typedef enum {
+	AUD_VOLUME_LEVEL1 = 0,
+	AUD_VOLUME_LEVEL2,
+	AUD_VOLUME_LEVEL3,
+	AUD_VOLUME_LEVEL4,
+	AUD_VOLUME_LEVEL5,
+	AUD_VOLUME_LEVEL_END
+}Enum_AudVolumeLevel;
+
+/****************************************************************************
+*  Audio Format
+***************************************************************************/
+typedef enum {
+	AUD_STREAM_FORMAT_MP3 = 0,
+	AUD_STREAM_FORMAT_AMR = 1,
+	AUD_STREAM_FORMAT_PCM = 2,
+	AUD_STREAM_FORMAT_END
+} Enum_AudStreamFormat;
+
+/****************************************************************************
+*  Audio Direct
+***************************************************************************/
+typedef enum {
+	AUD_LINK_REVERSE = 0,
+	AUD_LINK_FORWARD = 1,
+	AUD_LINK_BOTH = 2,
+	AUD_LINK_INVALID
+}Enum_AudStreamDirection;
+
+
+/*****************************************************************
+********************New Advanced Audio High API******************
+* ***************************************************************/
+struct wav_header {
+	uint32_t riff_id;
+	uint32_t riff_sz;
+	uint32_t riff_fmt;
+	uint32_t fmt_id;
+	uint32_t fmt_sz;
+	uint16_t audio_format;
+	uint16_t num_channels;
+	uint32_t sample_rate;
+	uint32_t byte_rate;       /* sample_rate * num_channels * bps / 8 */
+	uint16_t block_align;     /* num_channels * bps / 8 */
+	uint16_t bits_per_sample;
+	uint32_t data_id;
+	uint32_t data_sz;
+};
+
+#define ID_RIFF 0x46464952
+#define ID_WAVE 0x45564157
+#define ID_FMT  0x20746d66
+#define ID_DATA 0x61746164
+#define FORMAT_PCM 1
+
+struct ST_MediaParams {
+	Enum_AudStreamFormat     format;
+	Enum_AudVolumeLevel      volume;
+	Enum_AudStreamDirection     direct;
+};
+
+
+//
+// Function:  _cb_onPlayer
+//
+// Description:
+//   This callback function handles the result of audio player.
+//
+// @param hdl:
+//   Handle received from Ql_AudPlayer_Open().
+// @param result:
+//   the executing result for previous operation, such as Open, Play, Pause, Resume, Stop.
+//   see the definition of Enum_AudPlayer_State for the specific meaning.
+typedef int(*_cb_onPlayer)(int hdl, int result);
+//
+// Function:  _cb_onRecorder
+//
+// Description:
+//   This callback function handles the result of audio recorder.
+//   If result < 0, the recorder will stop the recording automatically.
+//
+// @param result:
+//   the executing result for previous operation, such as Open, StartRecord, Pause, Resume, Stop.
+//   see the definition of Enum_AudRecorder_State for the specific meaning.
+// @param pBuf:
+//   pointer to the output recording (PCM) data.
+// @param length:
+//   the length of the output recording (PCM) data.
+typedef int(*_cb_onRecorder)(int result, unsigned char* pBuf, unsigned int length);  //if result < 0 will stop record, else  continue record
+
+/*****************************************************************
+* Function:     Ql_AudPlayer_Open
+*
+* Description:
+*               Open audio play device, and specify the callback function.
+*               This function can be called twice to play different audio sources.
+*
+* Parameters:
+*               device  : a string that specifies the PCM device.
+*                         NULL, means the audio will be played on the default PCM device.
+*
+*                         If you want to mixedly play audio sources, you can call this
+*                         API twice with specifying different PCM device.
+*                         The string devices available:
+*                            "hw:0,0"  (the default play device)
+*                            "hw:0,13" (this device can mix audio and TTS)
+*                            "hw:0,14"
+*
+*		        cb_func : callback function for audio player.
+*                         The results of all operations on audio player
+*                         are informed in callback function.
+*
+* Return:
+*               pcm device handle on success
+*               -1 for failure
+*****************************************************************/
+int  Ql_AudPlayer_Open(char* device, _cb_onPlayer cb_func);
+
+/*========================================================================
+  FUNCTION:  Ql_AudPlayer_Play
+=========================================================================*/
+/** @brief
+    This function writes pcm data to pcm device to play.
+
+    @param[in] hdl, the handle returned by Ql_AudPlayer_Open().
+    @param[in] pData, pointer to the start address of pcm data.
+    @param[in] length, the length of pcm data.
+
+    @return
+    on success, the return value is the number of bytes to play
+    on failure, the return value is -1;
+
+    @dependencies
+    Ql_AudPlayer_Open() must be first called successfully.
+*/
+/*=======================================================================*/
+int  Ql_AudPlayer_Play(int hdl, unsigned char* pData, unsigned int length);
+
+/*========================================================================
+  FUNCTION:  Ql_AudPlayer_PlayFrmFile
+=========================================================================*/
+/** @brief
+    This function plays the pcm data from the specified file.
+
+    @param[in] hdl, the handle returned by Ql_AudPlayer_Open().
+    @param[in] fd, a file descriptor that contains pcm data.
+               Note:
+                 the file offset should be set to the start position of pcm
+                 data region, which means you should move the file offset
+                 skipping the file header (such as wave header, amr header).
+    @param[in] offset, file offset. Please set it to -1 if no need to use.
+
+    @return
+       0 on success
+      -1 on failure
+
+    @dependencies
+    Ql_AudPlayer_Open() must be first called successfully.
+*/
+/*=======================================================================*/
+int  Ql_AudPlayer_PlayFrmFile(int hdl, int fd, int offset);
+//
+// Function:  Ql_AudPlayer_Pause
+//
+// Description:
+//   Pause playing.
+// @param hdl:
+//   Handle received from Ql_AudPlayer_Open().
+int  Ql_AudPlayer_Pause(int hdl);
+//
+// Function:  Ql_AudPlayer_Resume
+//
+// Description:
+//   Resume playing.
+// @param hdl:
+//   Handle received from Ql_AudPlayer_Open().
+int  Ql_AudPlayer_Resume(int hdl);
+//
+// Function:  Ql_AudPlayer_Stop
+//
+// Description:
+//   Stop playing audio
+// hdl:
+//   Handle received from Ql_AudPlayer_Open().
+void Ql_AudPlayer_Stop(int hdl);
+//
+// Function:  Ql_AudPlayer_Close
+//
+// Description:
+//   Close player, and free the resource.
+// @param hdl:
+//   Handle received from Ql_AudPlayer_Open().
+void Ql_AudPlayer_Close(int hdl);
+
+
+int Ql_AudPlayer_set_LessDataThreshold(int hdl, unsigned short threshSize);
+
+int Ql_AudPlayer_get_freeSpace(int hdl);
+
+
+/*****************************************************************
+* Function:     Ql_AudRecorder_Open
+*
+* Description:
+*               Open audio record device, and specify the callback function.
+*
+* Parameters:
+*               device  : not used. MUST be NULL.
+*
+*		        cb_func : callback function for audio player.
+*                         The results of all operations on audio recorder
+*                         are informed in callback function.
+*
+* Return:
+*               pcm device handle
+*               -1 for failure
+*****************************************************************/
+int  Ql_AudRecorder_Open(char* device, _cb_onRecorder cb_fun);
+//
+// Function:  Ql_AudRecorder_StartRecord
+//
+// Description:
+//   Start to record.
+//   The record data is output in _cb_onRecorder.
+//
+// Return:
+//            0 on success
+//            -1 on failure
+int  Ql_AudRecorder_StartRecord(void);
+//
+// Function:  Ql_AudRecorder_Pause
+//
+// Description:
+//   Pause recording
+int  Ql_AudRecorder_Pause(void);
+//
+// Function:  Ql_AudRecorder_Resume
+//
+// Description:
+//   Resume recording
+int  Ql_AudRecorder_Resume(void);
+//
+// Function:  Ql_AudRecorder_Stop
+//
+// Description:
+//   Stop recording
+void Ql_AudRecorder_Stop(void);
+//
+// Function:  Ql_AudRecorder_Close
+//
+// Description:
+//   Close recorder, and free the resource
+void Ql_AudRecorder_Close(void);
+
+//
+// Function:  Ql_clt_set_mixer_value
+//
+// Description:
+//   Close recorder, and free the resource
+boolean Ql_clt_set_mixer_value(const char *device, int count, const char *value);
+
+
+//****************QL TONE API************************//
+struct Ql_TonePara {
+    unsigned int lowFreq;   //100-4000HZ
+    unsigned int highFreq;  //100-4000HZ
+    unsigned int volume;    //0 -1000
+    unsigned int duration;  // >0 ms
+};
+
+int Ql_AudTone_Open(char* device, _cb_onPlayer cb);//cb not support now
+int Ql_AudTone_Start(int hdl, struct Ql_TonePara *para);
+void Ql_AudTone_Stop(int hdl);
+void Ql_AudTone_Close(int hdl);
+
+
+//****************QL Codec API************************//
+struct Ql_ALC5616_DRCAGC {
+    unsigned short control1_mask;
+    unsigned short control1_value;
+    unsigned short control2_mask;
+    unsigned short control2_value;
+    unsigned short control3_mask;
+    unsigned short control3_value;
+};
+
+//
+// Function:  Ql_AudCodec_Set_ALC5616_DRCAGC
+//
+// Description:
+//   Set ALC5616 DRC/AGC configuration
+int Ql_AudCodec_Set_ALC5616_DRCAGC(const char *i2c, struct Ql_ALC5616_DRCAGC *cfg);
+
+//
+// Function:   Ql_Update_wav_size
+//
+// Description:
+//   update wav format file size in the header
+// @param fd:
+//   wav file discriptor
+// @param size:
+//   wav file size to update
+int Ql_Update_wav_size(int fd, int size);
+
+//add by grady, 2018-5-29
+/*
+ * describe : this function is use to open pcm device
+ * paras    :
+ *        device : this should be fix to hw:0,0
+ *        flags ; pcm play flags
+ *        rate: sample rate
+ *        channels  : audio channal 1 or 2
+ *        format: format to play or record, 16bit line,MP3
+ *        hostless: if there is no file it is true
+ * return    :
+ *        pcm : pcm handle, use can use this handle to read write data
+ */
+struct pcm *quec_pcm_open(char *device, unsigned flags, unsigned rate, unsigned channels, unsigned format, unsigned hostless);
+
+/*
+ * describe : this function is use to close pcm handle
+ * paras    :
+ *        pcm : pcm handle to close
+ * return    :
+ */
+int quec_pcm_close(struct pcm *pcm );
+
+/*
+ * describe : this function is use to read pcm buffer
+ * paras    :
+ *        pcm : pcm handle to write date
+ *        buffer: data buffer
+ *        lenth: data length
+ * return    :
+ */
+int quec_read_pcm(struct pcm *pcm, void * buffer, int length);
+
+/*
+ * describe : this function is use to get pcm buffer lenth
+ * paras    :
+ *        lenth: data length
+ * return
+ *        buffer length
+ */
+int quec_get_pem_buffer_len(struct pcm *pcm);
+
+//add by grady, 2018-6-2
+/*
+ * describe : this function is use to open mixer device
+ * paras        :
+ *              device: mixer device
+ * return
+ *              mixer handle
+ */
+struct mixer *quec_mixer_open(const char *device);
+
+/*
+ * describe : this function is use to close mixer device
+ * paras        :
+ *              mixer: mixer handle
+ * return
+ *              none
+ */
+void quec_mixer_close(struct mixer *mixer);
+
+/*
+ * describe : this function is use to get mixer devie control
+ * paras        :
+ *              mixer: mixer handle
+ *              name: mixer device
+ *              index: mixer index
+ * return
+ *              mixer control
+ */
+struct mixer_ctl *quec_mixer_get_control(struct mixer *mixer, const char *name, unsigned index);
+
+/*
+ * describe : this function is use to set mulvalues
+ * paras        :
+ *              mixer: mixer handle
+ *              count: count
+ *              argv: data
+ * return       :
+ *
+ */
+int quec_mixer_ctl_mulvalues(struct mixer_ctl *ctl, int count, char ** argv);
+
+
+//end grady
+
+/**
+ * @brief Set RX DSP Gain
+ * @details
+ *      Gain support [-36,12] dB
+ *
+ * @param gain
+ *      DSP gain
+ */
+
+int Ql_Rxgain_Set(int gain);
+
+/**
+ * @brief Set Playback PCM Samprate
+ * @details
+ *      0 for NB 1 for WB
+ *
+ * @param samprate
+ *      samprate for PCM playback,default value is PCM NB
+ */
+
+
+int Ql_Playback_Samprate_Set(int samprate);
+
+/*****************************************************************
+* Function:     Ql_AudPlayer_OpenExt
+*
+* Description:
+*               expend function from Ql_AudPlayer_OpenExt
+*               Open audio play device, and specify the callback function.
+*               This function can be called twice to play different audio sources.
+*
+* Parameters:
+*               device  : a string that specifies the PCM device.
+*                         NULL, means the audio will be played on the default PCM device.
+*
+*                         If you want to mixedly play audio sources, you can call this
+*                         API twice with specifying different PCM device.
+*                         The string devices available:
+*                            "hw:0,0"  (the default play device)
+*                            "hw:0,13" (this device can mix audio and TTS)
+*                            "hw:0,14"
+*
+*		        cb_func : callback function for audio player.
+*                         The results of all operations on audio player
+*                         are informed in callback function.
+*
+*               flags   : pcm flags, eg: PCM_MMAP, PCM_NMMAP.
+*
+*               channels: pcm sample channels.
+*
+*               rate    : pcm sample rate.
+*
+*               format  : pcm sample fromat
+*
+* Return:
+*               pcm device handle
+*               NULL, fail
+*****************************************************************/
+int Ql_AudPlayer_OpenExt(
+            char *dev,
+            _cb_onPlayer cb_fun,
+            int flags,
+            int channels,
+            int rate,
+            int format);
+
+/*****************************************************************
+* Function:     Ql_AudRecorder_Open
+*
+* Description:
+*               Open audio record device, and specify the callback function.
+*
+* Parameters:
+*               device  : not used. MUST be NULL.
+*
+*		        cb_func : callback function for audio player.
+*                         The results of all operations on audio recorder
+*                         are informed in callback function.
+*
+*               flags   : pcm flags, eg: PCM_MMAP, PCM_NMMAP.
+*
+*               channels: pcm sample channels.
+*
+*               rate    : pcm sample rate.
+*
+*               format  : pcm sample fromat
+*
+* Return:
+*               pcm device handle
+*               NULL, fail
+*****************************************************************/
+int Ql_AudRecorder_OpenExt(
+            char *dev,
+            _cb_onRecorder cb_fun,
+            int flags,
+            int channels,
+            int rate,
+            int format);
+
+/*****************************************************************
+* Function:     Ql_Mp3_To_Wav
+*
+* Description:
+*               set mp3 file change to wav file.
+*
+* Parameters:
+*               wavpath  : wav path
+*
+*		        mp3path : mp3 path
+*
+* Return:
+*               0:  success
+*               -1: fail
+*****************************************************************/
+int Ql_Mp3_To_Wav(const char *wavpath, char *mp3path);
+
+
+/*****************************************************************
+* Function:     Ql_Mp3_To_Wav
+*
+* Description:
+*               flay mp3 file.
+*
+* Parameters:
+*               wavpath  : wav path
+*
+*		        hdl : Device handle
+*
+*               sample_rate : 0 for NB(8000) 1 for WB(16000)
+*
+* Return:
+*               0:  success
+*               -1: fail
+*****************************************************************/
+
+int Ql_Mp3_To_Play(char *mp3path, int hdl,int sample_rate);
+/*
+* Function:     uac enable
+*
+* Description:
+*               uac enable
+*
+* Parameters:
+*               none
+* Return:
+*               TURE or FALSE
+*/
+int ql_uac_enable(void);
+
+/*
+* Function:     uac disable
+*
+* Description:
+*               uac disable
+*
+* Parameters:
+*               none
+* Return:
+*               TURE or FALSE
+*/
+int ql_uac_disable(void);
+
+#endif //__AUD_H__
diff --git a/mbtk/include/ql/ql_cell_locator.h b/mbtk/include/ql/ql_cell_locator.h
new file mode 100755
index 0000000..4244f82
--- /dev/null
+++ b/mbtk/include/ql/ql_cell_locator.h
@@ -0,0 +1,116 @@
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @file ql_cell_locator.h
+  @brief Common API
+*/
+/*-----------------------------------------------------------------------------------------------*/
+/*-------------------------------------------------------------------------------------------------
+  Copyright (c) 2018 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+-------------------------------------------------------------------------------------------------*/
+/*-------------------------------------------------------------------------------------------------
+  EDIT HISTORY
+  This section contains comments describing changes made to the file.
+  Notice that changes are listed in reverse chronological order.
+  $Header: $
+  when       who          what, where, why
+  --------   ---          ----------------------------------------------------------
+  20190321   baron.qian  Created .
+-------------------------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+ extern "C" {
+#endif
+#ifndef __QL_CELL_LOCATOR_H__
+#define __QL_CELL_LOCATOR_H__
+
+/**/
+#define LOCATOR_MAX_ADDRESS_SIZE (256)
+#define LOCATOR_MAX_ERR_MSG_SIZE (256)
+
+
+typedef enum {
+    Q_LOC_ADDR_UTF8 = 0,
+    Q_LOC_ADDR_GBK,
+    Q_LOC_ADDR_ASCII,
+    Q_LOC_ADDR_NUM,
+}QUECLOCATOR_CHARSET;
+
+typedef struct {
+    int err_code;
+    char err_msg[LOCATOR_MAX_ERR_MSG_SIZE];
+} ql_cell_err;
+
+typedef struct {
+    /*longtitude*/
+    double lon;
+    /*latitude*/
+    double lat;
+    /*accuracy*/
+    unsigned short accuracy;
+    /*address charset, not support yet*/
+    QUECLOCATOR_CHARSET charset;
+    /*address info, not support yet*/
+    unsigned char addrinfo[LOCATOR_MAX_ADDRESS_SIZE];
+    /*address length, not support yet*/
+    unsigned short addrlen;
+    /*result*/
+    ql_cell_err err;
+} ql_cell_resp;
+
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief cell locator init function, when you want to use cell locator, call this function first!
+  @return if success return 0, else return -1
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_cell_locator_init();
+
+
+int ql_cell_locator_release();
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief set locator query server and port, server length must be less than 255 bytes.
+  @param[in] server the query server ip address
+  @param[in] port the query server port 
+  @return if success return 0, else return -1
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_cell_locator_set_server(const char *server, unsigned short port);
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief set locator query timeout, the value must between 1-300 [seconds]
+  @param[in] timeout value of query timeout
+  @return if success return 0, else return -1
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_cell_locator_set_timeout(unsigned short timeout);
+
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief set locator query token, token length must be 16 bytes. the token Used to verify that 
+         the client accessing the service is valid.
+  @param[in] token string of token which want to be setted.
+  @param[in] length of token string.
+  @return if success return 0, else return -1
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_cell_locator_set_token(const char *token, int len);
+
+/*-----------------------------------------------------------------------------------------------*/
+/**
+  @brief perform cell locator query 
+  @param[out] resp include query result or set the error_msg and error_code
+  @return if success return 0, else return -1
+  */
+/*-----------------------------------------------------------------------------------------------*/
+int ql_cell_locator_perform(ql_cell_resp *resp);
+
+
+#endif /* !__QL_CELL_LOCATOR_H__ */
+#ifdef __cplusplus
+} 
+#endif
diff --git a/mbtk/include/ql/ql_common.h b/mbtk/include/ql/ql_common.h
new file mode 100755
index 0000000..eef054d
--- /dev/null
+++ b/mbtk/include/ql/ql_common.h
@@ -0,0 +1,76 @@
+

+/**  

+  @file

+  ql_common.h

+

+  @brief

+  This file provides the definitions for common functions, and declares the 

+  common functions.

+

+*/

+/*============================================================================

+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.

+  Quectel Wireless Solution Proprietary and Confidential.

+ =============================================================================*/

+/*===========================================================================

+

+                        EDIT HISTORY FOR MODULE

+

+This section contains comments describing changes made to the module.

+Notice that changes are listed in reverse chronological order.

+

+

+WHEN        WHO            WHAT, WHERE, WHY

+----------  ------------   ----------------------------------------------------

+23/08/2019  Nebula.li      create

+=============================================================================*/

+

+#ifndef __QL_COMMON_H__

+#define __QL_COMMON_H__

+

+#include <sys/types.h>

+#include <unistd.h>

+#include <sys/syscall.h>

+

+#include <libubox/ustream.h>

+#include <libubox/blobmsg_json.h>

+#include <libubox/kvlist.h>

+#include "libubus.h"

+#include "uci_blob.h"

+#include "libubox/uloop.h"

+#include "rilutil.h"

+

+#ifdef __cplusplus

+extern "C" {

+#endif

+

+void Ql_Powerdown(int mode);

+

+int ql_start_main_thread();

+int ql_exit_main_thread();

+int ql_ril_sync_request(unsigned int requestid, const void * data, int len,void* priv,void * cb,int timeout);

+int ql_ril_async_request(unsigned int requestid, const void * data, int len,void* priv,void * cb);

+int ql_ubus_sync_request(char *obj_name, char *method,struct blob_buf *blob_buf,void* priv,void *cb,int timeout);

+int ql_ubus_async_request(char *obj_name, char *method,struct blob_buf *blob_buf,void* priv,void *cb);

+int ql_ubus_subscribe_reg(char *subscriber_name, struct ubus_subscriber *event_obj);

+int ql_ubus_subscribe_remove(char *subscriber_name, struct ubus_subscriber *event_obj);

+

+int atcmd_get_line_num(char * result, int result_len);

+char * atcmd_get_line(char * result, int result_len,int index);

+int atcmd_get_para_num(char * line);

+void atcmd_get_para_value_str(char * line,int index, char *para_value);

+void ql_set_response(struct kvlist *result_list,int reqid, int resp_type, int ret, void *data, int data_len);

+int ql_get_response(struct kvlist *result_list,int reqid, int * resp_type, void *data);

+int kvlist_get_len(struct kvlist *kv, const void *data);

+

+int utf8_to_usc2(unsigned char *utf8_data,int utf8_data_len, unsigned int *usc2_data);

+int usc2_to_utf8(unsigned int *usc2_data, int usc2_data_len, unsigned char *utf8_data);

+

+int set_config_option(const char *package, const char *section, const char *option, const char *value);

+char *get_config_option(char *package, char *section, char *option);

+

+#ifdef __cplusplus

+}

+#endif

+

+#endif
\ No newline at end of file
diff --git a/mbtk/include/ql/ql_dev.h b/mbtk/include/ql/ql_dev.h
new file mode 100755
index 0000000..04a6dd5
--- /dev/null
+++ b/mbtk/include/ql/ql_dev.h
@@ -0,0 +1,114 @@
+/**  
+  @file
+  ql_dev.h
+
+  @brief
+  This file provides the definitions for device, and declares the 
+  API functions.
+
+*/
+/*============================================================================
+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+ =============================================================================*/
+/*===========================================================================
+
+                        EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+
+WHEN        WHO            WHAT, WHERE, WHY
+----------  ------------   ----------------------------------------------------
+11/10/2019  Nebula.li      create
+=============================================================================*/
+
+#ifndef __QL_DEV_H__
+#define __QL_DEV_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum 
+{
+	QL_DEV_SUCCESS,
+	QL_DEV_GENERIC_FAILURE,
+ 	QL_DEV_RADIO_NOT_AVAILABLE,
+}QL_DEV_ERROR_CODE;
+
+typedef enum 
+{
+	QL_DEV_MODEM_MIN_FUN,
+	QL_DEV_MODEM_FULL_FUN,
+	QL_DEV_MODEM_DISABLE_RECEIVE_RF_CIRCUITS = 3,
+	QL_DEV_MODEM_DISABLE_TRANSMIT_AND_RECEIVE_RF_CIRCUITS,
+	QL_DEV_MODEM_DISABLE_SIM,
+	QL_DEV_MODEM_TURN_OFF_FULL_SECONDARY_RECEIVE,
+}QL_DEV_MODEM_FUNCTION;
+
+QL_DEV_ERROR_CODE ql_dev_init ();
+QL_DEV_ERROR_CODE ql_dev_release();
+
+/*
+    Get the IMEI string.
+     -imei      : input buffer
+*/
+QL_DEV_ERROR_CODE ql_dev_get_imei(char* imei);
+
+
+/*
+    Get the FirmwareVersion string.
+     -version   : input buffer
+*/
+QL_DEV_ERROR_CODE ql_dev_get_firmware_version(char* version);
+
+
+/*
+    Get the DeviceModel string.
+     -model     : input buffer
+*/
+QL_DEV_ERROR_CODE ql_dev_get_model(char* model);
+
+
+/*
+    Get the SN string.
+     -sn       : input buffer
+*/
+QL_DEV_ERROR_CODE ql_dev_get_sn(char* sn);
+
+/*
+    Set the modem function.
+     -function       :[in]   modem function
+     -rst    :[in]    if it is to reset modem before setting modem function. (0: not to reset; 1: reset)
+*/
+QL_DEV_ERROR_CODE ql_dev_set_modem_fun(QL_DEV_MODEM_FUNCTION function,int rst);
+
+/*
+    Get the modem function.
+     -function    :[out]  modem function
+*/
+QL_DEV_ERROR_CODE ql_dev_get_modem_fun(int *function);
+
+/*
+    Set the modem forbid urc.
+    forbid NETWORK  0x01
+    forbid SIM      0x02
+    forbid SMS      0x04
+    forbid CS CALL  0x08
+    forbid PS DATA  0x10
+     -bitmask       :[in]   modem forbid urc
+    Set bitmask to 31 before sleep and 1 after wake up 
+*/
+QL_DEV_ERROR_CODE ql_dev_forbidind(int bitmask);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/mbtk/include/ql/ql_fota.h b/mbtk/include/ql/ql_fota.h
new file mode 100755
index 0000000..fab1d48
--- /dev/null
+++ b/mbtk/include/ql/ql_fota.h
@@ -0,0 +1,95 @@
+/**  
+  @file
+  ql_fota.h
+
+  @brief
+  This file provides the definitions for device, and declares the 
+  API functions.
+
+*/
+/*============================================================================
+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+ =============================================================================*/
+/*===========================================================================
+
+                        EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+
+WHEN        WHO            WHAT, WHERE, WHY
+----------  ------------   ----------------------------------------------------
+08/11/2019  baron.qian      create
+=============================================================================*/
+#ifndef __QL_FOTA_H__
+#define __QL_FOTA_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum {
+    QUEC_FOTA_OK,           /*OK*/
+    QUEC_FOTA_FAILED        /*failed*/
+}QL_FOTA_STATUS;
+
+/*callback function define, used to get upgrade state and rate of process*/
+typedef int(*fota_callback)(int state, int percent);
+
+/*******************************************************************************
+* @brief fota initialize
+  @param 
+    
+    fota_callback: callback function
+  @return 
+        if success return 0, else return -1
+ *******************************************************************************/
+int ql_fota_init(fota_callback cb);
+
+/*******************************************************************************
+* @brief write firmware package, the firmware package is written in segments.
+         and The result of the write is output by calling the callback function.
+         the firmware package size must less than 32MB
+  @param 
+           fname: firmware package file
+    segment_size: the length of once write, recommending 3*1024*1024 bytes
+  @return 
+        if success return 0, else return -1
+ *******************************************************************************/
+int ql_fota_fw_write(char *fname, int segment_size);
+
+
+/*******************************************************************************
+* @brief download firmware by url, and write firmware package, the firmware 
+         package is written in segments. The result of the write is output by 
+         calling the callback function. the firmware package size must less than 
+         32MB
+  @param 
+                 url: [IN] the address of download firmware package file, the url   
+                           support http or https protocol.
+        segment_size: [IN] the length of once write, recommending 3*1024*1024 bytes
+        conn_timeout: [IN] timeout to connect to the server, if set 0 that means
+                           switch to the default build-in connection timeout(300s)
+    download_timeout: [IN] timeout for download the firmware file. if set 0 that means
+                           it never time out
+  @return 
+        if success return 0, else return -1
+ *******************************************************************************/
+int ql_fota_fw_write_by_url(char *url, int segment_size, int conn_timeout, int download_timeout);
+
+
+/*******************************************************************************
+* @brief reboot system and clear env
+  @param 
+   is_reboot: if set 1, after fota success, reboot system
+  @return 
+        if success return 0, else return -1
+ *******************************************************************************/
+int ql_fota_done(int is_reboot);
+
+#ifdef __cplusplus
+}
+#endif
+#endif //__QL_FOTA_H__
diff --git a/mbtk/include/ql/ql_gpio.h b/mbtk/include/ql/ql_gpio.h
new file mode 100755
index 0000000..74402e9
--- /dev/null
+++ b/mbtk/include/ql/ql_gpio.h
@@ -0,0 +1,376 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of Quectel Co., Ltd. 2019
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ *   ql_gpio.h 
+ *
+ * Project:
+ * --------
+ *   OpenLinux
+ *
+ * Description:
+ * ------------
+ *   GPIO API defines.
+ *
+ *
+ *============================================================================
+ *             HISTORY
+ *----------------------------------------------------------------------------
+ * WHO            WHEN                WHAT
+ *----------------------------------------------------------------------------
+ * Carola.Zhang   16/07/2019		  Create.
+ ****************************************************************************/
+
+#ifndef __QL_GPIO_H__
+#define __QL_GPIO_H__
+
+typedef enum{
+    /*Invalid*/  PINNAME_BEGIN = -1,
+	/*PIN-1*/    PINNAME_GPIO1 = 1,
+	/*PIN-2*/    PINNAME_GPIO2 = 2,
+	/*PIN-3*/    PINNAME_GPIO3 = 3,
+	/*PIN-4*/    PINNAME_GPIO4 = 4,
+	/*PIN-5*/    PINNAME_GPIO5 = 5,
+    /*PIN-6*/    PINNAME_NET_STATUS = 6,
+    /*PIN-11*/   PINNAME_DBG_RXD = 11,
+    /*PIN-12*/   PINNAME_DBG_TXD = 12,
+    /*PIN-13*/   PINNAME_USIM_PRESENCE = 13,
+    /*PIN-23*/   PINNAME_SD_INT_DET = 23,
+    /*PIN-24*/   PINNAME_PCM_IN = 24,
+    /*PIN-25*/   PINNAME_PCM_OUT = 25,
+    /*PIN-26*/   PINNAME_PCM_SYNC = 26,
+    /*PIN-27*/   PINNAME_PCM_CLK = 27,
+    /*PIN-28*/   PINNAME_SDC2_DATA3 = 28,
+    /*PIN-29*/   PINNAME_SDC2_DATA2 = 29,
+    /*PIN-30*/   PINNAME_SDC2_DATA1 = 30,
+    /*PIN-31*/   PINNAME_SDC2_DATA0 = 31,
+    /*PIN-32*/   PINNAME_SDC2_CLK = 32,
+    /*PIN-33*/   PINNAME_SDC2_CMD = 33,
+    /*PIN-37*/   PINNAME_SPI_CS_N = 37,
+    /*PIN-38*/   PINNAME_SPI_MOSI = 38,
+    /*PIN-39*/   PINNAME_SPI_MISO = 39,
+    /*PIN-40*/   PINNAME_SPI_CLK = 40,
+    /*PIN-41*/   PINNAME_I2C_SCL = 41,
+    /*PIN-42*/   PINNAME_I2C_SDA = 42,
+    /*PIN-62*/   PINNAME_GPIO6 = 62,
+    /*PIN-63*/   PINNAME_DCD = 63,
+    /*PIN-66*/   PINNAME_DTR = 66,
+    /*PIN-64*/   PINNAME_MAIN_CTS = 64,
+    /*PIN-65*/   PINNAME_MAIN_RTS = 65,
+    /*PIN-67*/   PINNAME_MAIN_TXD = 67,
+    /*PIN-68*/   PINNAME_MAIN_RXD = 68,
+    /*PIN-73*/   PINNAME_RMII_RXD1 = 73,
+    /*PIN-74*/   PINNAME_RMII_RXCL = 74,
+    /*PIN-75*/   PINNAME_RMII_CLK = 75,
+    /*PIN-76*/   PINNAME_RMII_RXD0 = 76,
+    /*PIN-77*/   PINNAME_RMII_TXD0 = 77,
+    /*PIN-78*/   PINNAME_RMII_TXD1 = 78,
+    /*PIN-79*/   PINNAME_RMII_RXD2 = 79,
+    /*PIN-80*/   PINNAME_RMII_TXD2 = 80,
+    /*PIN-81*/   PINNAME_RMII_TX_CTRL = 81,
+    /*PIN-82*/   PINNAME_RMII_RXD3 = 82,
+    /*PIN-83*/   PINNAME_RMII_TXCL = 83,
+    /*PIN-84*/   PINNAME_RMII_TXD3 = 84,
+    /*PIN-118*/  PINNAME_WLAN_SLP_CLK = 118,
+    /*PIN-119*/  PINNAME_RMII_RST = 119,
+    /*PIN-120*/  PINNAME_RMII_INT = 120,
+    /*PIN-121*/  PINNAME_RMII_MDIO = 121,
+    /*PIN-122*/  PINNAME_RMII_MDC = 122,
+    /*PIN-127*/  PINNAME_WLAN_PER_EN = 127,
+    /*PIN-135*/  PINNAME_WLAN_WAKE = 135,
+    /*PIN-136*/  PINNAME_WLAN_EN = 136,
+    /*PIN-139*/  PINNAME_GPIO8 = 139,
+    PINNAME_END
+}Enum_PinName;
+
+/****************************************************************************
+ * Error Code Definition
+ ***************************************************************************/
+enum {
+        RES_OK = 0,
+        RES_BAD_PARAMETER  = -1,     ///< Parameter is invalid.
+        RES_IO_NOT_SUPPORT = -2,
+        RES_IO_ERROR = -3,
+        RES_NOT_IMPLEMENTED = -4
+};
+
+typedef enum{
+    PINDIRECTION_IN  = 0,
+    PINDIRECTION_OUT = 1
+}Enum_PinDirection;
+
+typedef enum{
+    PINLEVEL_LOW  = 0,
+    PINLEVEL_HIGH = 1
+}Enum_PinLevel;
+
+typedef enum{
+    PINPULLSEL_DISABLE  = (0<<13),    // Disable pull selection
+    PINPULLSEL_PULLDOWN = (5<<13),    // Pull-down 
+    PINPULLSEL_PULLUP   = (6<<13)     // Pull-up 
+}Enum_PinPullSel;
+
+/****************************************************************************
+ * GPIO Config Items
+ ***************************************************************************/
+typedef struct{
+    Enum_PinName           pin_name;
+    Enum_PinDirection      pinDirection;  
+    Enum_PinLevel          pinLevel;
+    Enum_PinPullSel       pinPullSel;
+}ST_GPIOConfig;
+
+//------------------------------------------------------------------------------
+/**
+ * The type of GPIO Edge Sensivity.
+ */
+//------------------------------------------------------------------------------
+typedef enum {
+    EINT_SENSE_NONE,       // pin is input, but no an interrupt pin.
+    EINT_SENSE_RISING,
+    EINT_SENSE_FALLING,
+    EINT_SENSE_BOTH
+}Enum_EintType;
+
+/*****************************************************************
+* Function:     Ql_GPIO_Init 
+* 
+* Description:
+*               This function enables the GPIO function of the specified pin,
+*               and initialize the configurations, including direction,
+*               level and pull selection.
+*
+* Parameters:
+*               pin_name:
+*                   Pin name, one value of Enum_PinName.
+*               dir:
+*                   The initial direction of GPIO, one value of Enum_PinDirection.
+*               level:
+*                   The initial level of GPIO, one value of Enum_PinLevel. 
+*               pull_sel:
+*                   Pull selection, one value of Enum_PinPullSel.
+* Return:        
+*               RES_OK, this function succeeds.
+*               RES_IO_NOT_SUPPORT, the input GPIO is invalid. 
+*               RES_IO_ERR, the function failed
+*               other place. For example this GPIO has been using as EINT.
+*****************************************************************/
+int Ql_GPIO_Init(Enum_PinName       pin_name, 
+                 Enum_PinDirection  dir, 
+                 Enum_PinLevel      level, 
+                 Enum_PinPullSel    pull_sel
+                 );
+
+/*****************************************************************
+* Function:     Ql_GPIO_Base_Init 
+* 
+* Description:
+*               This function enables the GPIO function of the specified pin.
+*
+* Parameters:
+*               pin_name:
+*                   Pin name, one value of Enum_PinName.
+*            
+* Return:        
+*               RES_OK, this function succeeds.
+*               RES_IO_NOT_SUPPORT, the input GPIO is invalid. 
+*               RES_IO_ERR, the function failed
+*****************************************************************/
+int Ql_GPIO_Base_Init(Enum_PinName pin_name );
+
+/*****************************************************************
+* Function:     Ql_GPIO_SetLevel 
+* 
+* Description:
+*               This function sets the level of the specified GPIO.
+*
+* Parameters:
+*               pin_name:
+*                   Pin name, one value of Enum_PinName.
+*               level:
+*                   The initial level of GPIO, one value of Enum_PinLevel. 
+* Return:        
+*               RES_OK, this function succeeds.
+*               RES_IO_NOT_SUPPORT, the input GPIO is invalid. 
+*               RES_IO_ERR, the function failed
+*               other place. For example this GPIO has been using as EINT.
+*****************************************************************/
+int Ql_GPIO_SetLevel(Enum_PinName pin_name, Enum_PinLevel level);
+
+/*****************************************************************
+* Function:     Ql_GPIO_GetLevel 
+* 
+* Description:
+*               This function gets the level of the specified GPIO.
+*
+* Parameters:
+*               pin_name:
+*                   Pin name, one value of Enum_PinName.
+* Return:        
+*               The level value of the specified GPIO, which is 
+*               nonnegative integer.
+*               RES_IO_NOT_SUPPORT, the input GPIO is invalid.
+*****************************************************************/
+int Ql_GPIO_GetLevel(Enum_PinName pin_name);
+
+/*****************************************************************
+* Function:     Ql_GPIO_SetDirection 
+* 
+* Description:
+*               This function sets the direction of the specified GPIO.
+*
+* Parameters:
+*               pin_name:
+*                   Pin name, one value of Enum_PinName.
+*               dir:
+*                   The initial direction of GPIO, one value of Enum_PinDirection.
+* Return:        
+*               RES_OK, this function succeeds.
+*               RES_IO_NOT_SUPPORT, the input GPIO is invalid. 
+*               RES_IO_ERR, the function failed
+*               other place. For example this GPIO has been using as EINT.
+*****************************************************************/
+int Ql_GPIO_SetDirection(Enum_PinName pin_name, Enum_PinDirection dir);
+
+/*****************************************************************
+* Function:     Ql_GPIO_GetDirection 
+* 
+* Description:
+*               This function gets the direction of the specified GPIO.
+*
+* Parameters:
+*               pin_name:
+*                   Pin name, one value of Enum_PinName.
+* Return:        
+*               0  INPUT
+*               1  OUTPUT
+*               RES_IO_NOT_SUPPORT, the input GPIO is invalid. 
+*               other place. For example this GPIO has been using as EINT.
+*****************************************************************/
+int Ql_GPIO_GetDirection(Enum_PinName pin_name);
+
+/*****************************************************************
+* Function:     Ql_GPIO_SetPullSelection 
+* 
+* Description:
+*               This function sets the pull selection of the specified GPIO.
+*
+* Parameters:
+*               pin_name:
+*                   Pin name, one value of Enum_PinName.
+*               Enum_PinPullSel:
+*                   Pull selection, one value of Enum_PinPullSel.
+* Return:        
+*               RES_OK, this function succeeds.
+*               RES_IO_NOT_SUPPORT, the input GPIO is invalid. 
+*               RES_IO_ERR, the function failed
+*               other place. For example this GPIO has been using as EINT.
+*****************************************************************/
+int Ql_GPIO_SetPullSelection(Enum_PinName pin_name, Enum_PinPullSel pull_sel);
+
+/*****************************************************************
+* Function:     ql_gpio_get_pull_selection 
+* 
+* Description:
+*               This function gets the pull selection of the specified GPIO.
+*
+* Parameters:
+*               pin_name:
+*                   Pin name, one value of Enum_PinName.
+* Return:        
+*               0<<13   no pull
+*               5<<13   pull down
+*               6<<13   pull up
+*****************************************************************/
+int Ql_GPIO_GetPullSelection(Enum_PinName pin_name);
+
+/*****************************************************************
+* Function:     Ql_GPIO_Uninit 
+* 
+* Description:
+*               This function releases the specified GPIO that was 
+*               initialized by calling Ql_GPIO_Init() previously.
+*               After releasing, the GPIO can be used for other purpose.
+* Parameters:
+*               pin_name:
+*                   Pin name, one value of Enum_PinName.
+* Return:        
+*               RES_OK, this function succeeds.
+*               RES_IO_NOT_SUPPORT, the input GPIO is invalid. 
+*               RES_IO_ERR, the function failed
+*               other place. For example this GPIO has been using as EINT.
+*****************************************************************/
+int Ql_GPIO_Uninit(Enum_PinName pin_name);
+
+//------------------------------------------------------------------------------
+/*
+* Description:
+*     Definition for EINT callback function.
+* 
+* Parameters:
+*     PinName:
+*         EINT pin name, one value of Enum_PinName.
+*
+*     level:
+*         The EINT level value, one value of Enum_PinLevel. 
+*         0 or 1
+*/
+//------------------------------------------------------------------------------
+typedef void (*Ql_EINT_Callback)(Enum_PinName eint_pin_name, int level);
+
+//------------------------------------------------------------------------------
+/*
+* Function:     Ql_EINT_Enable 
+* 
+* Description:
+*               Set the interrupt sense mode, and enable interrupt. 
+*
+* Parameters:
+*               eint_pin_name:
+*                   EINT pin name, one value of Enum_PinName that has 
+*                   the interrupt function.
+*
+*               eint_type:
+*                   Interrupt type, level-triggered or edge-triggered.
+*                   Now, only edge-triggered interrupt is supported.
+*
+*               eint_callback:
+*                   call back function
+*
+* Return:        
+*               RES_OK, this function succeeds.
+*               else failed to execute the function. 
+*/
+//------------------------------------------------------------------------------
+int Ql_EINT_Enable(Enum_PinName eint_pin_name, Enum_EintType eint_type, Ql_EINT_Callback eint_callback);
+
+
+//------------------------------------------------------------------------------
+/*
+* Function:     Ql_EINT_Disable 
+* 
+* Description:
+*               Disable the interrupt sense. 
+*
+* Parameters:
+*               eint_pin_name:
+*                   EINT pin name, one value of Enum_PinName that has 
+*                   the interrupt function.
+*
+* Return:        
+*               RES_OK, this function succeeds.
+*               else failed to execute the function. 
+*/
+//------------------------------------------------------------------------------
+int Ql_EINT_Disable(Enum_PinName eint_pin_name);
+
+#endif  // __QL_GPIO_H__
diff --git a/mbtk/include/ql/ql_i2c.h b/mbtk/include/ql/ql_i2c.h
new file mode 100755
index 0000000..52eb4c8
--- /dev/null
+++ b/mbtk/include/ql/ql_i2c.h
@@ -0,0 +1,41 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of Quectel Co., Ltd. 2019
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ *   ql_i2c.h 
+ *
+ * Project:
+ * --------
+ *   OpenLinux
+ *
+ * Description:
+ * ------------
+ *   i2c API defines.
+ *
+ *
+ *============================================================================
+ *             HISTORY
+ *----------------------------------------------------------------------------
+ * WHO            WHEN                WHAT
+ *----------------------------------------------------------------------------
+ * Carola.Zhang   16/07/2019		  Create.
+ ****************************************************************************/
+#ifndef __QL_UART_H__
+#define __QL_UART_H__
+
+
+int Ql_I2C_Init(char *dev_name);
+int Ql_I2C_Read(int fd, unsigned short slaveAddr, unsigned char ofstAddr,  unsigned char* ptrBuff, unsigned short length);
+int Ql_I2C_Write(int fd, unsigned short slaveAddr, unsigned char ofstAddr,  unsigned char* ptrData, unsigned short length);
+int Ql_I2C_Deinit(int fd);
+
+#endif /* __QL_i2c_H__ */
\ No newline at end of file
diff --git a/mbtk/include/ql/ql_log.h b/mbtk/include/ql/ql_log.h
new file mode 100755
index 0000000..83940d1
--- /dev/null
+++ b/mbtk/include/ql/ql_log.h
@@ -0,0 +1,86 @@
+/**  
+  @file
+  DSI_ConnectManager.h
+
+  @brief
+  This file provides the definitions for quectel log api, and declares the 
+  API functions.
+
+*/
+/*============================================================================
+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+ =============================================================================*/
+/*===========================================================================
+
+                        EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+
+WHEN        WHO            WHAT, WHERE, WHY
+----------  ------------   ----------------------------------------------------
+24/07/2019  Nebula.li      create
+=============================================================================*/
+
+#ifndef _QL_LOG_H_
+#define _QL_LOG_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+	QL_LOG_MIN = -1,
+	QL_LOG_EMERG_LEVEL=0,     /* system is unusable */
+	QL_LOG_INIT_LEVEL=0,      /* log init level */
+	QL_LOG_ALERT_LEVEL=1,     /* action must be taken immediately */
+	QL_LOG_CRIT_LEVEL=2,      /* critical conditions */
+	QL_LOG_ERR_LEVEL=3,      /* error conditions */
+	QL_LOG_WARN_LEVEL=4,   /* warning conditions */
+	QL_LOG_NOTICE_LEVEL=5,    /* normal but significant condition */
+	QL_LOG_INFO_LEVEL=6,      /* informational */
+	QL_LOG_DEBUG_LEVEL=7,     /* debug-level messages */
+	QL_LOG_MAX
+} QL_LOG_PRIORITY_E;
+
+#define QL_LOG_PRORIFY_VERIFY(prio) ((prio)>QL_LOG_MIN && (prio)<QL_LOG_MAX)
+
+typedef enum {
+    QL_LOG_ID_MIN = -1,
+   	QL_LOG_ID_MAIN = 0,
+    QL_LOG_ID_RADIO = 1,
+    QL_LOG_ID_EVENTS = 2,
+    QL_LOG_ID_SYSTEM = 3,
+    QL_LOG_ID_KMSG = 4,
+	QL_LOG_ID_STDOUT=5,
+    QL_LOG_ID_MAX
+} QL_LOG_ID_E;
+
+#define QL_LOG_ID_VERIFY(log_id)    ((log_id)>QL_LOG_ID_MIN && (log_id)<QL_LOG_ID_MAX)
+
+#define LOG_BUF_SIZE 2048
+
+#define QL_LOG_OPEN() ql_log_open()
+#define QL_LOG_CLOSE() ql_log_close()
+#define QL_LOG_SETPOS(log_id) ql_log_setpos(log_id)
+
+#define QL_LOG_DEBUG(fmt, ...) ql_log_print(QL_LOG_DEBUG_LEVEL,__FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
+#define QL_LOG_INFO(fmt, ...) ql_log_print(QL_LOG_INFO_LEVEL,__FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
+#define QL_LOG_WARN(fmt, ...) ql_log_print(QL_LOG_WARN_LEVEL,__FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
+#define QL_LOG_ERROR(fmt, ...) ql_log_print(QL_LOG_ERR_LEVEL,__FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
+
+
+extern void ql_log_open();
+extern void ql_log_close();
+extern int ql_log_print(QL_LOG_PRIORITY_E prio,const char *func, int line,  const char *fmt, ...);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
\ No newline at end of file
diff --git a/mbtk/include/ql/ql_mcm.h b/mbtk/include/ql/ql_mcm.h
new file mode 100755
index 0000000..a5ae770
--- /dev/null
+++ b/mbtk/include/ql/ql_mcm.h
@@ -0,0 +1,165 @@
+#ifndef __QL_MCM_H__
+#define __QL_MCM_H__
+
+
+#define MCM_SERVICE_MAX             (17)
+
+#define MCM_SERVICE_DATA            0x01
+#define MCM_SERVICE_DM              0x02
+#define MCM_SERVICE_LOC             0x03
+#define MCM_SERVICE_MOBILEAP        0x04
+#define MCM_SERVICE_NW              0x05
+#define MCM_SERVICE_ATC             0x06
+#define MCM_SERVICE_SMS             0x07
+#define MCM_SERVICE_CLIENT          0x08
+#define MCM_SERVICE_SIM             0x0B
+#define MCM_SERVICE_VCALL           0x10
+
+
+#define SERVICE_REQUIRED            1
+#define SERVICE_NOT_REQUIRED        0
+
+#define MAGIC_MSG_ID_SERVICE_UP     0x87654321
+#define MAGIC_MSG_ID_SERVICE_DOWN   0x87654320
+
+typedef enum
+{
+    E_QL_SUCCESS                        = 0,    /**<  Success. */
+    E_QL_SUCCESS_CONDITIONAL_SUCCESS    = 1,    /**<  Conditional success. */
+    E_QL_ERROR_MCM_SERVICES_NOT_AVAILABLE = 2,  /**<  MCM services not available. */
+    E_QL_ERROR_GENERIC                  = 3,    /**<  Generic error. */
+    E_QL_ERROR_BADPARM                  = 4,    /**<  Bad parameter. */
+    E_QL_ERROR_MEMORY                   = 5,    /**<  Memory error. */
+    E_QL_ERROR_INVALID_STATE            = 6,    /**<  Invalid state. */
+    E_QL_ERROR_MALFORMED_MSG            = 7,    /**<  Malformed message. */
+    E_QL_ERROR_NO_MEMORY                = 8,    /**<  No memory. */
+    E_QL_ERROR_INTERNAL                 = 9,    /**<  Internal error. */
+    E_QL_ERROR_ABORTED                  = 10,   /**<  Action was aborted. */
+    E_QL_ERROR_CLIENT_IDS_EXHAUSTED     = 11,   /**<  Client IDs have been exhausted. */
+    E_QL_ERROR_UNABORTABLE_TRANSACTION  = 12,   /**<  Unabortable transaction. */
+    E_QL_ERROR_INVALID_CLIENT_ID        = 13,   /**<  Invalid client ID. */
+    E_QL_ERROR_NO_THRESHOLDS            = 14,   /**<  No thresholds. */
+    E_QL_ERROR_INVALID_HANDLE           = 15,   /**<  Invalid handle. */
+    E_QL_ERROR_INVALID_PROFILE          = 16,   /**<  Invalid profile. */
+    E_QL_ERROR_INVALID_PINID            = 17,   /**<  Invalid PIN ID. */
+    E_QL_ERROR_INCORRECT_PIN            = 18,   /**<  Incorrect PIN. */
+    E_QL_ERROR_NO_NETWORK_FOUND         = 19,   /**<  No network found. */
+    E_QL_ERROR_CALL_FAILED              = 20,   /**<  Call failed. */
+    E_QL_ERROR_OUT_OF_CALL              = 21,   /**<  Out of call. */
+    E_QL_ERROR_NOT_PROVISIONED          = 22,   /**<  Not provisioned. */
+    E_QL_ERROR_MISSING_ARG              = 23,   /**<  Missing argument. */
+    E_QL_ERROR_ARG_TOO_LONG             = 24,   /**<  Argument is too long. */
+    E_QL_ERROR_INVALID_TX_ID            = 25,   /**<  Invalid Tx ID. */
+    E_QL_ERROR_DEVICE_IN_USE            = 26,   /**<  Device is in use. */
+    E_QL_ERROR_OP_NETWORK_UNSUPPORTED   = 27,   /**<  OP network is not supported. */
+    E_QL_ERROR_OP_DEVICE_UNSUPPORTED    = 28,   /**<  OP device is not supported. */
+    E_QL_ERROR_NO_EFFECT                = 29,   /**<  No effect. */
+    E_QL_ERROR_NO_FREE_PROFILE          = 30,   /**<  No free profile. */
+    E_QL_ERROR_INVALID_PDP_TYPE         = 31,   /**<  Invalid PDP type. */
+    E_QL_ERROR_INVALID_TECH_PREF        = 32,   /**<  Invalid technical preference. */
+    E_QL_ERROR_INVALID_PROFILE_TYPE     = 33,   /**<  Invalid profile type. */
+    E_QL_ERROR_INVALID_SERVICE_TYPE     = 34,   /**<  Invalid service type. */
+    E_QL_ERROR_INVALID_REGISTER_ACTION  = 35,   /**<  Invalid register action. */
+    E_QL_ERROR_INVALID_PS_ATTACH_ACTION = 36,   /**<  Invalid PS attach action. */
+    E_QL_ERROR_AUTHENTICATION_FAILED    = 37,   /**<  Authentication failed. */
+    E_QL_ERROR_PIN_BLOCKED              = 38,   /**<  PIN is blocked. */
+    E_QL_ERROR_PIN_PERM_BLOCKED         = 39,   /**<  PIN is permanently blocked. */
+    E_QL_ERROR_SIM_NOT_INITIALIZED      = 40,   /**<  SIM is not initialized. */
+    E_QL_ERROR_MAX_QOS_REQUESTS_IN_USE  = 41,   /**<  Maximum QoS requests are in use. */
+    E_QL_ERROR_INCORRECT_FLOW_FILTER    = 42,   /**<  Incorrect flow filter. */
+    E_QL_ERROR_NETWORK_QOS_UNAWARE      = 43,   /**<  Network QoS is unaware. */
+    E_QL_ERROR_INVALID_ID               = 44,   /**<  Invalid ID. */
+    E_QL_ERROR_INVALID_QOS_ID           = 45,   /**<  Invalid QoS ID. */
+    E_QL_ERROR_REQUESTED_NUM_UNSUPPORTED= 46,   /**<  Requested number is not supported. */
+    E_QL_ERROR_INTERFACE_NOT_FOUND      = 47,   /**<  Interface was not found. */
+    E_QL_ERROR_FLOW_SUSPENDED           = 48,   /**<  Flow is suspended. */
+    E_QL_ERROR_INVALID_DATA_FORMAT      = 49,   /**<  Invalid data format. */
+    E_QL_ERROR_GENERAL                  = 50,   /**<  General error. */
+    E_QL_ERROR_UNKNOWN                  = 51,   /**<  Unknown error. */
+    E_QL_ERROR_INVALID_ARG              = 52,   /**<  Invalid argument. */
+    E_QL_ERROR_INVALID_INDEX            = 53,   /**<  Invalid index. */
+    E_QL_ERROR_NO_ENTRY                 = 54,   /**<  No entry. */
+    E_QL_ERROR_DEVICE_STORAGE_FULL      = 55,   /**<  Device storage is full. */
+    E_QL_ERROR_DEVICE_NOT_READY         = 56,   /**<  Device is not ready. */
+    E_QL_ERROR_NETWORK_NOT_READY        = 57,   /**<  Network is not ready. */
+    E_QL_ERROR_CAUSE_CODE               = 58,   /**<  Cause code error. */
+    E_QL_ERROR_MESSAGE_NOT_SENT         = 59,   /**<  Message was not sent. */
+    E_QL_ERROR_MESSAGE_DELIVERY_FAILURE = 60,   /**<  Message delivery failure. */
+    E_QL_ERROR_INVALID_MESSAGE_ID       = 61,   /**<  Invalid message ID. */
+    E_QL_ERROR_ENCODING                 = 62,   /**<  Encoding error. */
+    E_QL_ERROR_AUTHENTICATION_LOCK      = 63,   /**<  Authentication lock error. */
+    E_QL_ERROR_INVALID_TRANSITION       = 64,   /**<  Invalid transition. */
+    E_QL_ERROR_NOT_A_MCAST_IFACE        = 65,   /**<  Not an MCast interface. */
+    E_QL_ERROR_MAX_MCAST_REQUESTS_IN_USE= 66,   /**<  Maximum MCast requests are in use. */
+    E_QL_ERROR_INVALID_MCAST_HANDLE     = 67,   /**<  Invalid MCast handle. */
+    E_QL_ERROR_INVALID_IP_FAMILY_PREF   = 68,   /**<  Invalid IP family preference. */
+    E_QL_ERROR_SESSION_INACTIVE         = 69,   /**<  Session is inactive. */
+    E_QL_ERROR_SESSION_INVALID          = 70,   /**<  Session is invalid. */
+    E_QL_ERROR_SESSION_OWNERSHIP        = 71,   /**<  Session ownership error. */
+    E_QL_ERROR_INSUFFICIENT_RESOURCES   = 72,   /**<  Insufficient resources. */
+    E_QL_ERROR_DISABLED                 = 73,   /**<  Disabled. */
+    E_QL_ERROR_INVALID_OPERATION        = 74,   /**<  Invalid operation. */
+    E_QL_ERROR_INVALID_CMD              = 75,   /**<  Invalid command. */
+    E_QL_ERROR_TPDU_TYPE                = 76,   /**<  Transfer Protocol data unit type error. */
+    E_QL_ERROR_SMSC_ADDR                = 77,   /**<  Short message service center address error. */
+    E_QL_ERROR_INFO_UNAVAILABLE         = 78,   /**<  Information is not available. */
+    E_QL_ERROR_SEGMENT_TOO_LONG         = 79,   /**<  Segment is too long. */
+    E_QL_ERROR_SEGMENT_ORDER            = 80,   /**<  Segment order error. */
+    E_QL_ERROR_BUNDLING_NOT_SUPPORTED   = 81,   /**<  Bundling is not supported. */
+    E_QL_ERROR_OP_PARTIAL_FAILURE       = 82,   /**<  OP partial failure. */
+    E_QL_ERROR_POLICY_MISMATCH          = 83,   /**<  Policy mismatch. */
+    E_QL_ERROR_SIM_FILE_NOT_FOUND       = 84,   /**<  SIM file was not found. */
+    E_QL_ERROR_EXTENDED_INTERNAL        = 85,   /**<  Extended internal error. */
+    E_QL_ERROR_ACCESS_DENIED            = 86,   /**<  Access is denied. */
+    E_QL_ERROR_HARDWARE_RESTRICTED      = 87,   /**<  Hardware is restricted. */
+    E_QL_ERROR_ACK_NOT_SENT             = 88,   /**<  Acknowledgement was not sent. */
+    E_QL_ERROR_INJECT_TIMEOUT           = 89,   /**<  Inject timeout error. */
+    E_QL_ERROR_INCOMPATIBLE_STATE       = 90,   /**<  Incompatible state. */
+    E_QL_ERROR_FDN_RESTRICT             = 91,   /**<  Fixed dialing number restrict error. */
+    E_QL_ERROR_SUPS_FAILURE_CAUSE       = 92,   /**<  SUPS failure cause. */
+    E_QL_ERROR_NO_RADIO                 = 93,   /**<  No radio. */
+    E_QL_ERROR_NOT_SUPPORTED            = 94,   /**<  Not supported. */
+    E_QL_ERROR_NO_SUBSCRIPTION          = 95,   /**<  No subscription. */
+    E_QL_ERROR_CARD_CALL_CONTROL_FAILED = 96,   /**<  Card call control failed. */
+    E_QL_ERROR_NETWORK_ABORTED          = 97,   /**<  Network was aborted. */
+    E_QL_ERROR_MSG_BLOCKED              = 98,   /**<  Message was blocked. */
+    E_QL_ERROR_INVALID_SESSION_TYPE     = 99,   /**<  Invalid session type. */
+    E_QL_ERROR_INVALID_PB_TYPE          = 100,  /**<  Invalid phonebook type. */
+    E_QL_ERROR_NO_SIM                   = 101,  /**<  No SIM was found. */
+    E_QL_ERROR_PB_NOT_READY             = 102,  /**<  Phonebook not ready. */
+    E_QL_ERROR_PIN_RESTRICTION          = 103,  /**<  PIN restriction. */
+    E_QL_ERROR_PIN2_RESTRICTION         = 104,  /**<  PIN2 restriction. */
+    E_QL_ERROR_PUK_RESTRICTION          = 105,  /**<  PIN unlocking key restriction. */
+    E_QL_ERROR_PUK2_RESTRICTION         = 106,  /**<  PIN unlocking key2 restriction. */
+    E_QL_ERROR_PB_ACCESS_RESTRICTED     = 107,  /**<  Phonebook access is restricted. */
+    E_QL_ERROR_PB_DELETE_IN_PROG        = 108,  /**<  Phonebook delete is in progress. */
+    E_QL_ERROR_PB_TEXT_TOO_LONG         = 109,  /**<  Phonebook text is too long. */
+    E_QL_ERROR_PB_NUMBER_TOO_LONG       = 110,  /**<  Phonebook number is too long. */
+    E_QL_ERROR_PB_HIDDEN_KEY_RESTRICTION= 111,  /**<  Phonebook hidden key restriction. */
+    E_QL_ERROR_PB_NOT_AVAILABLE         = 112,  /**<  Phonebook is not available. */
+    E_QL_ERROR_DEVICE_MEMORY_ERROR      = 113,  /**<  Device memory error. */
+    E_QL_ERROR_SIM_PIN_BLOCKED          = 114,  /**<  SIM PIN is blocked. */
+    E_QL_ERROR_SIM_PIN_NOT_INITIALIZED  = 115,  /**<  SIM PIN is not initialized. */
+    E_QL_ERROR_SIM_INVALID_PIN          = 116,  /**<  SIM PIN is invalid. */
+    E_QL_ERROR_SIM_INVALID_PERSO_CK     = 117,  /**<  SIM invalid personalization CK. */
+    E_QL_ERROR_SIM_PERSO_BLOCKED        = 118,  /**<  SIM personalization blocked. */
+    E_QL_ERROR_SIM_PERSO_INVALID_DATA   = 119,  /**<  SIM personalization contains invalid data. */
+    E_QL_ERROR_SIM_ACCESS_DENIED        = 120,  /**<  SIM access is denied. */
+    E_QL_ERROR_SIM_INVALID_FILE_PATH    = 121,  /**<  SIM file path is invalid. */
+    E_QL_ERROR_SIM_SERVICE_NOT_SUPPORTED= 122,  /**<  SIM service is not supported. */
+    E_QL_ERROR_SIM_AUTH_FAIL            = 123,  /**<  SIM authorization failure. */
+    E_QL_ERROR_SIM_PIN_PERM_BLOCKED     = 124,  /**<  SIM PIN is permanently blocked. */
+}E_QL_ERROR_CODE_T;
+
+#if 0
+int QL_MCM_Client_Init( mcm_client_handle_type  *ph_mcm,
+                        int                     client_type,
+                        mcm_client_ind_cb       client_ind_cb,
+                        mcm_client_async_cb     client_async_cb);
+
+int QL_MCM_Client_Deinit(mcm_client_handle_type h_mcm,
+                         int                    client_type);
+#endif
+
+#endif // __QL_MCM_H__
+
diff --git a/mbtk/include/ql/ql_mcm_call.h b/mbtk/include/ql/ql_mcm_call.h
new file mode 100755
index 0000000..973fb47
--- /dev/null
+++ b/mbtk/include/ql/ql_mcm_call.h
@@ -0,0 +1,909 @@
+/**
+ *@file     ql_mcm_voice.h
+ *@date     2017-11-30
+ *@author
+ *@brief
+ */
+
+#ifndef __QL_MCM_VOICE_H__
+#define __QL_MCM_VOICE_H__
+
+#include "mbtk_type.h"
+#include "mbtk_log.h"
+#include "ql_vcall.h"
+
+#define QL_MCM_MAX_VOICE_CALLS                  8   /**  GSM provides up to 8 calls; 3GPP2 provides 2. */
+#define QL_MCM_MAX_PHONE_NUMBER                 82  /**  Maximum phone number length. */
+#define QL_MCM_MAX_UUS_DATA                     20  /**  Maximum user-to-user data. */
+#define QL_MCM_MAX_DTMF_LENGTH                  20  /**  Maximum DTMF length. */
+#define QL_MCM_MAX_USSD_LENGTH                  128 /**  Maximum USSD length. */
+#define QL_MCM_MAX_PASSWORD_LENGTH              4   /**  Maximum password length. */
+#define QL_MCM_MAX_CALL_FORWARDING_INFO         13  /**  Maximum call forwarding information. */
+#define QL_MCM_MAX_ECALL_MSD                    140 /**  Maximum size of the MSD sent to the network with an eCall */
+#define QL_MCM_MAX_ECALL_URC_EVENT_LENGTH       128 /**  Maximum size of the ecall urc event */
+
+
+typedef enum
+{
+    E_QL_MCM_VOICE_CALL_STATE_INCOMING      = 0x0000, /**< MT incoming; CC setup. */
+    E_QL_MCM_VOICE_CALL_STATE_DIALING       = 0x0001, /**< Dialing state. */
+    E_QL_MCM_VOICE_CALL_STATE_ALERTING      = 0x0002, /**< MT call waiting; MO alterting. */
+    E_QL_MCM_VOICE_CALL_STATE_ACTIVE        = 0x0003, /**< Call is active. */
+    E_QL_MCM_VOICE_CALL_STATE_HOLDING       = 0x0004, /**< Call is on hold. */
+    E_QL_MCM_VOICE_CALL_STATE_END           = 0x0005, /**< Call is disconnected. */
+    E_QL_MCM_VOICE_CALL_STATE_WAITING       = 0x0006, /**< Call is waiting. */
+} ql_mcm_voice_call_state_t;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_TECH_NONE                = 0, /**<  None. */
+    E_QL_MCM_VOICE_TECH_3GPP                = 1, /**<  3GPP. */
+    E_QL_MCM_VOICE_TECH_3GPP2               = 2, /**<  3GPP2. */
+} ql_mcm_voice_tech_t;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_CALL_NUMBER_UNKNOWN      = 0x0000,
+    E_QL_MCM_VOICE_CALL_NUMBER_ALLOWED      = 0x0001, /**<  Number allowed. */
+    E_QL_MCM_VOICE_CALL_NUMBER_RESTRICTED   = 0x0002, /**<  Number restricted. */
+    E_QL_MCM_VOICE_CALL_NUMBER_PAYPHONE     = 0x0003, /**<  Payhone number. */
+} ql_mcm_voice_call_number_presentation_type_t;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_CALL_MOBILE_ORIGINATED   = 0x0000, /**<  Mobile-originated. */
+    E_QL_MCM_VOICE_CALL_MOBILE_TERMINATED   = 0x0001, /**<  Mobile-terminated. */
+} ql_mcm_voice_call_direction_type_t;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_CALL_ANSWER,     //!<Answer the call.
+    E_QL_MCM_VOICE_CALL_END,        //!<Deprecated. Do not use.
+    E_QL_MCM_VOICE_CALL_HOLD,       //!<Hold the call.
+    E_QL_MCM_VOICE_CALL_UNHOLD,     //!<Release the call from hold.
+    E_QL_MCM_VOICE_CALL_CONFERENCE, //!<Conference call.
+    E_QL_MCM_VOICE_CALL_GO_PRIVATE, //!<Private call.
+    E_QL_MCM_VOICE_CALL_END_ALL     //!<End all calls.
+} ql_mcm_voice_call_operation_t;       //!< Voice call operation type.
+
+typedef enum
+{
+    E_QL_MCM_VOICE_CALL_END_REASON_NONE                     = 0,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_OFFLINE                   = 1,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CDMA_LOCK                 = 2,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_SRV                    = 3,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_FADE                      = 4,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INTERCEPT                 = 5,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REORDER                   = 6,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REL_NORMAL                = 7,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REL_SO_REJ                = 8,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INCOM_CALL                = 9,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ALERT_STOP                = 10,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CLIENT_END                = 11,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACTIVATION                = 12,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MC_ABORT                  = 13,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MAX_ACCESS_PROBE          = 14,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_PSIST_N                   = 15,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UIM_NOT_PRESENT           = 16,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACC_IN_PROG               = 17,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACC_FAIL                  = 18,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RETRY_ORDER               = 19,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CCS_NOT_SUPPORTED_BY_BS   = 20,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_RESPONSE_FROM_BS       = 21,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REJECTED_BY_BS            = 22,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INCOMPATIBLE              = 23,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_BLOCK              = 24,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ALREADY_IN_TC             = 25,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_EMERGENCY_FLASHED         = 26,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_USER_CALL_ORIG_DURING_GPS = 27,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_USER_CALL_ORIG_DURING_SMS = 28,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_USER_CALL_ORIG_DURING_DATA= 29,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REDIR_OR_HANDOFF          = 30,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_BLOCK_ALL          = 31,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_OTASP_SPC_ERR             = 32,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_IS707B_MAX_ACC            = 33,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACC_FAIL_REJ_ORD          = 34,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACC_FAIL_RETRY_ORD        = 35,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_TIMEOUT_T42               = 36,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_TIMEOUT_T40               = 37,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SRV_INIT_FAIL             = 38,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_T50_EXP                   = 39,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_T51_EXP                   = 40,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RL_ACK_TIMEOUT            = 41,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_BAD_FL                    = 42,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_TRM_REQ_FAIL              = 43,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_TIMEOUT_T41               = 44,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INCOM_REJ                 = 45,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SETUP_REJ                 = 46,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NETWORK_END               = 47,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_FUNDS                  = 48,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_GW_SRV                 = 49,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_CDMA_SRV               = 50,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_FULL_SRV               = 51,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MAX_PS_CALLS              = 52,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UNKNOWN_SUBSCRIBER        = 53,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ILLEGAL_SUBSCRIBER        = 54,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_BEARER_SERVICE_NOT_PROVISIONED= 55,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_TELE_SERVICE_NOT_PROVISIONED  = 56,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ILLEGAL_EQUIPMENT         = 57,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CALL_BARRED               = 58,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ILLEGAL_SS_OPERATION      = 59,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SS_ERROR_STATUS           = 60,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SS_NOT_AVAILABLE          = 61,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SS_SUBSCRIPTION_VIOLATION = 62,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SS_INCOMPATIBILITY        = 63,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_FACILITY_NOT_SUPPORTED    = 64,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ABSENT_SUBSCRIBER         = 65,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SHORT_TERM_DENIAL         = 66,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_LONG_TERM_DENIAL          = 67,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SYSTEM_FAILURE            = 68,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_DATA_MISSING              = 69,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UNEXPECTED_DATA_VALUE     = 70,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_PWD_REGISTRATION_FAILURE  = 71,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NEGATIVE_PWD_CHECK        = 72,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NUM_OF_PWD_ATTEMPTS_VIOLATION     = 73,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_POSITION_METHOD_FAILURE   = 74,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UNKNOWN_ALPHABET          = 75,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_USSD_BUSY                 = 76,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REJECTED_BY_USER          = 77,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REJECTED_BY_NETWORK       = 78,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_DEFLECTION_TO_SERVED_SUBSCRIBER   = 79,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SPECIAL_SERVICE_CODE      = 80,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INVALID_DEFLECTED_TO_NUMBER       = 81,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MPTY_PARTICIPANTS_EXCEEDED= 82,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RESOURCES_NOT_AVAILABLE   = 83,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UNASSIGNED_NUMBER         = 84,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_ROUTE_TO_DESTINATION   = 85,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CHANNEL_UNACCEPTABLE      = 86,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_OPERATOR_DETERMINED_BARRING       = 87,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NORMAL_CALL_CLEARING      = 88,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_USER_BUSY                 = 89,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_USER_RESPONDING        = 90,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_USER_ALERTING_NO_ANSWER   = 91,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CALL_REJECTED             = 92,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NUMBER_CHANGED            = 93,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_PREEMPTION                = 94,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_DESTINATION_OUT_OF_ORDER  = 95,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INVALID_NUMBER_FORMAT     = 96,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_FACILITY_REJECTED         = 97,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RESP_TO_STATUS_ENQUIRY    = 98,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NORMAL_UNSPECIFIED        = 99,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_CIRCUIT_OR_CHANNEL_AVAILABLE   = 100,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NETWORK_OUT_OF_ORDER      = 101,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_TEMPORARY_FAILURE         = 102,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SWITCHING_EQUIPMENT_CONGESTION    = 103,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_INFORMATION_DISCARDED      = 104,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 105,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 106,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_QOS_UNAVAILABLE                   = 107,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REQUESTED_FACILITY_NOT_SUBSCRIBED = 108,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INCOMING_CALLS_BARRED_WITHIN_CUG  = 109,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_BEARER_CAPABILITY_NOT_AUTH        = 110,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_BEARER_CAPABILITY_UNAVAILABLE     = 111,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SERVICE_OPTION_NOT_AVAILABLE      = 112,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACM_LIMIT_EXCEEDED                = 113,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_BEARER_SERVICE_NOT_IMPLEMENTED    = 114,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REQUESTED_FACILITY_NOT_IMPLEMENTED= 115,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 116,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SERVICE_OR_OPTION_NOT_IMPLEMENTED = 117,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INVALID_TRANSACTION_IDENTIFIER    = 118,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_USER_NOT_MEMBER_OF_CUG            = 119,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INCOMPATIBLE_DESTINATION          = 120,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INVALID_TRANSIT_NW_SELECTION      = 121,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE    = 122,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INVALID_MANDATORY_INFORMATION     = 123,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MESSAGE_TYPE_NON_IMPLEMENTED      = 124,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 125,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INFORMATION_ELEMENT_NON_EXISTENT  = 126,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CONDITONAL_IE_ERROR               = 127,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 128,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RECOVERY_ON_TIMER_EXPIRED         = 129,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_PROTOCOL_ERROR_UNSPECIFIED        = 130,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INTERWORKING_UNSPECIFIED          = 131,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_OUTGOING_CALLS_BARRED_WITHIN_CUG  = 132,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_CUG_SELECTION                  = 133,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UNKNOWN_CUG_INDEX                 = 134,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CUG_INDEX_INCOMPATIBLE            = 135,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CUG_CALL_FAILURE_UNSPECIFIED      = 136,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CLIR_NOT_SUBSCRIBED               = 137,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CCBS_POSSIBLE                     = 138,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CCBS_NOT_POSSIBLE                 = 139,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_IMSI_UNKNOWN_IN_HLR               = 140,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ILLEGAL_MS                        = 141,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_IMSI_UNKNOWN_IN_VLR               = 142,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_IMEI_NOT_ACCEPTED                 = 143,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ILLEGAL_ME                        = 144,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_PLMN_NOT_ALLOWED                  = 145,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_LOCATION_AREA_NOT_ALLOWED         = 146,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ROAMING_NOT_ALLOWED_IN_THIS_LOCATION_AREA = 147,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_SUITABLE_CELLS_IN_LOCATION_AREA= 148,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NETWORK_FAILURE                   = 149,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MAC_FAILURE                       = 150,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SYNCH_FAILURE                     = 151,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NETWORK_CONGESTION                = 152,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_GSM_AUTHENTICATION_UNACCEPTABLE   = 153,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SERVICE_NOT_SUBSCRIBED            = 154,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SERVICE_TEMPORARILY_OUT_OF_ORDER  = 155,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CALL_CANNOT_BE_IDENTIFIED         = 156,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INCORRECT_SEMANTICS_IN_MESSAGE    = 157,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MANDATORY_INFORMATION_INVALID     = 158,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_STRATUM_FAILURE            = 159,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INVALID_SIM                       = 160,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_WRONG_STATE                       = 161,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_CLASS_BLOCKED              = 162,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_RESOURCES                      = 163,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INVALID_USER_DATA                 = 164,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_TIMER_T3230_EXPIRED               = 165,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_CELL_AVAILABLE                 = 166,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ABORT_MSG_RECEIVED                = 167,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RADIO_LINK_LOST                   = 168,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_TIMER_T303_EXPIRED                = 169,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CNM_MM_REL_PENDING                = 170,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_STRATUM_REJ_RR_REL_IND     = 171,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_STRATUM_REJ_RR_RANDOM_ACCESS_FAILURE   = 172,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_STRATUM_REJ_RRC_REL_IND                = 173,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_STRATUM_REJ_RRC_CLOSE_SESSION_IND      = 174,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_STRATUM_REJ_RRC_OPEN_SESSION_FAILURE   = 175,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_STRATUM_REJ_LOW_LEVEL_FAIL             = 176,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_STRATUM_REJ_LOW_LEVEL_FAIL_REDIAL_NOT_ALLOWED = 177,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_STRATUM_REJ_LOW_LEVEL_IMMED_RETRY      = 178,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ACCESS_STRATUM_REJ_ABORT_RADIO_UNAVAILABLE    = 179,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SERVICE_OPTION_NOT_SUPPORTED                  = 180,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_UL_DATA_CNF_FAILURE_TXN           = 181,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_UL_DATA_CNF_FAILURE_HO            = 182,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_UL_DATA_CNF_FAILURE_CONN_REL      = 183,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_UL_DATA_CNF_FAILURE_RLF           = 184,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_UL_DATA_CNF_FAILURE_CTRL_NOT_CONN = 185,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_EST_SUCCESS                  = 186,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_EST_FAILURE                  = 187,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_EST_FAILURE_ABORTED          = 188,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_EST_FAILURE_ACCESS_BARRED    = 189,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_EST_FAILURE_CELL_RESEL       = 190,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_EST_FAILURE_CONFIG_FAILURE   = 191,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_EST_FAILURE_TIMER_EXPIRED    = 192,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_EST_FAILURE_LINK_FAILURE     = 193,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_EST_FAILURE_NOT_CAMPED       = 194,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_EST_FAILURE_SI_FAILURE       = 195,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_EST_FAILURE_CONN_REJECT      = 196,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_REL_NORMAL                   = 197,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_REL_RLF                      = 198,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_REL_CRE_FAILURE              = 199,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_REL_OOS_DURING_CRE           = 200,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_REL_ABORTED                  = 201,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_REL_SIB_READ_ERROR           = 202,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_CONN_REL_ABORTED_IRAT_SUCCESS     = 203,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_LRRC_RADIO_LINK_FAILURE                = 204,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_DETACH_WITH_REATTACH_LTE_NW_DETACH     = 205,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AS_REJ_DETACH_WITH_OUT_REATTACH_LTE_NW_DETACH = 206,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_BAD_REQ_WAIT_INVITE           = 207,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_BAD_REQ_WAIT_REINVITE         = 208,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INVALID_REMOTE_URI            = 209,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REMOTE_UNSUPP_MEDIA_TYPE      = 210,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_PEER_NOT_REACHABLE            = 211,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NETWORK_NO_RESP_TIME_OUT      = 212,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NETWORK_NO_RESP_HOLD_FAIL     = 213,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_DATA_CONNECTION_LOST          = 214,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UPGRADE_DOWNGRADE_REJ         = 215,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SIP_403_FORBIDDEN             = 216,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NO_NETWORK_RESP               = 217,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UPGRADE_DOWNGRADE_FAILED      = 218,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UPGRADE_DOWNGRADE_CANCELLED   = 219,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SSAC_REJECT                   = 220,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_THERMAL_EMERGENCY             = 221,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_SOFT_FAILURE           = 222,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_HARD_FAILURE           = 223,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CONNECTION_EST_FAILURE        = 224,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CONNECTION_FAILURE            = 225,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RRC_CONN_REL_NO_MT_SETUP      = 226,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ESR_FAILURE                   = 227,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MT_CSFB_NO_RESPONSE_FROM_NW   = 228,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_BUSY_EVERYWHERE               = 229,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ANSWERED_ELSEWHERE            = 230,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RLF_DURING_CC_DISCONNECT      = 231,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_TEMP_REDIAL_ALLOWED           = 232,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_PERM_REDIAL_NOT_NEEDED        = 233,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MERGED_TO_CONFERENCE          = 234,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_LOW_BATTERY                   = 235,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CALL_DEFLECTED                = 236,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RTP_RTCP_TIMEOUT              = 237,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RINGING_RINGBACK_TIMEOUT      = 238,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REG_RESTORATION               = 239,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CODEC_ERROR                   = 240,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UNSUPPORTED_SDP               = 241,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_RTP_FAILURE                   = 242,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_QoS_FAILURE                   = 243,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MULTIPLE_CHOICES              = 244,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MOVED_PERMANENTLY             = 245,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MOVED_TEMPORARILY             = 246,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_USE_PROXY                     = 247,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ALTERNATE_SERVICE             = 248,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ALTERNATE_EMERGENCY_CALL      = 249,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UNAUTHORIZED                  = 250,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_PAYMENT_REQUIRED              = 251,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_METHOD_NOT_ALLOWED            = 252,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NOT_ACCEPTABLE                = 253,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_PROXY_AUTHENTICATION_REQUIRED = 254,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_GONE                          = 255,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REQUEST_ENTITY_TOO_LARGE      = 256,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REQUEST_URI_TOO_LARGE         = 257,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UNSUPPORTED_URI_SCHEME        = 258,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_BAD_EXTENSION                 = 259,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_EXTENSION_REQUIRED            = 260,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INTERVAL_TOO_BRIEF            = 261,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CALL_OR_TRANS_DOES_NOT_EXIST  = 262,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_LOOP_DETECTED                 = 263,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_TOO_MANY_HOPS                 = 264,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_ADDRESS_INCOMPLETE            = 265,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_AMBIGUOUS                     = 266,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REQUEST_TERMINATED            = 267,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NOT_ACCEPTABLE_HERE           = 268,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REQUEST_PENDING               = 269,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_UNDECIPHERABLE                = 270,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SERVER_INTERNAL_ERROR         = 271,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_NOT_IMPLEMENTED               = 272,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_BAD_GATEWAY                   = 273,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SERVER_TIME_OUT               = 274,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_VERSION_NOT_SUPPORTED         = 275,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_MESSAGE_TOO_LARGE             = 276,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_DOES_NOT_EXIST_ANYWHERE       = 277,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SESS_DESCR_NOT_ACCEPTABLE     = 278,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SRVCC_END_CALL                = 279,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_INTERNAL_ERROR                = 280,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_SERVER_UNAVAILABLE            = 281,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_PRECONDITION_FAILURE          = 282,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_DRVCC_IN_PROG                 = 283,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_DRVCC_END_CALL                = 284,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CS_HARD_FAILURE               = 285,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CS_ACQ_FAILURE                = 286,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_FALLBACK_TO_CS                = 287,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_DEAD_BATTERY                  = 288,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_HO_NOT_FEASIBLE               = 289,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_PDN_DISCONNECTED              = 290,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REJECTED_ELSEWHERE            = 291,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CALL_PULLED                   = 292,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_CALL_PULL_OUT_OF_SYNC         = 293,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_HOLD_RESUME_FAILED            = 294,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_HOLD_RESUME_CANCELED          = 295,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_REINVITE_COLLISION            = 296,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_MSG_INVAILD            = 297,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_MSG_IGNORE             = 298,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAIL_ACQ_FAIL          = 299,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAIL_CALL_REL_REL_ORDER= 300,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAIL_CALL_REL_REORDER  = 301,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAIL_CALL_REL_INTERCEPT_ORDER      = 302,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAIL_CALL_REL_NORMAL   = 303,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAIL_CALL_REL_SO_REJ   = 304,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAIL_CALL_REL_OTASP_SPC_ERR        = 305,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAILURE_SRCH_TT_FAIL   = 306,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAILURE_TCH_INIT_FAIL  = 307,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAILURE_FAILURE_USER_CALL_END      = 308,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAILURE_FAILURE_RETRY_EXHAUST      = 309,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAILURE_FAILURE_CALL_REL_REG_REJ   = 310,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_FAILURE_FAILURE_CALL_REL_NW_REL_ODR= 311,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_1XCSFB_HO_FAILURE                         = 312,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_EMM_REJ_TIMER_T3417_EXT_EXP               = 313,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_EMM_REJ_TIMER_T3417_EXP                   = 314,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_EMM_REJ_SERVICE_REQ_FAILURE_LTE_NW_REJECT = 315,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_EMM_REJ_SERVICE_REQ_FAILURE_CS_DOMAIN_NOT_AVAILABLE = 316,
+    E_QL_MCM_VOICE_CALL_END_CAUSE_EMM_REJ                                   = 317,
+} ql_mcm_voice_call_end_reason_t;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_UUS_TYPE1_IMPLICIT,          //!< Type 1 implicit.
+    E_QL_MCM_VOICE_UUS_TYPE1_REQUIRED,          //!< Type 1 required.
+    E_QL_MCM_VOICE_UUS_TYPE1_NOT_REQUIRED,      //!< Type 1 not required.
+    E_QL_MCM_VOICE_UUS_TYPE2_REQUIRED,          //!< Type 2 required.
+    E_QL_MCM_VOICE_UUS_TYPE2_NOT_REQUIRED,      //!< Type 2 not required.
+    E_QL_MCM_VOICE_UUS_TYPE3_REQUIRED,          //!< Type 3 required.
+    E_QL_MCM_VOICE_UUS_TYPE3_NOT_REQUIRED,      //!< Type 3 not required.
+    E_QL_MCM_VOICE_UUS_TYPE_DATA                //!< Data.
+} ql_mcm_voice_uus_type_t;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_UUS_DCS_IA5,                 //!< IA5.
+    E_QL_MCM_VOICE_UUS_DCS_OHLP,                //!< OHLP.
+    E_QL_MCM_VOICE_UUS_DCS_USP,                 //!< USP.
+    E_QL_MCM_VOICE_UUS_DCS_X244                 //!< x244.
+} ql_mcm_voice_uus_dcs_type_t;                  //!< UUS data coding scheme.
+
+
+typedef struct
+{
+    ql_mcm_voice_uus_type_t     type;           /**< UUS type; range -- 0 to 6.*/
+    ql_mcm_voice_uus_dcs_type_t dcs;            /**< UUS data coding scheme; range -- 0 to 4.*/
+    uint32_t                    uus_data_len;   /**< Must be set to the number of elements in uus_data. */
+    uint8_t                     uus_data[QL_MCM_MAX_UUS_DATA];/**< Voice call UUS data.*/
+} ql_mcm_voice_uusdata_t;
+
+typedef struct
+{
+    uint32_t                                      call_id;                                /**<   Call ID associated with this call.*/
+    ql_mcm_voice_call_state_t                     state;                                  /**<   Current call state (mcm_voice_call_state).*/
+    ql_mcm_voice_tech_t                           tech;                                   /**<   Technology (mcm_tech).*/
+    char                                          number[QL_MCM_MAX_PHONE_NUMBER + 1];    /**<   Phone number.*/
+    ql_mcm_voice_call_number_presentation_type_t  number_presentation;                    /**<   Number presentation.*/
+    ql_mcm_voice_call_direction_type_t            direction;                              /**<   Voice call direction.*/
+    uint8_t                                       uusdata_valid;                          /**<   Indicates whether UUS data is valid.*/
+    ql_mcm_voice_uusdata_t                        uusdata;                                /**<   User-to-user signaling data.*/
+    uint8_t                                       call_end_reason_valid;                  /**<   Indicates whether call_end_reason is valid.*/
+    ql_mcm_voice_call_end_reason_t                call_end_reason;
+} ql_mcm_voice_call_record_t;
+
+typedef struct
+{
+    uint32_t                      calls_len;  /**< Must be set to # of elements in calls */
+    ql_mcm_voice_call_record_t    calls[QL_MCM_MAX_VOICE_CALLS]; /**<   Calls.*/
+} ql_mcm_voice_calls_state_t;
+
+
+typedef enum
+{
+    E_QL_MCM_VOICE_CALL_FORWARDING_DISABLED         = 0, /**<  Disabled. */
+    E_QL_MCM_VOICE_CALL_FORWARDING_ENABLED          = 1, /**<  Enabled. */
+} QL_MCM_VOICE_CALL_FORWARDING_STATUS_T;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_CALL_FORWARDING_TYPE_VOICE       = 0, /**<  Voice. */
+    E_QL_MCM_VOICE_CALL_FORWARDING_TYPE_DATA        = 1, /**<  Data. */
+    E_QL_MCM_VOICE_CALL_FORWARDING_TYPE_VOICE_DATA  = 2, /**<  Voice and data. */
+} QL_MCM_VOICE_CALL_FORWARDING_TYPE_T;
+
+typedef struct
+{
+    QL_MCM_VOICE_CALL_FORWARDING_TYPE_T     type;       /**<   Call forwarding type.*/
+    char number[QL_MCM_MAX_PHONE_NUMBER + 1];           /**<   Call forwarding number.*/
+} QL_MCM_VOICE_CALL_FORWARDING_INFO_T; /* Type */
+
+typedef struct
+{
+    QL_MCM_VOICE_CALL_FORWARDING_STATUS_T     status;     /**<   Call forwarding status.*/
+    uint32_t                                  info_len;   /**< Must be set to # of elements in info */
+    QL_MCM_VOICE_CALL_FORWARDING_INFO_T       info[QL_MCM_MAX_CALL_FORWARDING_INFO];/**<   Call forwarding information.*/
+} ql_mcm_voice_call_forwarding_status_list_t; /* Message */
+
+typedef enum
+{
+    E_QL_MCM_VOICE_SERVICE_UNKOWN       =   0,
+    E_QL_MCM_VOICE_SERVICE_REGISTER     =   1,  /**<  Register. */
+    E_QL_MCM_VOICE_SERVICE_ERASE        =   2,  /**<  Erase. */
+} E_QL_MCM_VOICE_CALL_SERVICE_T;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_CALL_FORWARD_UNCONDITIONALLY     = 0, /**<  Unconditional call forwarding. */
+    E_QL_MCM_VOICE_CALL_FORWARD_MOBILEBUSY          = 1, /**<  Forward when the mobile device is busy. */
+    E_QL_MCM_VOICE_CALL_FORWARD_NOREPLY             = 2, /**<  Forward when there is no reply. */
+    E_QL_MCM_VOICE_CALL_FORWARD_UNREACHABLE         = 3, /**<  Forward when the call is unreachable. */
+    E_QL_MCM_VOICE_CALL_FORWARD_ALLFORWARDING       = 4, /**<  All forwarding(0-3). */
+    E_QL_MCM_VOICE_CALL_FORWARD_ALLCONDITIONAL      = 5, /**<  All conditional forwarding(1-3). */
+} E_QL_MCM_VOICE_CALL_FORWARDING_REASON_T;
+
+
+typedef enum
+{
+    E_QL_MCM_VOICE_CALL_WAITING_VOICE_ENABLED       = 0, /**<  Voice call waiting enabled. */
+    E_QL_MCM_VOICE_CALL_WAITING_DISABLED            = 1, /**<  Voice call waiting disabled. */
+} E_QL_MCM_VOICE_CALL_WAITING_SERVICE_T;
+
+typedef struct
+{
+    E_QL_MCM_VOICE_CALL_WAITING_SERVICE_T   waiting_service;
+} ql_mcm_voice_call_waiting_service_t;
+
+
+
+typedef enum
+{
+    E_QL_MCM_VOICE_CLIR_INVOCATION                  = 0, /**<  Invocation. */
+    E_QL_MCM_VOICE_CLIR_SUPPRESSION                 = 1, /**<  Suppression. */
+} ql_mcm_voice_clir_action_t;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_CLIR_NOT_PROVISIONED             = 0, /**<  Not provisioned. */
+    E_QL_MCM_VOICE_CLIR_PROVISIONED_PERMANENT_MODE  = 1, /**<  Permanently provisioned. */
+    E_QL_MCM_VOICE_CLIR_PRESENTATION_RESTRICTED     = 2, /**<  Restricted presentation. */
+    E_QL_MCM_VOICE_CLIR_PRESENTATION_ALLOWED        = 3, /**<  Allowed presentation. */
+} ql_mcm_voice_clir_presentation_t;
+
+typedef struct
+{
+    ql_mcm_voice_clir_action_t          action;
+    ql_mcm_voice_clir_presentation_t    presentation;  /**<   CLIR presentation.*/
+} ql_mcm_voice_clir_info_t;
+
+
+
+typedef enum
+{
+    E_QL_MCM_VOICE_USSD_MSG_TYPE_NEW_MESSAGE        = 0, /**<  Initiate a new USSD sesion with network. */
+    E_QL_MCM_VOICE_USSD_MSG_TYPE_REPLY_TO_IND       = 1, /**<  Reply to a USSD indication from the network. */
+} ql_mcm_voice_ussd_msg_type_t;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_USSD_ENCODING_ASCII              = 0, /**<  ASCII coding scheme. */
+    E_QL_MCM_VOICE_USSD_ENCODING_8BIT               = 1, /**<  8-bit coding scheme. */
+    E_QL_MCM_VOICE_USSD_ENCODING_UCS2               = 2, /**<  UCS2. */
+} ql_mcm_voice_ussd_encoding_type_t;
+
+typedef struct
+{
+    ql_mcm_voice_ussd_msg_type_t      type;           /**<   Whether sending a new request or a reply to indication*/
+    ql_mcm_voice_ussd_encoding_type_t encoding;       /**<   USSD encoding.*/
+    char ussd_string[QL_MCM_MAX_USSD_LENGTH + 1];    /**<   USSD string.*/
+} ql_mcm_voice_ussd_info_t; /* Message */
+
+
+typedef enum
+{
+    E_QL_MCM_SIMRIL_CHANGE_CALL_BARRING_PWD_REASON_ALLOUTGOING           = 0, /**<  All outgoing. */
+    E_QL_MCM_SIMRIL_CHANGE_CALL_BARRING_PWD_REASON_OUTGOINGINT           = 1, /**<  Outgoing internal. */
+    E_QL_MCM_SIMRIL_CHANGE_CALL_BARRING_PWD_REASON_OUTGOINGINTEXTOHOME   = 2, /**<  Outgoing external to home. */
+    E_QL_MCM_SIMRIL_CHANGE_CALL_BARRING_PWD_REASON_ALLINCOMING           = 3, /**<  All incoming. */
+    E_QL_MCM_SIMRIL_CHANGE_CALL_BARRING_PWD_REASON_INCOMINGROAMING       = 4, /**<  Roaming incoming. */
+    E_QL_MCM_SIMRIL_CHANGE_CALL_BARRING_PWD_REASON_ALLBARRING            = 5, /**<  All calls are barred. */
+    E_QL_MCM_SIMRIL_CHANGE_CALL_BARRING_PWD_REASON_ALLOUTGOINGBARRING    = 6, /**<  All outgoing calls are barred. */
+    E_QL_MCM_SIMRIL_CHANGE_CALL_BARRING_PWD_REASON_ALLINCOMINGBARRING    = 7, /**<  All incoming calls are barred. */
+} ql_mcm_change_call_barring_pwd_reason_t;
+
+typedef struct
+{
+    ql_mcm_change_call_barring_pwd_reason_t     reason;  /**<  Reason for the password change. Refer to 3GPP TS 27.007 @xhyperref{S8,[S8]}, Section 7.4.*/
+    char                                        old_pwd[QL_MCM_MAX_PASSWORD_LENGTH + 1];
+    char                                        new_pwd[QL_MCM_MAX_PASSWORD_LENGTH + 1];
+} ql_mcm_change_call_barring_pwd_info_t; /* Message */
+
+
+typedef enum
+{
+    E_QL_MCM_SIMRIL_E911_UNKNOWN   = -1,   /**<  E911 unknown. */
+    E_QL_MCM_SIMRIL_E911_INACTIVE  = 0,    /**<  E911 INACTIVE. */
+    E_QL_MCM_SIMRIL_E911_ACTIVE    = 1,    /**<  E911 ACTIVE. */
+} ql_mcm_simril_e911_state_t;
+
+typedef ql_mcm_voice_call_state_t E_QL_VOICE_CALL_STATE_T;
+
+typedef enum
+{
+    E_QL_MCM_ECALL_TEST             = 0x01,
+    E_QL_MCM_ECALL_EMERGENCY        = 0x02,
+    E_QL_MCM_ECALL_RECONFIG         = 0x03,
+} E_QL_MCM_ECALL_VARIANT_T;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_AUTO_ANSWER_ENABLE       = 0,    /**<  Enable auto-answer. */
+    E_QL_MCM_VOICE_AUTO_ANSWER_DISABLE      = 1,    /**<  Disable auto-answer. */
+} E_QL_MCM_VOICE_AUTO_ANSWER_T;
+
+
+//Laurence.yin-2018/04/03-QCM9XOL00004C011-P02, <[MCM-ECALL] : add ecall status ind info.>
+typedef enum
+{
+    E_QL_MCM_VOICE_UNKOWN_IND               = 0,
+    E_QL_MCM_VOICE_CALL_IND,
+    E_QL_MCM_VOICE_ECALL_STATUE_IND,
+    E_QL_MCM_VOICE_ECALL_URC_IND,
+    E_QL_MCM_VOICE_ECALL_EVENT_IND,
+
+} E_QL_MCM_VOICE_IND_T;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_ECALL_MSD_TRANSMISSION_STATUS_SUCCESS        = 0x00, /**<   Success \n       */
+    E_QL_MCM_VOICE_ECALL_MSD_TRANSMISSION_STATUS_FAILURE        = 0x01, /**<   Generic failure  */
+} E_QL_MCM_EALL_MSD_TRANSMISSION_STATUS_T;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_ECALL_INACTIVE               = 0,
+    E_QL_MCM_VOICE_ECALL_ORIGINATING_CALL       = 1,
+    E_QL_MCM_VOICE_ECALL_IN_CALL_TRANSMITTING   = 2, /**<  ECALL APP TRANSMITTING */
+    E_QL_MCM_VOICE_ECALL_WATING_FOR_AL_ACK      = 3,
+    E_QL_MCM_VOICE_ECALL_IN_CALL                = 4,
+    E_QL_MCM_VOICE_ECALL_IDLE_ALLOW_MT_ECALL    = 5,
+} E_QL_MCM_ECALL_STATE_T;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_ECALL_MODE_NOMAL   = 0,
+    E_QL_MCM_VOICE_ECALL_MODE_ONLY    = 1,
+    E_QL_MCM_VOICE_ECALL_MODE_DEFAULT = 2
+} E_QL_MCM_ECALL_MODE_T;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_ECALL_CONFIG_ENABLE            = 0,
+    E_QL_MCM_VOICE_ECALL_CONFIG_VIOCECONF,
+    E_QL_MCM_VOICE_ECALL_CONFIG_MODE,
+    E_QL_MCM_VOICE_ECALL_CONFIG_PROCESSINFO,
+    E_QL_MCM_VOICE_ECALL_CONFIG_START_TIMER,
+    E_QL_MCM_VOICE_ECALL_CONFIG_HACK_TIMER,
+    E_QL_MCM_VOICE_ECALL_CONFIG_MSD_TRANSMISSION,
+    E_QL_MCM_VOICE_ECALL_CONFIG_MO_FAILR_REDIAL,
+    E_QL_MCM_VOICE_ECALL_CONFIG_DROP_REDIAL
+} E_QL_MCM_ECALL_CONFIG_T;
+
+typedef struct
+{
+    char                        ecall_msd[QL_MCM_MAX_ECALL_MSD];  //max msd length 140
+    uint32_t                    msd_len;
+    int                         manual;
+    E_QL_MCM_ECALL_VARIANT_T    eCallModeType;
+} ql_mcm_ecall_info;
+
+typedef struct
+{
+    uint8_t enable;           /*  Enable or disable ecall ;0 -- Disable; 1 -- Enable */
+    uint8_t voiceconfig;      /*  Enable or disable to mute IVS speaker in MSD
+                            0 -- Disable to mute IVS speaker automatical in MSD transmission
+                            1 -- Enable to mute IVS speaker automatical in MSD transmission */
+    E_QL_MCM_ECALL_MODE_T ecallmode;  /*  The Ecall mode. */
+    uint8_t processinfo;      /*  Enable or disable to report ecall event info.   0 -- Disable; 1 -- Enable */
+    uint8_t T5;               /*  The timer of IVS waiting for "START". */
+    uint8_t T6;               /*  The timer of IVS waiting for "HACK". */
+    uint8_t T7;               /*  The timer of MSD transmission. */
+    uint8_t mofailredial;     /*  The dial fail times. */
+    uint8_t dropredial;
+} ql_mcm_ecall_config_info;
+
+
+typedef struct
+{
+    uint8_t call_id;                                                    /**<  call_id.*/
+    uint8_t ecall_msd_tx_status_valid;
+    E_QL_MCM_EALL_MSD_TRANSMISSION_STATUS_T ecall_msd_tx_status;
+} ql_mcm_voice_ecall_status_t; /* Message */
+
+typedef struct
+{
+    uint8_t call_id;                /**<  call_id.*/
+    uint32_t ecall_urc_event_len;   /**< Must be set to # of elements in ecall_urc_event */
+    char ecall_urc_event[QL_MCM_MAX_ECALL_URC_EVENT_LENGTH];
+} ql_mcm_voice_ecall_urc_t;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_ECALL_EVENT_FAIL_START_TIMEOUT             = 1, /**<  Wait for START timeout. */
+    E_QL_MCM_VOICE_ECALL_EVENT_FAIL_HACK_TIMEOUT              = 2, /**<  Wait for HACK timeout.    */
+    E_QL_MCM_VOICE_ECALL_EVENT_FAIL_MSD_TRANSMISSION_TIMEOUT  = 3, /**<  MSD transmission timeout.     */
+    E_QL_MCM_VOICE_ECALL_EVENT_FAIL_IVS_RESET_TIMEOUT         = 4  /**<  IVS reset. */
+} E_QL_MCM_VOICE_ECALL_EVENT_FAIL_T;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_ECALL_EVENT_PROCESS_IVS_START_RECEIVED_MSD = 1, /**<  IVS Link Layer receives START message and starts to send MSD */
+    E_QL_MCM_VOICE_ECALL_EVENT_PROCESS_IVS_NACK_RECEIVED      = 2, /**<  IVS Link Layer receives NACK message. */
+    E_QL_MCM_VOICE_ECALL_EVENT_PROCESS_IVS_ACK_RECEIVED       = 3, /**<  IVS Link Layer receives the first LACK message. */
+    E_QL_MCM_VOICE_ECALL_EVENT_PROCESS_IVS_TX_COMPLETED       = 4, /**<  IVS MSD transmission is complete. */
+    E_QL_MCM_VOICE_ECALL_EVENT_PROCESS_IVS_HLACK_RECEIVED     = 5  /**<  IVS Link Layer receives first HACK message. */
+} E_QL_MCM_VOICE_ECALL_EVENT_PROCESS_T;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_ECALL_EVENT_MSDUPDATE_IVS_UPDATING_MSD         = 0, /**<  Indicates MSD has been updated. */
+    E_QL_MCM_VOICE_ECALL_EVENT_MSDUPDATE_PSAP_REQURE_UPDATE_MSD   = 1, /**<  Indicate timeout of updating MSD and module starts to transfer the old MSD. */
+    E_QL_MCM_VOICE_ECALL_EVENT_MSDUPDATE_IVS_UPDATE_MSD_TIMEOUT   = 2  /**<  Indicate to update MSD in 5 seconds. */
+} E_QL_MCM_VOICE_ECALL_EVENT_MSDUPDATE_T;
+
+typedef enum
+{
+    E_QL_MCM_VOICE_ECALL_EVENT_ECALL_ESTABLISHNG_SUCCESS  = 0, /**<  Establish eCall successfully. */
+    E_QL_MCM_VOICE_ECALL_EVENT_ECALL_ESTABLISHNG_FAIL     = 1  /**<  Establish eCall fails. */
+} E_QL_MCM_VOICE_ECALL_EVENT_ESTABLISH_T;
+
+typedef struct
+{
+    uint16_t hack_code;  /**<   psap hack code.*/
+} ql_mcm_voice_ecall_event_hackcode_t; /* Type */
+
+typedef struct
+{
+    uint8_t ori_remainder_times;  /**<   originate fail remainder times*/
+    uint16_t time;                /**<   the minimum time duration between the previous call attempt*/
+} ql_mcm_voice_ecall_event_originate_fail_and_redial_t; /* Type */
+
+typedef struct
+{
+    uint8_t drop_remainder_times;  /**<   dorp remainder times*/
+    uint16_t time;                 /**<   the minimum time duration between the previous call attempt*/
+} ql_mcm_voice_ecall_event_drop_and_redial_t; /* Type */
+
+
+typedef struct
+{
+    uint8_t                                               ecall_event_fails_valid;
+    E_QL_MCM_VOICE_ECALL_EVENT_FAIL_T                     ecall_event_fails;          /**<   event of eCall Failed.*/
+    uint8_t                                               ecall_event_process_valid;
+    E_QL_MCM_VOICE_ECALL_EVENT_PROCESS_T                  ecall_event_process;        /**<   event of eCall process.*/
+    uint8_t                                               ecall_event_msdupdate_valid;
+    E_QL_MCM_VOICE_ECALL_EVENT_MSDUPDATE_T                ecall_event_msdupdate;      /**<   event of ecall msd update.*/
+    uint8_t                                               ecall_event_establish_valid;
+    E_QL_MCM_VOICE_ECALL_EVENT_ESTABLISH_T                ecall_event_establish;      /**<   event of eCall establish.*/
+    uint8_t                                               ecall_event_hackcode_valid;
+    ql_mcm_voice_ecall_event_hackcode_t                   ecall_event_hackcode;       /**<   event of eCall hack code.*/
+    uint8_t                                               ecall_event_ori_redial_valid;
+    ql_mcm_voice_ecall_event_originate_fail_and_redial_t  ecall_event_ori_redial;     /**<   event of originate fail and redial.*/
+    uint8_t                                               ecall_event_drop_redial_valid;
+    ql_mcm_voice_ecall_event_drop_and_redial_t            ecall_event_drop_redial;    /**<   event of drop and redial.*/
+} ql_mcm_voice_ecall_event_t; /* Message */
+
+
+typedef ql_mcm_voice_calls_state_t ql_mcm_voice_call_ind;
+typedef ql_mcm_voice_ecall_status_t ql_mcm_voice_ecall_status_ind;
+typedef ql_mcm_voice_ecall_urc_t ql_mcm_voice_ecall_urc_ind;
+typedef ql_mcm_voice_ecall_event_t ql_mcm_voice_ecall_event_ind;
+
+
+
+
+/* Callback function registered via QL_Voice_Call_AddStateHandler;
+   This will be called if any stated changed of call_id
+*/
+typedef void (*QL_VoiceCall_CommonStateHandlerFunc_t)
+(
+    unsigned long message_id,
+    void *ind_data,
+    uint32_t ind_data_len
+);
+
+
+typedef uint32 voice_client_handle_type;
+
+/* Callback function registered via QL_Voice_Call_AddStateHandler;
+   This will be called if any stated changed of call_id
+*/
+typedef void (*QL_VoiceCall_StateHandlerFunc_t)
+(
+    int                     call_id,
+    char*                   phone_num,
+    E_QL_VOICE_CALL_STATE_T state,
+    void                    *contextPtr
+);
+
+/* Init voice module and return h_voice, this should be called before any other APIs */
+int QL_Voice_Call_Client_Init(voice_client_handle_type *ph_voice);
+
+/* DeInit voice module and release resources, this should be called at last */
+int QL_Voice_Call_Client_Deinit(voice_client_handle_type h_voice);
+
+/* Add callback function, if any call state changed, handlerPtr will be called to notify App */
+int QL_Voice_Call_AddStateHandler(voice_client_handle_type h_voice,
+                                  QL_VoiceCall_StateHandlerFunc_t   handlerPtr,
+                                  void*                             contextPtr);
+
+/* Remove callback function, won't receive any notify anymore */
+int QL_Voice_Call_RemoveStateHandler(voice_client_handle_type h_voice);
+
+//Laurence.yin-2018/04/03-QCM9XOL00004C011-P02, <[MCM-ECALL] : add ecall status ind info.>
+/* Add callback function, if any call state changed, handlerPtr will be called to notify App */
+int QL_Voice_Call_AddCommonStateHandler(voice_client_handle_type          h_voice,
+                                        QL_VoiceCall_CommonStateHandlerFunc_t   handlerPtr);
+
+/* Remove callback function, won't receive any notify anymore */
+int QL_Voice_Call_RemoveCommonStateHandler(voice_client_handle_type          h_voice);
+
+
+/* Start call and return call_id, this can be used in the later */
+int QL_Voice_Call_Start(voice_client_handle_type    h_voice,
+                        E_QL_VCALL_ID_T             simId,
+                        char*                       phone_number,   ///< [IN] Destination identifier for the voice
+                        int                         *call_id);       ///< [OUT] call id
+
+/* End call of call_id, which returned by QL_Voice_Call_Start or callback func register via QL_Voice_Call_AddStateHandler */
+int QL_Voice_Call_End(  voice_client_handle_type    h_voice,
+                        int                         call_id);        ///< [IN] call id, return by QL_Voice_Start
+
+/* Answer the call of call_id, which returned by callback func register via QL_Voice_Call_AddStateHandler */
+int QL_Voice_Call_Answer(voice_client_handle_type    h_voice,
+                         int                         call_id );
+
+int QL_Voice_Call_Hold( voice_client_handle_type    h_voice);
+
+int QL_Voice_Call_UnHold( voice_client_handle_type    h_voice);
+
+int QL_Voice_Call_Conference( voice_client_handle_type   h_voice);
+
+int QL_Voice_Call_EndConference( voice_client_handle_type   h_voice);
+
+int QL_Voice_Call_Ecall(voice_client_handle_type    h_voice,
+                        E_QL_VCALL_ID_T             simId,
+                        char*                       phone_number,
+                        ql_mcm_ecall_info           ecall_info,
+                        int                         *call_id);
+
+
+int QL_Voice_Call_SetAutoAnswer(voice_client_handle_type                h_voice,
+                                E_QL_MCM_VOICE_AUTO_ANSWER_T    eAnswerType,
+                                uint32_t                        uAnswerTime);
+
+int QL_Voice_Call_Ecall_HangUp(voice_client_handle_type h_voice);
+
+int QL_Voice_Call_Ecall_UpdateMsd(voice_client_handle_type    h_voice,const char *msd,uint32_t   msd_len);
+
+//Ecall Push caommand
+int QL_Voice_Call_Ecall_MsdPush(voice_client_handle_type h_voice,
+                                E_QL_MCM_ECALL_STATE_T *ecall_state);
+
+//Get Ecall config info
+int QL_Voice_Call_Ecall_GetConfigInfo(voice_client_handle_type h_voice,
+                                      ql_mcm_ecall_config_info *ecall_config);
+
+int QL_Voice_Call_Ecall_SetConfigInfo(voice_client_handle_type h_voice,
+                                      E_QL_MCM_ECALL_CONFIG_T ecall_config_type,
+                                      uint8_t value);
+
+
+
+//Cancel dial
+int QL_Voice_Call_CancelDial( voice_client_handle_type   h_voice);
+
+//VTS API
+int QL_Voice_Call_Dtmf( voice_client_handle_type h_voice,uint8_t digit,int call_id);
+
+
+int QL_Voice_Call_GetCallStatus
+(
+    int                         h_voice,
+    int                         call_id, // If call_id<0, means to get all calls state, or get specified call_id info
+    ql_mcm_voice_calls_state_t  *pt_callstate
+);
+
+//Set forwarding
+int QL_Voice_Call_SetForwarding
+(
+    int                             h_voice,
+    E_QL_MCM_VOICE_CALL_SERVICE_T   service,
+    E_QL_MCM_VOICE_CALL_FORWARDING_REASON_T  reason,
+    char *number
+);
+
+//Get forwarding status
+int QL_Voice_Call_GetForwardingStatus
+(
+    int                             h_voice,
+    E_QL_MCM_VOICE_CALL_FORWARDING_REASON_T  reason,
+    ql_mcm_voice_call_forwarding_status_list_t *pt_status
+);
+
+//Set voice call waiting
+int QL_Voice_Call_SetWaiting
+(
+    int                                 h_voice,
+    ql_mcm_voice_call_waiting_service_t e_service
+);
+
+//Get voice call waiting status
+int QL_Voice_Call_GetWaitingStatus
+(
+    int                                 h_voice,
+    ql_mcm_voice_call_waiting_service_t *pe_service
+);
+
+
+/*
+Usage 1 (register callback and wait for new call in, then answer):
+1, QL_Voice_Call_Client_Init
+2, QL_Voice_Call_AddStateHandler(pf_cb)
+3, wait for new call arrive, pf_cb will pass the call_id to app.
+4, QL_Voice_Call_Answer(call_id)
+5, QL_Voice_Call_End
+6, QL_Voice_Call_Client_Deinit
+
+
+Usage 2 (call out):
+1, QL_Voice_Call_Client_Init
+2, QL_Voice_Call_AddStateHandler(pf_cb)
+3, QL_Voice_Call_Start
+4, QL_Voice_Call_End
+5, QL_Voice_Call_Client_Deinit
+
+
+*/
+
+
+#endif // __QL_MCM_VOICE_H__
diff --git a/mbtk/include/ql/ql_mcm_gnss.h b/mbtk/include/ql/ql_mcm_gnss.h
new file mode 100755
index 0000000..b2ee20a
--- /dev/null
+++ b/mbtk/include/ql/ql_mcm_gnss.h
@@ -0,0 +1,414 @@
+#ifndef __QL_MCM_GPS_H__
+#define __QL_MCM_GPS_H__
+#include "mbtk_type.h"
+
+
+#define     LOC_IND_LOCATION_INFO_ON            (1 << 0)
+#define     LOC_IND_STATUS_INFO_ON              (1 << 1)
+#define     LOC_IND_SV_INFO_ON                  (1 << 2)
+#define     LOC_IND_NMEA_INFO_ON                (1 << 3)
+#define     LOC_IND_CAP_INFO_ON                 (1 << 4)
+#define     LOC_IND_UTC_TIME_REQ_ON             (1 << 5)
+#define     LOC_IND_XTRA_DATA_REQ_ON            (1 << 6)
+#define     LOC_IND_AGPS_DATA_CONN_CMD_REQ_ON   (1 << 7)
+#define     LOC_IND_NI_NFY_USER_RESP_REQ_ON     (1 << 8)
+
+typedef uint32 loc_client_handle_type;
+
+typedef enum
+{
+    E_QL_LOC_POS_MODE_STANDALONE        = 0, /**<  Mode for running GPS standalone (no assistance).  */
+    E_QL_LOC_POS_MODE_MS_BASED          = 1, /**<  AGPS MS-Based mode.  */
+    E_QL_LOC_POS_MODE_MS_ASSISTED       = 2, /**<  AGPS MS-Assisted mode.  */
+}E_QL_LOC_POS_MODE_T;
+
+typedef enum
+{
+    E_QL_LOC_POS_RECURRENCE_PERIODIC    = 0, /**<  Receive GPS fixes on a recurring basis at a specified period.  */
+    E_QL_LOC_POS_RECURRENCE_SINGLE      = 1, /**<  Request a single-shot GPS fix.  */
+}E_QL_LOC_POS_RECURRENCE_T;
+
+typedef struct
+{
+  E_QL_LOC_POS_MODE_T       mode;               /*  Position mode.      */
+  E_QL_LOC_POS_RECURRENCE_T recurrence;         /*  Recurrence          */
+  uint32_t                  min_interval;       /*  Minimum Interval, NMEA report frequency, 1000 means 1Hz, 100 means 10Hz    */
+  uint32_t                  preferred_accuracy; /*  Preferred Accuracy , 30m or more, the less it takes longer timer. */
+  uint32_t                  preferred_time;     /*  Preferred Time, first cold-boot may take 100s or more, hot boot may take 2s      */
+}QL_LOC_POS_MODE_INFO_T;
+
+typedef enum
+{
+    E_QL_LOC_LOCATION_LAT_LONG_VALID   = 0x0001, /**<  GPS location has valid latitude and longitude.  */
+    E_QL_LOC_LOCATION_ALTITUDE_VALID   = 0x0002, /**<  GPS location has a valid altitude.  */
+    E_QL_LOC_LOCATION_SPEED_VALID      = 0x0004, /**<  GPS location has a valid speed.  */
+    E_QL_LOC_LOCATION_BEARING_VALID    = 0x0008, /**<  GPS location has a valid bearing.  */
+    E_QL_LOC_LOCATION_ACCURACY_VALID   = 0x0010, /**<  GPS location has valid accuracy.  */
+    E_QL_LOC_LOCATION_SOURCE_INFO_VALID= 0x0020, /**<  GPS location has valid source information.  */
+    E_QL_LOC_LOCATION_IS_INDOOR_VALID  = 0x0040, /**<  GPS location has a valid "is indoor?" flag.  */
+    E_QL_LOC_LOCATION_FLOOR_NUMBE_VALID= 0x0080, /**<  GPS location has a valid floor number.  */
+    E_QL_LOC_LOCATION_MAP_URL_VALID    = 0x0100, /**<  GPS location has a valid map URL.  */
+    E_QL_LOC_LOCATION_MAP_INDEX_VALID  = 0x0200, /**<  GPS location has a valid map index.  */
+}E_QL_LOC_LOCATION_VALID_FLAG;
+
+typedef enum
+{
+    E_QL_LOC_ULP_LOCATION_SOURCE_HYBRID= 0x0001, /**<  Position source is ULP.  */
+    E_QL_LOC_ULP_LOCATION_SOURCE_GNSS  = 0x0002, /**<  Position source is GNSS only.  */
+}E_QL_LOC_ULP_LOCATION_SOURCE;
+
+#define QL_LOC_GPS_RAW_DATA_LEN_MAX         256 /**  Raw data maximum size. */
+#define QL_LOC_GPS_LOCATION_MAP_URL_SIZE    399 /**  Location map URL maximum size (used for indoor positioning). */
+#define QL_LOC_GPS_LOCATION_MAP_IDX_SIZE    16  /**  Location map index maximum size (used for indoor positioning). */
+typedef struct
+{
+    uint32_t    size;                   /**<   Set to the size of mcm_gps_location_t. */
+    E_QL_LOC_LOCATION_VALID_FLAG flags; /**<   Contains GPS location flags bits. */
+    E_QL_LOC_ULP_LOCATION_SOURCE position_source;  /**<   Provider indicator for HYBRID or GPS. */
+    double      latitude;               /**<   Latitude in degrees. */
+    double      longitude;              /**<   Longitude in degrees. */
+    double      altitude;               /**<   Altitude in meters above the WGS 84 reference ellipsoid. */
+    float       speed;                  /**<   Speed in meters per second. */
+    float       bearing;                /**<   Heading in degrees. */
+    float       accuracy;               /**<   Expected accuracy in meters. */
+    int64_t     timestamp;              /**<   Timestamp for the location fix in UTC million-second base.  */
+    int32_t     is_indoor;              /**<   Location is indoors. */
+    float       floor_number;           /**<   Indicates the floor number. */
+    uint32_t    raw_data_len;           /**<   Must be set to # of elements in raw_data */
+    uint8_t     raw_data[QL_LOC_GPS_RAW_DATA_LEN_MAX];          /**<   Allows the HAL to pass additional information related to the location. */
+    char        map_url[QL_LOC_GPS_LOCATION_MAP_URL_SIZE + 1];  /**<   Map URL. */
+    uint8_t     map_index[QL_LOC_GPS_LOCATION_MAP_IDX_SIZE];    /**<   Map index. */
+}QL_LOC_LOCATION_INFO_T;  /* Type */
+
+typedef enum
+{
+    E_QL_LOC_STATUS_NONE            = 0, /**<  GPS status unknown.  */
+    E_QL_LOC_STATUS_SESSION_BEGIN   = 1, /**<  GPS has begun navigating.  */
+    E_QL_LOC_STATUS_SESSION_END     = 2, /**<  GPS has stopped navigating.  */
+    E_QL_LOC_STATUS_ENGINE_ON       = 3, /**<  GPS has powered on but is not navigating.  */
+    E_QL_LOC_STATUS_ENGINE_OFF      = 4, /**<  GPS is powered off.  */
+}E_QL_LOC_STATUS_VALUE_T;
+
+typedef struct
+{
+    uint32_t    size;                   /**<   Set to the size of mcm_gps_sv_info_t. */
+    int         prn;                    /**<   Pseudo-random number for the SV. */
+    float       snr;                    /**<   Signal-to-noise ratio. */
+    float       elevation;              /**<   Elevation of the SV in degrees. */
+    float       azimuth;                /**<   Azimuth of the SV in degrees. */
+}QL_LOC_SV_INFO_T;                      /* Type */
+
+#define     QL_LOC_GPS_SUPPORT_SVS_MAX   32  /**  Maximum number of satellites in view. */
+typedef struct
+{
+    uint32_t            size;                                   /**<   Set to the size of mcm_gps_sv_status_t. */
+    int                 num_svs;                                /**<   Number of SVs currently visible. */
+    QL_LOC_SV_INFO_T    sv_list[QL_LOC_GPS_SUPPORT_SVS_MAX];    /**<   Contains an array of SV information. */
+    uint32_t            ephemeris_mask;                         /**<   Bitmask indicating which SVs have ephemeris data.  */
+    uint32_t            almanac_mask;                           /**<   Bitmask indicating which SVs have almanac data.   */
+    uint32_t            used_in_fix_mask;                       /**<   Bitmask indicating which SVs were used for computing the most recent position fix. */
+}QL_LOC_SV_STATUS_T;  /* Type */
+
+
+#define QL_LOC_NMEA_MAX_LENGTH  255                 /**  NMEA string maximum length. */
+typedef struct
+{
+    int64_t     timestamp;                          /**<   System Timestamp, marked for when got the nmea data */
+    int         length;                             /**<   NMEA string length. */
+    char        nmea[QL_LOC_NMEA_MAX_LENGTH + 1];   /**<   NMEA string.*/
+}QL_LOC_NMEA_INFO_T;  /* Message */
+
+typedef enum
+{
+    E_QL_LOC_CAPABILITY_SCHEDULING      = 0x01, /**<  GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode.
+                                                         If this is not set, the framework uses \n 1000 ms for min_interval
+                                                         and will call start() and stop() to schedule the GPS. */
+    E_QL_LOC_CAPABILITY_MSB             = 0x02, /**<  GPS supports MS-Based AGPS mode.  */
+    E_QL_LOC_CAPABILITY_MSA             = 0x04, /**<  GPS supports MS-Assisted AGPS mode.  */
+    E_QL_LOC_CAPABILITY_SINGLE_SHOT     = 0x08, /**<  GPS supports single-shot fixes.  */
+    E_QL_LOC_CAPABILITY_ON_DEMAND_TIME  = 0x10, /**<  GPS supports on-demand time injection.  */
+}E_QL_LOC_CAPABILITIES_T;
+
+
+#define QL_LOC_GPS_SSID_BUF_SIZE    32          /**  Maximum SSID (Service Set Identifier) buffer size. */
+#define QL_LOC_IPV6_ADDR_LEN        16          /**  IPv6 address length. */
+typedef enum
+{
+    E_QL_LOC_AGPS_TYPE_INVALID          = -1,   /**<  Invalid.  */
+    E_QL_LOC_AGPS_TYPE_ANY              = 0,    /**<  Any.  */
+    E_QL_LOC_AGPS_TYPE_SUPL             = 1,    /**<  SUPL.  */
+    E_QL_LOC_AGPS_TYPE_C2K              = 2,    /**<  C2K.  */
+    E_QL_LOC_AGPS_TYPE_WWAN_ANY         = 3,    /**<  WWAN any.  */
+    E_QL_LOC_AGPS_TYPE_WIFI             = 4,    /**<  Wi-Fi.  */
+    E_QL_LOC_AGPS_TYPE_SUPL_ES          = 5,    /**<  SUPL_ES.  */
+}E_QL_LOC_AGPS_TYPE_T;
+
+typedef enum
+{
+    E_QL_LOC_REQUEST_AGPS_DATA_CONN     = 1,    /**<  GPS requests a data connection for AGPS.  */
+    E_QL_LOC_RELEASE_AGPS_DATA_CONN     = 2,    /**<  GPS releases the AGPS data connection.  */
+    E_QL_LOC_AGPS_DATA_CONNECTED        = 3,    /**<  AGPS data connection is initiated  */
+    E_QL_LOC_AGPS_DATA_CONN_DONE        = 4,    /**<  AGPS data connection is completed.  */
+    E_QL_LOC_AGPS_DATA_CONN_FAILED      = 5,    /**<  AGPS data connection failed.  */
+}E_QL_LOC_AGPS_STATUS_VALUE_T;
+
+typedef struct
+{
+    uint32_t                        size;       /**<   Set to the size of mcm_agps_status_t. */
+    E_QL_LOC_AGPS_TYPE_T            type;       /**<   Type. */
+    E_QL_LOC_AGPS_STATUS_VALUE_T    status;     /**<   Status. */
+    int                             ipv4_addr;  /**<   IPv4 address. */
+    char                            ipv6_addr[QL_LOC_IPV6_ADDR_LEN + 1];        /**<   IPv6 address. */
+    char                            ssid[QL_LOC_GPS_SSID_BUF_SIZE + 1];         /**<   SSID. */
+    char                            password[QL_LOC_GPS_SSID_BUF_SIZE + 1];     /**<   Password. */
+}QL_LOC_AGPS_STATUS_T;
+
+
+#define QL_LOC_NI_SHORT_STRING_MAXLEN   255     /**  NI short string maximum length. */
+#define QL_LOC_NI_LONG_STRING_MAXLEN    2047    /**  NI long string maximum length. */
+typedef enum
+{
+    E_QL_LOC_NI_TYPE_VOICE          = 1,        /**<  Voice.  */
+    E_QL_LOC_NI_TYPE_UMTS_SUPL      = 2,        /**<  UMTS SUPL.  */
+    E_QL_LOC_NI_TYPE_UMTS_CTRL_PLANE= 3,        /**<  UMTS control plane.  */
+}E_QL_LOC_NI_TYPE_T;
+
+typedef enum
+{
+    E_QL_LOC_NI_NEED_NOTIFY         = 0x0001,   /**<  NI requires notification.  */
+    E_QL_LOC_NI_NEED_VERIFY         = 0x0002,   /**<  NI requires verification.  */
+    E_QL_LOC_NI_PRIVACY_OVERRIDE    = 0x0004,   /**<  NI requires privacy override; no notification/minimal trace.  */
+}E_QL_LOC_NI_NOTIFY_FLAGS_T;
+
+typedef enum
+{
+    E_QL_LOC_NI_RESPONSE_ACCEPT     = 1,        /**<  Accept.  */
+    E_QL_LOC_NI_RESPONSE_DENY       = 2,        /**<  Deny.  */
+    E_QL_LOC_NI_RESPONSE_NORESP     = 3,        /**<  No response.  */
+}E_QL_LOC_NI_USER_RESPONSE_TYPE_T;
+
+typedef enum
+{
+    E_QL_LOC_NI_ENC_NONE            = 0,        /**<  None.  */
+    E_QL_LOC_NI_ENC_SUPL_GSM_DEFAULT= 1,        /**<  SUPL GSM default.  */
+    E_QL_LOC_NI_ENC_SUPL_UTF8       = 2,        /**<  SUPL UTF8.  */
+    E_QL_LOC_NI_ENC_SUPL_UCS2       = 3,        /**<  SUPL UCS2.  */
+    E_QL_LOC_NI_ENC_UNKNOWN         = -1,       /**<  Unknown.  */
+}E_QL_LOC_NI_ENC_TYPE_T;
+
+typedef struct
+{
+    uint32_t                            size;               /**<   Set to the size of mcm_gps_ni_notification_t. */
+    int                                 notification_id;    /**<   An ID generated by the HAL to associate NI notifications and UI responses.  */
+    E_QL_LOC_NI_TYPE_T                  ni_type;            /**<   An NI type used to distinguish different categories of NI events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, etc.  */
+    E_QL_LOC_NI_NOTIFY_FLAGS_T          notify_flags;       /**<   Notification/verification options; combinations of GpsNiNotifyFlags constants.  */
+    int                                 timeout;            /**<   Timeout period to wait for a user response. Set to 0 for no timeout limit.  */
+    E_QL_LOC_NI_USER_RESPONSE_TYPE_T    default_response;   /**<   Default response when the response times out.  */
+    char                                requestor_id[QL_LOC_NI_SHORT_STRING_MAXLEN + 1];    /**<   Requestor ID.  */
+    char                                text[QL_LOC_NI_LONG_STRING_MAXLEN + 1];             /**<   Notification message. It can also be used to store the client ID in some cases.  */
+    E_QL_LOC_NI_ENC_TYPE_T              requestor_id_encoding;                              /**<   Client ID encoding scheme.  */
+    E_QL_LOC_NI_ENC_TYPE_T              text_encoding;                                      /**<   Client name encoding scheme.  */
+    char                                extras[QL_LOC_NI_LONG_STRING_MAXLEN + 1];           /**<   Pointer to extra data. Format:\n- key_1 = value_1, - key_2 = value_2 @tablebulletend */
+}QL_LOC_NI_NOTIFICATION_INTO_T;
+
+#define     QL_LOC_MAX_SEVER_ADDR_LENGTH    255 /**  Maximum generic server address length for the host name. */
+typedef struct
+{/** Indication Message; Indication with the reported XTRA server URLs. */
+    char server1[QL_LOC_MAX_SEVER_ADDR_LENGTH + 1];  /**<   server1.*/
+    char server2[QL_LOC_MAX_SEVER_ADDR_LENGTH + 1];  /**<   server2.*/
+    char server3[QL_LOC_MAX_SEVER_ADDR_LENGTH + 1];  /**<   server3.*/
+}QL_LOC_XTRA_REPORT_SERVER_INTO_T;
+
+typedef enum
+{
+    E_QL_LOC_NFY_MSG_ID_STATUS_INFO = 0,        /**<  pv_data = &E_QL_LOC_STATUS_VALUE_T  */
+    E_QL_LOC_NFY_MSG_ID_LOCATION_INFO,          /**<  pv_data = &QL_LOC_LOCATION_INFO_T  */
+    E_QL_LOC_NFY_MSG_ID_SV_INFO,                /**<  pv_data = &QL_LOC_SV_STATUS_T  */
+    E_QL_LOC_NFY_MSG_ID_NMEA_INFO,              /**<  pv_data = &QL_LOC_NMEA_INFO_T  */
+    E_QL_LOC_NFY_MSG_ID_CAPABILITIES_INFO,      /**<  pv_data = &E_QL_LOC_CAPABILITIES_T  */
+    E_QL_LOC_NFY_MSG_ID_AGPS_STATUS,            /**<  pv_data = &QL_LOC_AGPS_STATUS_T  */
+    E_QL_LOC_NFY_MSG_ID_NI_NOTIFICATION,        /**<  pv_data = &QL_LOC_NI_NOTIFICATION_INTO_T  */
+    E_QL_LOC_NFY_MSG_ID_XTRA_REPORT_SERVER,     /**<  pv_data = &QL_LOC_XTRA_REPORT_SERVER_INTO_T  */
+}E_QL_LOC_NFY_MSG_ID_T;
+
+/* callback function register to QL_LOC_AddRxIndMsgHandler
+   e_msg_id: which kind of msg can be received depend on the bit_mask set in QL_LOC_Set_Indications;
+   pv_data: depend on the e_msg_id type.
+*/
+typedef void (*QL_LOC_RxIndMsgHandlerFunc_t)
+(
+    loc_client_handle_type  h_loc,
+    E_QL_LOC_NFY_MSG_ID_T   e_msg_id,
+    void                    *pv_data,
+    void                    *contextPtr
+);
+
+typedef enum
+{
+    E_QL_LOC_DELETE_EPHEMERIS       = (1 <<  0),    /**<  Delete ephemeris data.  */
+    E_QL_LOC_DELETE_ALMANAC         = (1 <<  1),    /**<  Delete almanac data.  */
+    E_QL_LOC_DELETE_POSITION        = (1 <<  2),    /**<  Delete position data.  */
+    E_QL_LOC_DELETE_TIME            = (1 <<  3),    /**<  Delete time data.  */
+    E_QL_LOC_DELETE_IONO            = (1 <<  4),    /**<  Delete IONO data.  */
+    E_QL_LOC_DELETE_UTC             = (1 <<  5),    /**<  Delete UTC data.  */
+    E_QL_LOC_DELETE_HEALTH          = (1 <<  6),    /**<  Delete health data.  */
+    E_QL_LOC_DELETE_SVDIR           = (1 <<  7),    /**<  Delete SVDIR data.  */
+    E_QL_LOC_DELETE_SVSTEER         = (1 <<  8),    /**<  Delete SVSTEER data.  */
+    E_QL_LOC_DELETE_SADATA          = (1 <<  9),    /**<  Delete SA data.  */
+    E_QL_LOC_DELETE_RTI             = (1 << 10),    /**<  Delete RTI data.  */
+    E_QL_LOC_DELETE_CELLDB_INFO     = (1 << 11),    /**<  Delete cell DB information.  */
+    E_QL_LOC_DELETE_ALMANAC_CORR    = (1 << 12),    /**<  Delete almanac correction data.  */
+    E_QL_LOC_DELETE_FREQ_BIAS_EST   = (1 << 13),    /**<  Delete frequency bias estimate.  */
+    E_QL_LOC_DELETE_EPHEMERIS_GLO   = (1 << 14),    /**<  Delete ephemeris GLO data.  */
+    E_QL_LOC_DELETE_ALMANAC_GLO     = (1 << 15),    /**<  Delete almanac GLO data.  */
+    E_QL_LOC_DELETE_SVDIR_GLO       = (1 << 16),    /**<  Delete SVDIR GLO data.  */
+    E_QL_LOC_DELETE_SVSTEER_GLO     = (1 << 17),    /**<  Delete SVSTEER GLO data.  */
+    E_QL_LOC_DELETE_ALMANAC_CORR_GLO= (1 << 18),    /**<  Delete almanac correction GLO data.  */
+    E_QL_LOC_DELETE_TIME_GPS        = (1 << 19),    /**<  Delete time GPS data.  */
+    E_QL_LOC_DELETE_TIME_GLO        = (1 << 20),    /**<  Delete time GLO data.  */
+    E_QL_LOC_DELETE_ALL             = 0xFFFFFFFF,   /**<  Delete all location data.  */
+}E_QL_LOC_DELETE_AIDING_DATA_TYPE_T;
+
+typedef struct
+{
+    int64_t time;               /**<   Inject time.*/
+    int64_t time_reference;     /**<   Time reference.*/
+    int32_t uncertainty;        /**<   Uncertainty.*/
+}QL_LOC_INJECT_TIME_INTO_T;  /* Message */
+
+typedef struct
+{
+    double  latitude;   /**<   Latitude.*/
+    double  longitude;  /**<   Longitude.*/
+    float   accuracy;   /**<   Accuracy.*/
+}QL_LOC_INJECT_LOCATION_INTO_T;
+
+typedef enum
+{
+    E_QL_LOC_AGPS_APN_BEARER_INVALID= -1,   /**<  Invalid.  */
+    E_QL_LOC_AGPS_APN_BEARER_IPV4   = 0,    /**<  IPv4.  */
+    E_QL_LOC_AGPS_APN_BEARER_IPV6   = 1,    /**<  IPv6.  */
+    E_QL_LOC_AGPS_APN_BEARER_IPV4V6 = 2,    /**<  IPv4/v6.  */
+}E_QL_LOC_AGPS_APN_BEARER_TYPE_T;
+
+#define QL_LOC_APN_NAME_LENGTH_MAX 100
+typedef struct
+{
+    E_QL_LOC_AGPS_TYPE_T                e_agps_type;                        /**<   AGPS type.*/
+    char                                apn[QL_LOC_APN_NAME_LENGTH_MAX + 1];/**<   APN.*/
+    E_QL_LOC_AGPS_APN_BEARER_TYPE_T     e_bearer_type;                      /**<   Bearer type.*/
+}QL_LOC_AGPS_DATA_CONN_OPEN_INTO_T;
+
+#define QL_LOC_SEVER_ADDR_LENGTH_MAX    255
+typedef struct
+{
+    E_QL_LOC_AGPS_TYPE_T    e_agps_type;                                /**<   AGPS type.*/
+    char                    host_name[QL_LOC_SEVER_ADDR_LENGTH_MAX + 1];/**<   Host name.*/
+    uint32_t                port;                                       /**<   Port.*/
+}QL_LOC_AGPS_SERVER_INTO_T;
+
+typedef struct
+{
+    int32_t                             notify_id;  /**<   Notification ID.*/
+    E_QL_LOC_NI_USER_RESPONSE_TYPE_T    user_resp;  /**<   User response.*/
+}QL_LOC_NI_RESPONSE_INTO_T;
+
+
+
+/* Add callback function if anything changed specified by the mask in QL_LOC_Set_Indications*/
+int QL_LOC_AddRxIndMsgHandler(QL_LOC_RxIndMsgHandlerFunc_t handlerPtr, void* contextPtr);
+
+/* Set what we want callbacks for, for the detail mean of bit_mask, please refer to the macro of LOC_IND_xxxxx_INFO_ON */
+int QL_LOC_Set_Indications(loc_client_handle_type h_loc, int bit_mask);
+
+/* Set GPS position mode, detail info please refer to QL_LOC_POS_MODE_INFO_T */
+int QL_LOC_Set_Position_Mode(loc_client_handle_type h_loc, QL_LOC_POS_MODE_INFO_T *pt_mode);
+
+/* Start navigation, same as AT+QGPS=1, NMEA port start outputing nmea data */
+int QL_LOC_Start_Navigation(loc_client_handle_type h_loc);
+
+/* Stop navigation, same as AT+QGPSEND,  NMEA port stop outputing nmea data */
+int QL_LOC_Stop_Navigation(loc_client_handle_type h_loc);
+
+/* Set up GPS connection and start getting coordinates , this api will call QL_LOC_Start_Navigation inside first,
+   then wait for LOC_IND_LOCATION_INFO_ON event happen, if timeout, it will use last time stored loc_info.
+   If got this event, location infor will save to pt_loc_info and call QL_LOC_Stop_Navigation stop and exit. */
+int QL_LOC_Get_Current_Location(loc_client_handle_type h_loc, QL_LOC_LOCATION_INFO_T *pt_loc_info, int timeout_sec);
+
+/* Init LOC module and return the h_loc, this should be called before any other QL_LOC_xxx api. */
+int QL_LOC_Client_Init(loc_client_handle_type  *ph_loc);
+
+/* DeInit LOC module and release resource, this should be called at last. */
+int QL_LOC_Client_Deinit(loc_client_handle_type h_loc);
+
+/* Deletes location-aiding data. */
+int QL_LOC_Delete_Aiding_Data(  loc_client_handle_type              h_loc,
+                                E_QL_LOC_DELETE_AIDING_DATA_TYPE_T  flags);
+
+/* Injects time. */
+int QL_LOC_InjectTime(  loc_client_handle_type      h_loc,
+                        QL_LOC_INJECT_TIME_INTO_T   *pt_info);
+
+/* Injects Location. */
+int QL_LOC_InjectLocation( loc_client_handle_type           h_loc,
+                           QL_LOC_INJECT_LOCATION_INTO_T    *pt_info);
+
+/** Injects XTRA data.
+    Since the IPC mechanism puts a limit on the size of the data transferable in one message at 64 KB,
+    the application using this command must break the data down into chunks of a smaller size and repeatedly
+    call this API until all the data has been injected. */
+int QL_LOC_Xtra_InjectData(loc_client_handle_type h_loc,
+                            char                   *data,
+                            int                    length); // QL_LOC_XTRA_FILE_DATA_SIZE_MAX
+
+#define QL_LOC_XTRA_FILE_DATA_SIZE_MAX     0xFC00
+/* Injects xtra data via file name. */
+int QL_LOC_Xtra_InjectFile( loc_client_handle_type  h_loc,
+                            char                    *filename);
+
+/** Indicates that the AGPS data connection is open. */
+int QL_LOC_Agps_DataConnOpen( loc_client_handle_type            h_loc,
+                              QL_LOC_AGPS_DATA_CONN_OPEN_INTO_T *pt_info);
+
+/** Indicates that the AGPS data connection is closed. */
+int QL_LOC_Agps_DataConnClose(loc_client_handle_type    h_loc,
+                              E_QL_LOC_AGPS_TYPE_T      atype);
+
+/** Indicates that the AGPS data connection failed to start. */
+int QL_LOC_Agps_NfyDataConnFailed(loc_client_handle_type   h_loc,
+                                  E_QL_LOC_AGPS_TYPE_T     atype);
+
+/** Set AGPS server infor. */
+int QL_LOC_Agps_SetServer(loc_client_handle_type        h_loc,
+                          QL_LOC_AGPS_SERVER_INTO_T     *pt_info);
+
+/** Sends a user response for NI. */
+int QL_LOC_NI_SetResponse(loc_client_handle_type        h_loc,
+                          QL_LOC_NI_RESPONSE_INTO_T     *pt_info);
+
+/** Updates the network availability status. */
+int QL_LOC_Agps_UpdateNWAvailability(loc_client_handle_type  h_loc,
+                                     int                     available,
+                                     const char             *apn);
+
+/*
+Usage 1 (Normally use):
+1, QL_LOC_Client_Init
+2, QL_LOC_AddRxIndMsgHandler(pf_cb)
+3, QL_LOC_Set_Indications
+4, QL_LOC_Start_Navigation
+5, handle the events in pf_cb
+6, QL_LOC_Stop_Navigation
+7, QL_LOC_Client_Deinit
+
+
+Usage 2 (Just get position once):
+1, QL_LOC_Client_Init
+2, QL_LOC_AddRxIndMsgHandler(pf_cb) ---- This can be omitted!
+3, QL_LOC_Set_Indications, set bit_mask=LOC_IND_LOCATION_INFO_ON
+4, QL_LOC_Get_Current_Location, if not timeout, it will return current position infor or use last stored one.
+7, QL_LOC_Client_Deinit
+*/
+
+#endif // __QL_MCM_GPS_H__
+
diff --git a/mbtk/include/ql/ql_mcm_nw.h b/mbtk/include/ql/ql_mcm_nw.h
new file mode 100755
index 0000000..3ec6d62
--- /dev/null
+++ b/mbtk/include/ql/ql_mcm_nw.h
@@ -0,0 +1,467 @@
+/**
+ *@file     ql_mcm_nw.h
+ *@date     2018-02-22
+ *@author
+ *@brief
+ */
+#ifndef __QL_MCM_NW_H__
+#define __QL_MCM_NW_H__
+#include "ql_mcm.h"
+#include "mbtk_type.h"
+
+typedef uint32 nw_client_handle_type;
+
+
+#define QL_MCM_NW_MODE_NONE     0x00    /**<  No network. */
+#define QL_MCM_NW_MODE_GSM      0x01    /**<  Include GSM networks. */
+#define QL_MCM_NW_MODE_WCDMA    0x02    /**<  Include WCDMA networks. */
+#define QL_MCM_NW_MODE_CDMA     0x04    /**<  Include CDMA networks. */
+#define QL_MCM_NW_MODE_EVDO     0x08    /**<  Include EVDO networks. */
+#define QL_MCM_NW_MODE_LTE      0x10    /**<  Include LTE networks. */
+#define QL_MCM_NW_MODE_TDSCDMA  0x20    /**<  Include TDSCDMA networks. */
+#define QL_MCM_NW_MODE_PRL      0x10000 /**<  Give preference according to the preferred roaming list. */
+
+typedef enum
+{
+    E_QL_MCM_NW_ROAM_STATE_OFF  = 0,    /**<  None, or roaming indicator off. */
+    E_QL_MCM_NW_ROAM_STATE_ON   = 1     /**<  Roaming indicator on. */
+}E_QL_MCM_NW_ROAM_STATE_TYPE_T;
+
+/** Configures the settings that define the MCM network interface. */
+typedef struct
+{
+    /*  Configuration parameters for MCM network registration Network registration details Technology dependent network registration details */
+    uint64_t                        preferred_nw_mode;  /**<   Preferred network mode for connections; a bitmask of QL_MCM_NW_MODE_xxxx.*/
+    E_QL_MCM_NW_ROAM_STATE_TYPE_T   roaming_pref;       /**<   Roaming preference.*/
+}QL_MCM_NW_CONFIG_INFO_T;
+
+#define QL_MCM_NW_NITZ_BUF_LEN 30
+/** Get NITZ Time information. */
+typedef struct
+{
+    //i.e.:  nitz_time="18/09/19,07:40:18+32,00"    format: YY/MM/DD,HH:MM:SS'+/-'TZ,daylight, Here TZ multiplied by 4.
+    char        nitz_time[QL_MCM_NW_NITZ_BUF_LEN + 1];
+    uint64_t    abs_time;   // 0 means invalid
+    int8_t      leap_sec;   // 0 means invalid
+}QL_MCM_NW_NITZ_TIME_INFO_T;
+
+
+//defined for QL_MCM_NW_EventRegister
+#define     NW_IND_VOICE_REG_EVENT_IND_FLAG               (1 << 0)    /**< msg format : QL_MCM_NW_VOICE_REG_EVENT_IND_T */
+#define     NW_IND_DATA_REG_EVENT_IND_FLAG                (1 << 1)    /**< msg format : QL_MCM_NW_DATA_REG_EVENT_IND_T */
+#define     NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG         (1 << 2)    /**< msg format : QL_MCM_NW_SINGNAL_EVENT_IND_T */
+#define     NW_IND_CELL_ACCESS_STATE_CHG_EVENT_IND_FLAG   (1 << 3)    /**< msg format : QL_MCM_NW_CELL_ACCESS_STATE_EVENT_IND_T */
+#define     NW_IND_NITZ_TIME_UPDATE_EVENT_IND_FLAG        (1 << 4)    /**< msg format : QL_MCM_NW_NITZ_TIME_EVENT_IND_T */
+
+
+
+typedef struct
+{
+    char long_eons[512 + 1];    /**<   Long EONS.*/
+    char short_eons[512 + 1];   /**<   Short EONS.*/
+    char mcc[3 + 1];            /**<   Mobile country code.*/
+    char mnc[3 + 1];            /**<   Mobile network code.*/
+}QL_MCM_NW_OPERATOR_NAME_INFO_T;
+
+typedef enum
+{
+    E_QL_MCM_NW_NETWORK_STATUS_NONE             = 0,    /**<  Network status not available. */
+    E_QL_MCM_NW_NETWORK_STATUS_CURRENT_SERVING  = 1,    /**<  Current serving network. */
+    E_QL_MCM_NW_NETWORK_STATUS_PREFERRED        = 2,    /**<  Preferred network. */
+    E_QL_MCM_NW_NETWORK_STATUS_NOT_PREFERRED    = 3,    /**<  Not the preferred network. */
+    E_QL_MCM_NW_NETWORK_STATUS_AVAILABLE        = 4,    /**<  Service available. */
+    E_QL_MCM_NW_NETWORK_STATUS_FORBIDDEN        = 5     /**<  Forbidden service. */
+}E_QL_MCM_NW_NETWORK_STATUS_TYPE_T;
+
+typedef enum
+{
+    E_QL_MCM_NW_RADIO_TECH_TD_SCDMA = 1,
+    E_QL_MCM_NW_RADIO_TECH_GSM      = 2,    /**<  GSM; only supports voice. */
+    E_QL_MCM_NW_RADIO_TECH_HSPAP    = 3,    /**<  HSPA+. */
+    E_QL_MCM_NW_RADIO_TECH_LTE      = 4,    /**<  LTE. */
+    E_QL_MCM_NW_RADIO_TECH_EHRPD    = 5,    /**<  EHRPD. */
+    E_QL_MCM_NW_RADIO_TECH_EVDO_B   = 6,    /**<  EVDO B. */
+    E_QL_MCM_NW_RADIO_TECH_HSPA     = 7,    /**<  HSPA. */
+    E_QL_MCM_NW_RADIO_TECH_HSUPA    = 8,    /**<  HSUPA. */
+    E_QL_MCM_NW_RADIO_TECH_HSDPA    = 9,    /**<  HSDPA. */
+    E_QL_MCM_NW_RADIO_TECH_EVDO_A   = 10,   /**<  EVDO A. */
+    E_QL_MCM_NW_RADIO_TECH_EVDO_0   = 11,   /**<  EVDO 0. */
+    E_QL_MCM_NW_RADIO_TECH_1xRTT    = 12,   /**<  1xRTT. */
+    E_QL_MCM_NW_RADIO_TECH_IS95B    = 13,   /**<  IS95B. */
+    E_QL_MCM_NW_RADIO_TECH_IS95A    = 14,   /**<  IS95A. */
+    E_QL_MCM_NW_RADIO_TECH_UMTS     = 15,   /**<  UMTS. */
+    E_QL_MCM_NW_RADIO_TECH_EDGE     = 16,   /**<  EDGE. */
+    E_QL_MCM_NW_RADIO_TECH_GPRS     = 17,   /**<  GPRS. */
+    E_QL_MCM_NW_RADIO_TECH_NONE     = 18    /**<  No technology selected. */
+}E_QL_MCM_NW_RADIO_TECH_TYPE_T;
+
+typedef struct
+{
+    QL_MCM_NW_OPERATOR_NAME_INFO_T      operator_name;    /**<   Operator name.*/
+    E_QL_MCM_NW_NETWORK_STATUS_TYPE_T   network_status;    /**<   Network status.*/
+    E_QL_MCM_NW_RADIO_TECH_TYPE_T       rat;    /**<   Radio technology.*/
+}QL_MCM_NW_SCAN_ENTRY_INFO_T;  /* Type */
+
+#define QL_MCM_NW_SCAN_LIST_MAX 40
+/** Gets the status associated with the connection of \<id\>. */
+typedef struct
+{
+    uint32_t                    entry_len;  /**< Must be set to the number of elements in entry. */
+    QL_MCM_NW_SCAN_ENTRY_INFO_T entry[QL_MCM_NW_SCAN_LIST_MAX];    /**<   Scan entry.*/
+}QL_MCM_NW_SCAN_RESULT_LIST_INFO_T;  /* Message */
+
+
+typedef enum
+{
+    E_QL_MCM_NW_TECH_DOMAIN_NONE    = 0,    /**<  None. */
+    E_QL_MCM_NW_TECH_DOMAIN_3GPP    = 1,    /**<  3GPP. */
+    E_QL_MCM_NW_TECH_DOMAIN_3GPP2   = 2,    /**<  3GPP2. */
+}E_QL_MCM_NW_TECH_DOMAIN_TYPE_T;
+
+typedef enum
+{
+    E_QL_MCM_NW_IMSI_UNKNOWN_HLR_DENY_REASON                    = 1, /**<  IMSI unknown in HLR. */
+    E_QL_MCM_NW_ILLEGAL_MS_DENY_REASON                          = 2, /**<  Illegal MS. */
+    E_QL_MCM_NW_IMSI_UNKNOWN_VLR_DENY_REASON                    = 3, /**<  IMSI unknown in VLR. */
+    E_QL_MCM_NW_IMEI_NOT_ACCEPTED_DENY_REASON                   = 4, /**<  IMEI not accepted. */
+    E_QL_MCM_NW_ILLEGAL_ME_DENY_REASON                          = 5, /**<  Illegal ME. */
+    E_QL_MCM_NW_PLMN_NOT_ALLOWED_DENY_REASON                    = 6, /**<  PLMN not allowed. */
+    E_QL_MCM_NW_LA_NOT_ALLOWED_DENY_REASON                      = 7, /**<  Location area not allowed. */
+    E_QL_MCM_NW_ROAMING_NOT_ALLOWED_LA_DENY_REASON              = 8, /**<  Roaming not allowed in this location area. */
+    E_QL_MCM_NW_NO_SUITABLE_CELLS_LA_DENY_REASON                = 9, /**<  No suitable cells in location area. */
+    E_QL_MCM_NW_NETWORK_FAILURE_DENY_REASON                     = 10, /**<  Network failure. */
+    E_QL_MCM_NW_MAC_FAILURE_DENY_REASON                         = 11, /**<  MAC failure. */
+    E_QL_MCM_NW_SYNCH_FAILURE_DENY_REASON                       = 12, /**<  Sync failure. */
+    E_QL_MCM_NW_CONGESTION_DENY_REASON                          = 13, /**<  Congestion. */
+    E_QL_MCM_NW_GSM_AUTHENTICATION_UNACCEPTABLE_DENY_REASON     = 14, /**<  GSM authentication unacceptable. */
+    E_QL_MCM_NW_NOT_AUTHORIZED_CSG_DENY_REASON                  = 15, /**<  Not authorized in this CSG. */
+    E_QL_MCM_NW_SERVICE_OPTION_NOT_SUPPORTED_DENY_REASON        = 16, /**<  Service option not supported. */
+    E_QL_MCM_NW_REQ_SERVICE_OPTION_NOT_SUBSCRIBED_DENY_REASON   = 17, /**<  Requested service option not subscribed. */
+    E_QL_MCM_NW_CALL_CANNOT_BE_IDENTIFIED_DENY_REASON           = 18, /**<  Call cannot be identified. */
+    E_QL_MCM_NW_SEMANTICALLY_INCORRECT_MSG_DENY_REASON          = 19, /**<  Semantically incorrect message. */
+    E_QL_MCM_NW_INVALID_MANDATORY_INFO_DENY_REASON              = 20, /**<  Invalid mandatory information. */
+    E_QL_MCM_NW_MSG_TYPE_NON_EXISTENT_DENY_REASON               = 21, /**<  Message type non-existent or not implemented. */
+    E_QL_MCM_NW_INFO_ELEMENT_NON_EXISTENT_DENY_REASON           = 22, /**<  Message type not compatible with the protocol state. */
+    E_QL_MCM_NW_CONDITIONAL_IE_ERR_DENY_REASON                  = 23, /**<  Conditional IE error. */
+    E_QL_MCM_NW_MSG_INCOMPATIBLE_PROTOCOL_STATE_DENY_REASON     = 24, /**<  Message not compatible with the protocol state. */
+    E_QL_MCM_NW_PROTOCOL_ERROR_DENY_REASON                      = 25, /**<  Unspecified protocol error. */
+}E_QL_MCM_NW_DENY_REASON_TYPE_T;
+
+
+typedef enum
+{
+    E_QL_MCM_NW_SERVICE_NONE     = 0x0000,  /**<  Not registered or no data. */
+    E_QL_MCM_NW_SERVICE_LIMITED  = 0x0001,  /**<  Registered; emergency service only. */
+    E_QL_MCM_NW_SERVICE_FULL     = 0x0002,  /**<  Registered, full service. */
+}E_QL_MCM_NW_SERVICE_TYPE_T;
+
+typedef struct
+{
+    E_QL_MCM_NW_TECH_DOMAIN_TYPE_T  tech_domain;        /**<   Technology, used to determine the structure type  mcm_tech: 0 -- None, 1 -- 3GPP, 2 -- 3GPP2.*/
+    E_QL_MCM_NW_RADIO_TECH_TYPE_T   radio_tech;         /**<   Radio technology; see #mcm_nw_radio_tech_t_v01.*/
+    E_QL_MCM_NW_ROAM_STATE_TYPE_T   roaming;            /**<   0 -- Off, 1 -- Roaming (3GPP2 has extended values).*/
+    E_QL_MCM_NW_DENY_REASON_TYPE_T  deny_reason;        /**<   Set when registration state is #mcm_nw_deny_reason_t_v01.*/
+    E_QL_MCM_NW_SERVICE_TYPE_T      registration_state; /**<   Registration state.*/
+}QL_MCM_NW_COMMON_REG_INFO_T;
+
+
+typedef struct
+{
+    E_QL_MCM_NW_TECH_DOMAIN_TYPE_T  tech_domain;        /**<   Technology, used to determine the structure type  mcm_tech: 0 -- None, 1 -- 3GPP, 2 -- 3GPP2.*/
+    E_QL_MCM_NW_RADIO_TECH_TYPE_T   radio_tech;         /**<   Radio technology; see #mcm_nw_radio_tech_t_v01.*/
+    char                            mcc[3+1];           /**<   Mobile country code.*/
+    char                            mnc[3+1];           /**<   Mobile network code.*/
+    E_QL_MCM_NW_ROAM_STATE_TYPE_T   roaming;            /**<   0 -- Off, 1 -- Roaming (3GPP2 has extended values).*/
+    uint8_t                         forbidden;          /**<   Forbidden: 0 -- No, 1 -- Yes.*/
+    uint32_t                        cid;                /**<   Cell ID for the registered 3GPP system.*/
+    uint16_t                        lac;                /**<   Locatin area code for the registered 3GPP system.*/
+    uint16_t                        psc;                /**<   Primary scrambling code (WCDMA only); 0 -- None.*/
+    uint16_t                        tac;                /**<   Tracking area code information for LTE.*/
+}QL_MCM_NW_3GPP_REG_INFO_T;
+
+
+typedef struct
+{
+    E_QL_MCM_NW_TECH_DOMAIN_TYPE_T  tech_domain;        /**<   Technology, used to determine structure type  mcm_tech: 0 -- None, 1 -- 3GPP, 2 -- 3GPP2.*/
+    E_QL_MCM_NW_RADIO_TECH_TYPE_T   radio_tech;         /**<   Radio technology; see #mcm_nw_radio_tech_t_v01.*/
+    char                            mcc[3+1];           /**<   Mobile country code.*/
+    char                            mnc[3+1];           /**<   Mobile network code.*/
+    E_QL_MCM_NW_ROAM_STATE_TYPE_T   roaming;            /**<   Roaming status; see #mcm_nw_roam_state_t_v01.*/
+    uint8_t                         forbidden;          /**<   Forbidden: 0 -- No, 1 -- Yes.*/
+    uint8_t                         inPRL;              /**<   0 -- Not in PRL, 1 -- In PRL.*/
+    uint8_t                         css;                /**<   Concurrent services supported: 0 -- No, 1 -- Yes.*/
+    uint16_t                        sid;                /**<   CDMA system ID.*/
+    uint16_t                        nid;                /**<   CDMA network ID.*/
+    uint16_t                        bsid;               /**<   Base station ID. @newpagetable */
+}QL_MCM_NW_3GPP2_REG_INFO_T;
+
+/** Gets the status associated with the connection of \<id\>. */
+typedef struct
+{
+    uint8_t                         voice_registration_valid;               /**< Must be set to TRUE if voice_registration is being passed. */
+    QL_MCM_NW_COMMON_REG_INFO_T     voice_registration;                     /**<   Voice registration. */
+
+    uint8_t                         data_registration_valid;                /**< Must be set to TRUE if data_registration is being passed. */
+    QL_MCM_NW_COMMON_REG_INFO_T     data_registration;                      /**<   Data registration. */
+
+    uint8_t                         voice_registration_details_3gpp_valid;  /**< Must be set to TRUE if voice_registration_details_3gpp is being passed. */
+    QL_MCM_NW_3GPP_REG_INFO_T       voice_registration_details_3gpp;        /**<   Voice registration details for 3GPP. */
+
+    uint8_t                         data_registration_details_3gpp_valid;   /**< Must be set to TRUE if data_registration_details_3gpp is being passed. */
+    QL_MCM_NW_3GPP_REG_INFO_T       data_registration_details_3gpp;         /**<   Data registration details for 3GPP. */
+
+    uint8_t                         voice_registration_details_3gpp2_valid; /**< Must be set to TRUE if voice_registration_details_3gpp2 is being passed. */
+    QL_MCM_NW_3GPP2_REG_INFO_T      voice_registration_details_3gpp2;       /**<   Voice registration details for 3GPP2. */
+
+    uint8_t                         data_registration_details_3gpp2_valid;  /**< Must be set to TRUE if data_registration_details_3gpp2 is being passed. */
+    QL_MCM_NW_3GPP2_REG_INFO_T      data_registration_details_3gpp2;        /**<   Data registration details for 3GPP2. */
+}QL_MCM_NW_REG_STATUS_INFO_T;
+
+
+typedef enum
+{
+    E_QL_MCM_NW_SELECTION_AUTOMATIC  = 0,                                   /**<  Automatic network selection. */
+    E_QL_MCM_NW_SELECTION_MANUAL     = 1,                                   /**<  Manual network selection. */
+}E_QL_MCM_NW_SELECTION_TYPE_T;
+
+typedef struct
+{
+    E_QL_MCM_NW_SELECTION_TYPE_T    nw_selection_type;                      /**< Network selection type. */
+    char                            mcc[3 + 1];                             /**<   Mobile country code for a manual network selection.*/
+    char                            mnc[3 + 1];                             /**<   Mobile network code for a manual network selection.*/
+    E_QL_MCM_NW_RADIO_TECH_TYPE_T   rat;                                    /**<   Radio technology.*/
+}QL_MCM_NW_SELECTION_INFO_T;
+
+
+typedef struct
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates received signal strength. A signed value; -125 or lower indicates no signal.*/
+}QL_MCM_NW_GSM_SIGNAL_INFO_T;
+
+
+typedef struct
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates forward link pilot Ec. A signed value; -125 or lower indicates no signal.*/
+    int16_t     ecio;       /**<   Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/
+}QL_MCM_NW_WCDMA_SIGNAL_INFO_T;
+
+typedef struct
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates forward link pilot Ec.    a signed value; -125 or lower indicates no signal.*/
+    int8_t      rscp;       /**<   RSCP in dBm.*/
+    int16_t     ecio;       /**<   Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/
+    int8_t      sinr;       /**<   Measured SINR in dB. @newpagetable */
+}QL_MCM_NW_TDSCDMA_SIGNAL_INFO_T;
+
+typedef struct
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates forward link pilot Ec. A signed value; -125 or lower indicates no signal.*/
+    int8_t      rsrq;       /**<   RSRQ value in dB (signed integer value), as measured by L1. Range: -3 to -20 (-3 equals -3 dB, -20 equals -20 dB).*/
+    int16_t      rsrp;       /**<   Current RSRP in dBm, as measured by L1. Range: -44 to -140 (-44 equals -44 dBm, -140 equals -140 dBm).*/
+    int16_t      snr;        /**<   SNR level as a scaled integer in units of 0.1 dB; e.g., -16 dB has a value of -160 and 24.6 dB has a value of 246.*/
+}QL_MCM_NW_LTE_SIGNAL_INFO_T;
+
+
+typedef struct
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates forward link pilot Power (AGC) + Ec/Io. A signed value; -125 or lower indicates no signal.*/
+    int16_t     ecio;       /**<   Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/
+}QL_MCM_NW_CDMA_SIGNAL_INFO_T;
+
+typedef struct
+{
+    int8_t      rssi;       /**<   RSSI in dBm. Indicates forward link pilot Power (AGC) + Ec/Io. A signed value; -125 or lower indicates no signal.*/
+    int16_t     ecio;       /**<   Ec/Io value representing negative 0.5 dB increments, e.g., 2 equals -1 dbm.*/
+    int8_t      sinr;       /**<   SINR level.*/
+    int32_t     io;         /**<   Received IO in dBm. */
+}QL_MCM_NW_HDR_SIGNAL_INFO_T;
+
+/** Gets signal strength information. */
+typedef struct
+{
+    uint8_t                         gsm_sig_info_valid;         /**< Must be set to TRUE if gsm_sig_info is being passed. */
+    QL_MCM_NW_GSM_SIGNAL_INFO_T     gsm_sig_info;               /**<   GSM signal information. */
+    uint8_t                         wcdma_sig_info_valid;       /**< Must be set to TRUE if wcdma_sig_info is being passed. */
+    QL_MCM_NW_WCDMA_SIGNAL_INFO_T   wcdma_sig_info;             /**<   WCDMA signal information. */
+    uint8_t                         tdscdma_sig_info_valid;     /**< Must be set to TRUE if tdscdma_sig_info is being passed. */
+    QL_MCM_NW_TDSCDMA_SIGNAL_INFO_T tdscdma_sig_info;           /**<   TDSCDMA signal information. */
+    uint8_t                         lte_sig_info_valid;         /**< Must be set to TRUE if lte_sig_info is being passed. */
+    QL_MCM_NW_LTE_SIGNAL_INFO_T     lte_sig_info;               /**<   LTE signal information. */
+    uint8_t                         cdma_sig_info_valid;        /**< Must be set to TRUE if cdma_sig_info is being passed. */
+    QL_MCM_NW_CDMA_SIGNAL_INFO_T    cdma_sig_info;              /**<   CDMA signal information. */
+    uint8_t                         hdr_sig_info_valid;         /**< Must be set to TRUE if hdr_sig_info is being passed. */
+    QL_MCM_NW_HDR_SIGNAL_INFO_T     hdr_sig_info;               /**<   HDR signal information. */
+}QL_MCM_NW_SIGNAL_STRENGTH_INFO_T;
+
+
+
+typedef enum
+{
+    E_QL_MCM_NW_CELL_ACCESS_NONE            = 0x00,             /**<  Unknown cell access state. */
+    E_QL_MCM_NW_CELL_ACCESS_NORMAL_ONLY     = 0x01,             /**<  Cell access is allowed for normal calls only. */
+    E_QL_MCM_NW_CELL_ACCESS_EMERGENCY_ONLY  = 0x02,             /**<  Cell access is allowed for emergency calls only. */
+    E_QL_MCM_NW_CELL_ACCESS_NO_CALLS        = 0x03,             /**<  Cell access is not allowed for any call type. */
+    E_QL_MCM_NW_CELL_ACCESS_ALL_CALLS       = 0x04,             /**<  Cell access is allowed for all call types. */
+}E_QL_MCM_NW_CELL_ACCESS_STATE_TYPE_T;
+
+
+/* @bridef Callback function registered to QL_MCM_NW_AddRxMsgHandler
+ * map of ind_flag and ind_msg_buf as bellow :
+ *  NW_IND_VOICE_REG_EVENT_IND_FLAG : QL_MCM_NW_VOICE_REG_EVENT_IND_T
+ *  NW_IND_DATA_REG_EVENT_IND_FLAG : QL_MCM_NW_DATA_REG_EVENT_IND_T
+ *  NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG : QL_MCM_NW_SINGNAL_EVENT_IND_T
+ *  NW_IND_CELL_ACCESS_STATE_CHG_EVENT_IND_FLAG : QL_MCM_NW_CELL_ACCESS_STATE_EVENT_IND_T
+ *  NW_IND_NITZ_TIME_UPDATE_EVENT_IND_FLAG : QL_MCM_NW_NITZ_TIME_EVENT_IND_T
+ * */
+typedef void (*QL_MCM_NW_RxMsgHandlerFunc_t)(
+    nw_client_handle_type h_nw,
+    uint32_t ind_flag,
+    void                  *ind_msg_buf,
+    uint32_t              ind_msg_len,
+    void                  *contextPtr
+);
+
+
+/** Indication message; Indication for the corresponding registered event flag NW_IND_VOICE_REG_EVENT_IND_FLAG */
+typedef struct {
+
+  uint8_t                         registration_valid;               /**< Must be set to TRUE if voice_registration is being passed. */
+  QL_MCM_NW_COMMON_REG_INFO_T     registration;                     /**< Voice registration. */
+
+  uint8_t                         registration_details_3gpp_valid;  /**< Must be set to TRUE if voice_registration_details_3gpp is being passed. */
+  QL_MCM_NW_3GPP_REG_INFO_T       registration_details_3gpp;        /**< Voice registration details for 3GPP. */
+
+  uint8_t                         registration_details_3gpp2_valid; /**< Must be set to TRUE if voice_registration_details_3gpp2 is being passed. */
+  QL_MCM_NW_3GPP2_REG_INFO_T      registration_details_3gpp2;       /**< Voice registration details for 3GPP2. */
+}QL_MCM_NW_VOICE_REG_EVENT_IND_T;
+
+/** Indication message; Indication for the corresponding registered event flag NW_IND_DATA_REG_EVENT_IND_FLAG */
+typedef struct {
+
+  uint8_t                         registration_valid;               /**< Must be set to TRUE if data_registration is being passed. */
+  QL_MCM_NW_COMMON_REG_INFO_T     registration;                     /**< Data registration. */
+
+  uint8_t                         registration_details_3gpp_valid;  /**< Must be set to TRUE if data_registration_details_3gpp is being passed. */
+  QL_MCM_NW_3GPP_REG_INFO_T       registration_details_3gpp;        /**< Data registration details for 3GPP. */
+
+  uint8_t                         registration_details_3gpp2_valid; /**< Must be set to TRUE if data_registration_details_3gpp2 is being passed. */
+  QL_MCM_NW_3GPP2_REG_INFO_T      registration_details_3gpp2;       /**< Data registration details for 3GPP2. */
+}QL_MCM_NW_DATA_REG_EVENT_IND_T;
+
+
+/** Indication message; Indication for the corresponding registered event flag NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG */
+typedef struct {
+    uint8_t gsm_sig_info_valid;                       /**< Must be set to TRUE if gsm_sig_info is being passed. */
+    QL_MCM_NW_GSM_SIGNAL_INFO_T       gsm_sig_info;   /**< GSM singal information. */
+
+    uint8_t wcdma_sig_info_valid;                     /**< Must be set to TRUE if wcdma_sig_info is being passed. */
+    QL_MCM_NW_WCDMA_SIGNAL_INFO_T wcdma_sig_info;     /**< WCDMA singal information. */
+
+    uint8_t tdscdma_sig_info_valid;                   /**< Must be set to TRUE if tdscdma_sig_info is being passed. */
+    QL_MCM_NW_TDSCDMA_SIGNAL_INFO_T tdscdma_sig_info; /**< TDSCDMA singal information. */
+
+    uint8_t lte_sig_info_valid;                       /**< Must be set to TRUE if lte_sig_info is being passed. */
+    QL_MCM_NW_LTE_SIGNAL_INFO_T lte_sig_info;         /**< LTE singal information. */
+
+    uint8_t cdma_sig_info_valid;                      /**< Must be set to TRUE if cdma_sig_info is being passed. */
+    QL_MCM_NW_CDMA_SIGNAL_INFO_T cdma_sig_info;       /**< CDMA singal information. */
+
+    uint8_t hdr_sig_info_valid;                       /**< Must be set to TRUE if hdr_sig_info is being passed. */
+    QL_MCM_NW_HDR_SIGNAL_INFO_T hdr_sig_info;         /**< HDR singal information. */
+}QL_MCM_NW_SINGNAL_EVENT_IND_T;
+
+
+/** Indication message; Indication for a change in the cell access state, e.g., emergency only, CS call only.
+ * Indication for the corresponding registered event flag NW_IND_CELL_ACCESS_STATE_CHG_EVENT_IND_FLAG */
+typedef struct {
+    E_QL_MCM_NW_CELL_ACCESS_STATE_TYPE_T state; /**< Network cell access state. */
+}QL_MCM_NW_CELL_ACCESS_STATE_EVENT_IND_T;
+
+/** Indication Message; Indication to update NITZ time.
+ * Indication for the corresponding registered event flag NW_IND_NITZ_TIME_UPDATE_EVENT_IND_FLAG */
+typedef struct {
+    QL_MCM_NW_NITZ_TIME_INFO_T info;
+}QL_MCM_NW_NITZ_TIME_EVENT_IND_T;
+
+
+
+
+E_QL_ERROR_CODE_T QL_MCM_NW_Client_Init(nw_client_handle_type  *ph_nw);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_Client_Deinit(nw_client_handle_type  h_nw);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_SetConfig
+(
+    nw_client_handle_type       h_nw,
+    QL_MCM_NW_CONFIG_INFO_T     *pt_info
+);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_GetConfig
+(
+    nw_client_handle_type       h_nw,
+    QL_MCM_NW_CONFIG_INFO_T     *pt_info
+);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_GetNitzTimeInfo
+(
+    nw_client_handle_type       h_nw,
+    QL_MCM_NW_NITZ_TIME_INFO_T *pt_info
+);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_EventRegister
+(
+    nw_client_handle_type       h_nw,
+    uint32_t                    bitmask // bit OR of NW_IND_xxxx_EVENT_ON
+);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_GetOperatorName
+(
+    nw_client_handle_type           h_nw,
+    QL_MCM_NW_OPERATOR_NAME_INFO_T  *pt_info //You should malloc this or may cause stack overflow
+);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_PerformScan
+(
+    nw_client_handle_type               h_nw,
+    QL_MCM_NW_SCAN_RESULT_LIST_INFO_T   *pt_info
+);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_GetRegStatus
+(
+    nw_client_handle_type               h_nw,
+    QL_MCM_NW_REG_STATUS_INFO_T         *pt_info
+);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_SetLowPowerMode
+(
+    nw_client_handle_type       h_nw,
+    uint32_t                    low_power_mode_on // 0: off, other: on
+);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_SetSelection
+(
+    nw_client_handle_type       h_nw,
+    QL_MCM_NW_SELECTION_INFO_T  *pt_info
+);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_GetSignalStrength
+(
+    nw_client_handle_type               h_nw,
+    QL_MCM_NW_SIGNAL_STRENGTH_INFO_T    *pt_info
+);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_GetCellAccessState
+(
+    nw_client_handle_type                   h_nw,
+    E_QL_MCM_NW_CELL_ACCESS_STATE_TYPE_T    *pe_state
+);
+
+E_QL_ERROR_CODE_T QL_MCM_NW_AddRxMsgHandler
+(
+    nw_client_handle_type        h_nw,
+    QL_MCM_NW_RxMsgHandlerFunc_t handlerPtr,
+    void* contextPtr
+);
+
+
+#endif//__QL_MCM_NW_H__
diff --git a/mbtk/include/ql/ql_mcm_sim.h b/mbtk/include/ql/ql_mcm_sim.h
new file mode 100755
index 0000000..4fc7b1c
--- /dev/null
+++ b/mbtk/include/ql/ql_mcm_sim.h
@@ -0,0 +1,713 @@
+/**
+ *@file     ql_mcm_sim.h
+ *@date     2017-05-02
+ *@author
+ *@brief
+ */
+#ifndef __QL_MCM_SIM_H__
+#define __QL_MCM_SIM_H__
+#include "mbtk_type.h"
+
+#include "ql_mcm.h"
+
+#define QL_SIM_IMSI_LEN_MAX     16  /**  Maximum length of IMSI data. */
+#define QL_SIM_ICCID_LEN_MAX    20  /**  Maximum length of ICCID data. */
+
+typedef uint32 sim_client_handle_type;
+
+typedef enum
+{
+    E_QL_MCM_SIM_SLOT_ID_1          = 0xB01,    /**< Identify card in slot 1.  */
+    E_QL_MCM_SIM_SLOT_ID_2          = 0xB02,    /**< Identify card in slot 2.  */
+}E_QL_MCM_SIM_SLOT_ID_TYPE_T;
+
+typedef enum
+{
+    E_QL_MCM_SIM_APP_TYPE_UNKNOWN   = 0xB00,    /**<  Unknown application type  */
+    E_QL_MCM_SIM_APP_TYPE_3GPP      = 0xB01,    /**< Identify the SIM/USIM application on the card.  */
+    E_QL_MCM_SIM_APP_TYPE_3GPP2     = 0xB02,    /**< Identify the RUIM/CSIM application on the card.  */
+    E_QL_MCM_SIM_APP_TYPE_ISIM      = 0xB03,    /**< Identify the ISIM application on the card.  */
+}E_QL_MCM_SIM_APP_TYPE_T;
+
+typedef struct
+{
+    E_QL_MCM_SIM_SLOT_ID_TYPE_T     e_slot_id;  /**< Indicates the slot to be used. */
+    E_QL_MCM_SIM_APP_TYPE_T         e_app;      /**< Indicates the type of the application. */
+}QL_SIM_APP_ID_INFO_T;  /* Type */
+
+
+#define QL_SIM_MCC_LEN      3   /**  Length of the MCC. */
+#define QL_SIM_MNC_MAX      3   /**  Maximum length of the MNC. */
+#define QL_SIM_PLMN_NUM_MAX 24  /**  Maximum number of PLMN data sets. */
+typedef struct
+{
+    char mcc[QL_SIM_MCC_LEN];  /**< MCC value in ASCII characters.*/
+    uint32_t mnc_len;               /**< Must be set to the number of elements in the MNC. */
+    char mnc[QL_SIM_MNC_MAX];  /**< MNC value in ASCII characters.*/
+}QL_SIM_PLMN_INFO_T;
+
+typedef struct
+{
+    uint32_t            preferred_operator_list_len;                    /**< Must be set to the number of elements in preferred_operator_list. */
+    QL_SIM_PLMN_INFO_T  preferred_operator_list[QL_SIM_PLMN_NUM_MAX];   /**< Preferred operator list. */
+}QL_SIM_PREFERRED_OPERATOR_LIST_T;  /* Message */
+
+
+#define QL_MCM_SIM_PIN_LEN_MAX  8   /**  Maximum length of PIN data. */
+typedef enum
+{
+    E_QL_MCM_SIM_PIN_ID_1 = 0xB01,  /**< Level 1 user verification.  */
+    E_QL_MCM_SIM_PIN_ID_2 = 0xB02,  /**< Level 2 user verification.  */
+}E_QL_MCM_SIM_PIN_ID_TYPE_T;
+
+typedef struct
+{
+    QL_SIM_APP_ID_INFO_T        app_info;                           /**< Application identification information. */
+    E_QL_MCM_SIM_PIN_ID_TYPE_T  pin_id;                             /**< PIN ID. */
+    uint32_t                    pin_value_len;                      /**< Must be set to the number of elements in pin_value. */
+    char                        pin_value[QL_MCM_SIM_PIN_LEN_MAX];  /*  Value of the PIN */
+}QL_SIM_VERIFY_PIN_INFO_T;
+
+/** Changes the PIN value of an application. The application must pass both the
+    new and the old values of the PIN to complete the operation.
+    The same PIN can be used by multiple sessions (i.e., the PIN is shared
+    between GSM and RUIM in an ICC card). The PIN is automatically verified
+    for all the sessions when the command is executed. */
+typedef struct
+{
+    QL_SIM_APP_ID_INFO_T        app_info;                               /**< Application identification information. */
+    E_QL_MCM_SIM_PIN_ID_TYPE_T  pin_id;                                 /**< PIN ID. */
+    uint32_t                    old_pin_value_len;                      /**< Must be set to the number of elements in old_pin_value. */
+    char                        old_pin_value[QL_MCM_SIM_PIN_LEN_MAX];  /**< Value of the old PIN as a sequence of ASCII characters. */
+    uint32_t                    new_pin_value_len;                      /**< Must be set to the number of elements in new_pin_value. */
+    char                        new_pin_value[QL_MCM_SIM_PIN_LEN_MAX];  /**< Value of the new PIN as a sequence of ASCII characters. */
+}QL_SIM_CHANGE_PIN_INFO_T;
+
+/** Unblocks a blocked PIN using the PUK code. The client must pass PUK1 to unblock PIN1 or PUK2 to unblock PIN2.
+    The same PIN can be used by multiple sessions (i.e., the PIN is shared between GSM and RUIM in an ICC card).
+    The PIN is automatically verified for all the sessions when the command is executed. */
+typedef struct
+{
+    QL_SIM_APP_ID_INFO_T        app_info;                               /**< Application identification information. */
+    E_QL_MCM_SIM_PIN_ID_TYPE_T  pin_id;                                 /**< PIN ID. */
+    uint32_t                    puk_value_len;                          /**< Must be set to the number of elements in puk_value. */
+    char                        puk_value[QL_MCM_SIM_PIN_LEN_MAX];      /**< Value of the PUK as a sequence of ASCII characters. */
+    uint32_t                    new_pin_value_len;                      /**< Must be set to the number of elements in new_pin_value. */
+    char                        new_pin_value[QL_MCM_SIM_PIN_LEN_MAX];  /**< Value of the new PIN as a sequence of ASCII characters. */
+}QL_SIM_UNBLOCK_PIN_INFO_T;
+
+/** Enables the PIN on an application. */
+typedef  QL_SIM_VERIFY_PIN_INFO_T QL_SIM_ENABLE_PIN_INFO_T; //Same
+
+/** Disables the PIN of an application, */
+typedef  QL_SIM_VERIFY_PIN_INFO_T QL_SIM_DISABLE_PIN_INFO_T; //Same
+
+
+typedef enum
+{
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_UNKNOWN                 = 0xB00, /**<  Unknown personalization feature.  */
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_3GPP_NETWORK            = 0xB01, /**<  Featurization based on 3GPP MCC and MNC.  */
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_3GPP_NETWORK_SUBSET     = 0xB02, /**<  Featurization based on 3GPP MCC, MNC, and IMSI digits 6 and 7.  */
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_3GPP_SERVICE_PROVIDER   = 0xB03, /**<  Featurization based on 3GPP MCC, MNC, and GID1.  */
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_3GPP_CORPORATE          = 0xB04, /**<  Featurization based on 3GPP MCC, MNC, GID1, and GID2.  */
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_3GPP_SIM                = 0xB05, /**<  Featurization based on the 3GPP IMSI.  */
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_3GPP2_NETWORK_TYPE_1    = 0xB06, /**<  Featurization based on 3GPP2 MCC and MNC.  */
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_3GPP2_NETWORK_TYPE_2    = 0xB07, /**<  Featurization based on 3GPP2 IRM code.  */
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_3GPP2_RUIM              = 0xB08, /**<  Featurization based on 3GPP2 IMSI_M.  */
+}E_QL_MCM_SIM_PERSO_FEATURE_TYPE_T;
+
+typedef enum
+{
+    E_QL_MCM_SIM_PERSO_OPERATION_DEACTIVATE                 = 0xB00, /**<  Disable an active personalization feature.  */
+    E_QL_MCM_SIM_PERSO_OPERATION_UNBLOCK                    = 0xB01, /**<  Unblock a personalization feature that has been blocked.  */
+}E_QL_MCM_SIM_PERSO_OPERATION_TYPE_T;
+
+
+#define QL_MCM_SIM_CONTROL_KEY_LEN_MAX 16   /**  Maximum length of personalization control key data */
+/** Deactivates or unblocks the personalization on the phone.
+    Each feature can be deactivated/unblocked independently of the other features. */
+typedef struct
+{
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_T       e_feature_type;                /**< Indicates the personalization feature to deactivate or unblock. */
+    E_QL_MCM_SIM_PERSO_OPERATION_TYPE_T     e_operation;              /**< Indicates the operation to perform. */
+    uint32_t                                ctrl_key_value_len;     /**< Must be set to the number of elements in ck_value. */
+    char                                    ctrl_key_value[QL_MCM_SIM_CONTROL_KEY_LEN_MAX];/**< Control key value. This value is a sequence of ASCII characters.*/
+}QL_MCM_SIM_DEPERSONALIZE_INFO_T;  /* Type */
+
+
+typedef struct
+{
+    char        mcc[5];       /**< MCC value in ASCII characters.*/
+    uint32_t    mnc_len;                        /**< Must be set to the number of elements in the MNC. */
+    char        mnc[5];       /**< MNC value in ASCII characters.*/
+}QL_MCM_SIM_NW_PERSONAL_INFO_T;
+
+typedef struct
+{
+    QL_MCM_SIM_NW_PERSONAL_INFO_T   network;    /**< MCC and MNC network information.*/
+    char                            digit6;     /**< Digit 6 of the IMSI in ASCII character.*/
+    char                            digit7;     /**< Digit 7 of the IMSI in ASCII character.*/
+}QL_MCM_SIM_NW_SUBSET_PERSONAL_INFO_T;
+
+typedef struct
+{
+    QL_MCM_SIM_NW_PERSONAL_INFO_T   network;    /**< MCC and MNC network information.*/
+    uint8_t                         gid1;       /**< Service provider code found in GID1.*/
+}QL_MCM_SIM_NW_SP_PERSONAL_INFO_T;
+
+typedef struct
+{
+    QL_MCM_SIM_NW_PERSONAL_INFO_T   network;    /**< MCC and MNC network information.*/
+    uint8_t                         gid1;       /**< Service provider code found in GID1.*/
+    uint8_t                         gid2;       /**< Corporate customer code found in GID2. @newpagetable */
+}QL_MCM_SIM_GW_CORPORATE_PERSONAL_INFO_T;
+
+#define QL_MCM_SIM_MSIN_LEN_MAX     10          /**  Maximum length of the MSIN. */
+typedef struct
+{
+    QL_MCM_SIM_NW_PERSONAL_INFO_T   network;    /**< MCC and MNC network information.*/
+    uint32_t                        msin_len;   /**< Must be set to the number of elements in MSIN. */
+    char                            msin[QL_MCM_SIM_MSIN_LEN_MAX];/**< MSIN value stored on the card in ASCII characters.*/
+}QL_MCM_SIM_SIM_PERSONAL_INFO_T;  /* Type */
+
+typedef struct
+{
+    char                            irm_code[4];/**< First 4 digits of the IRM-based MIN of IMSI_M in ASCII characters.*/
+}QL_MCM_SIM_1X_NW_TYPE2_PERSONAL_INFO_T;
+
+
+#define QL_MCM_SIM_PERSO_NUM_NW_MAX     85  /**  Maximum number of network personalization data sets. */
+#define QL_MCM_SIM_PERSO_NUM_NS_MAX     64  /**  Maximum number of network subset personalization data sets. */
+#define QL_MCM_SIM_PERSO_NUM_GW_SP_MAX  64  /**  Maximum number of service provider personalization data sets. */
+#define QL_MCM_SIM_PERSO_NUM_GW_CP_MAX  51  /**  Maximum number of corporate personalization data sets. */
+#define QL_MCM_SIM_PERSO_NUM_SIM_MAX    32  /**  Maximum number of SIM personalization data sets. */
+#define QL_MCM_SIM_PERSO_NUM_1X_NW2_MAX 128 /**  Maximum number of network type 2 personalization data sets. */
+
+typedef union
+{
+    QL_MCM_SIM_NW_PERSONAL_INFO_T               feature_gw_network_perso[QL_MCM_SIM_PERSO_NUM_NW_MAX];          /**< GW network personalization. */
+    QL_MCM_SIM_NW_SUBSET_PERSONAL_INFO_T        feature_gw_network_subset_perso[QL_MCM_SIM_PERSO_NUM_NS_MAX];   /**< GW network subset personalization. */
+    QL_MCM_SIM_NW_SP_PERSONAL_INFO_T            feature_gw_sp_perso[QL_MCM_SIM_PERSO_NUM_GW_SP_MAX];            /**< GW service provider personalization. */
+    QL_MCM_SIM_GW_CORPORATE_PERSONAL_INFO_T     feature_gw_corporate_perso[QL_MCM_SIM_PERSO_NUM_GW_CP_MAX];     /**< GW corporate personalization. */
+    QL_MCM_SIM_SIM_PERSONAL_INFO_T              feature_gw_sim_perso[QL_MCM_SIM_PERSO_NUM_SIM_MAX];             /**< GW SIM personalization. */
+    QL_MCM_SIM_NW_PERSONAL_INFO_T               feature_1x_network1_perso[QL_MCM_SIM_PERSO_NUM_NW_MAX];         /**< 1X network type 1 personalization. */
+    QL_MCM_SIM_1X_NW_TYPE2_PERSONAL_INFO_T      feature_1x_network2_perso[QL_MCM_SIM_PERSO_NUM_1X_NW2_MAX];     /**< 1X network type 3 personalization. */
+    QL_MCM_SIM_SIM_PERSONAL_INFO_T              feature_1x_ruim_perso[QL_MCM_SIM_PERSO_NUM_SIM_MAX];            /*  1x RUIM Personalization */
+}QL_MCM_SIM_PERSONAL_FEATURE_INFO_DATA_T;
+
+/** Request message; Activates and sets the personalization data on the phone. Each feature can be activated
+    independently of one another; however, network data configurations must be consistent across activated personalization
+    modes in order to prevent contradicting featurization, and only one feature can be activated per message.
+    If personalization is already activated, it must first be deactivated before being reactivated with new data. */
+typedef struct
+{
+    uint32_t                                    ctrl_key_value_len;                 /**< Must be set to the number of elements in ctrl_key_value. */
+    char                                        ctrl_key_value[60]; /**< Control key value. This value is a sequence of ASCII characters.*/
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_T           e_feature_type;
+    uint32_t                                    feature_data_len; //Valid array count of t_feature_data
+    QL_MCM_SIM_PERSONAL_FEATURE_INFO_DATA_T     t_feature_data;
+}QL_MCM_SIM_PERSONALIZE_FEATURE_INFO_T;
+
+
+typedef enum
+{
+    E_QL_MCM_SIM_CARD_STATE_UNKNOWN                     = 0xB01,    /**< Card state unknown. */
+    E_QL_MCM_SIM_CARD_STATE_ABSENT                      = 0xB02,    /**< Card is absent. */
+    E_QL_MCM_SIM_CARD_STATE_PRESENT                     = 0xB03,    /**< Card is present. */
+    E_QL_MCM_SIM_CARD_STATE_ERROR_UNKNOWN               = 0xB04,    /**< Unknown error state. */
+    E_QL_MCM_SIM_CARD_STATE_ERROR_POWER_DOWN            = 0xB05,    /**< Power down. */
+    E_QL_MCM_SIM_CARD_STATE_ERROR_POLL_ERROR            = 0xB06,    /**< Poll error. */
+    E_QL_MCM_SIM_CARD_STATE_ERROR_NO_ATR_RECEIVED       = 0xB07,    /**<  Failed to receive an answer to reset.  */
+    E_QL_MCM_SIM_CARD_STATE_ERROR_VOLT_MISMATCH         = 0xB08,    /**< Voltage mismatch. */
+    E_QL_MCM_SIM_CARD_STATE_ERROR_PARITY_ERROR          = 0xB09,    /**< Parity error. */
+    E_QL_MCM_SIM_CARD_STATE_ERROR_SIM_TECHNICAL_PROBLEMS= 0xB0A,    /**< Card returned technical problems. */
+}E_QL_MCM_SIM_CARD_STATE_TYPE_T;  /**< Card state. */
+
+typedef enum
+{
+    E_QL_MCM_SIM_CARD_TYPE_UNKNOWN  = 0xB00,    /**<  Unidentified card type.  */
+    E_QL_MCM_SIM_CARD_TYPE_ICC      = 0xB01,    /**<  Card of SIM or RUIM type.  */
+    E_QL_MCM_SIM_CARD_TYPE_UICC     = 0xB02,    /**<  Card of USIM or CSIM type.  */
+}E_QL_MCM_SIM_CARD_TYPE_T;
+
+typedef enum
+{
+    E_QL_MCM_SIM_PROV_STATE_NONE    = 0xB00,    /**<  Nonprovisioning.  */
+    E_QL_MCM_SIM_PROV_STATE_PRI     = 0xB01,    /**<  Primary provisioning subscription.  */
+    E_QL_MCM_SIM_PROV_STATE_SEC     = 0xB02,    /**<  Secondary provisioning subscription.  */
+}QL_MCM_SIM_SUBSCRIPTION_TYPE_T;
+
+typedef enum
+{
+    E_QL_MCM_SIM_APP_STATE_UNKNOWN                  = 0xB00,    /**< Application state unknown. */
+    E_QL_MCM_SIM_APP_STATE_DETECTED                 = 0xB01,    /**<  Detected state.  */
+    E_QL_MCM_SIM_APP_STATE_PIN1_REQ                 = 0xB02,    /**<  PIN1 required.  */
+    E_QL_MCM_SIM_APP_STATE_PUK1_REQ                 = 0xB03,    /**<  PUK1 required.  */
+    E_QL_MCM_SIM_APP_STATE_INITALIZATING            = 0xB04,    /**<  Initializing.  */
+    E_QL_MCM_SIM_APP_STATE_PERSO_CK_REQ             = 0xB05,    /**<  Personalization control key required.  */
+    E_QL_MCM_SIM_APP_STATE_PERSO_PUK_REQ            = 0xB06,    /**<  Personalization unblock key required.  */
+    E_QL_MCM_SIM_APP_STATE_PERSO_PERMANENTLY_BLOCKED= 0xB07,    /**<  Personalization is permanently blocked.  */
+    E_QL_MCM_SIM_APP_STATE_PIN1_PERM_BLOCKED        = 0xB08,    /**<  PIN1 is permanently blocked.  */
+    E_QL_MCM_SIM_APP_STATE_ILLEGAL                  = 0xB09,    /**<  Illegal application state.  */
+    E_QL_MCM_SIM_APP_STATE_READY                    = 0xB0A,    /**<  Application ready state.  @newpage */
+}QL_MCM_SIM_APP_STATE_TYPE_T;
+
+typedef enum
+{
+    E_QL_MCM_SIM_PIN_STATE_UNKNOWN                  = 0xB01,    /**< Unknown PIN state. */
+    E_QL_MCM_SIM_PIN_STATE_ENABLED_NOT_VERIFIED     = 0xB02,    /**<  PIN required, but has not been verified.  */
+    E_QL_MCM_SIM_PIN_STATE_ENABLED_VERIFIED         = 0xB03,    /**<  PIN required and has been verified.  */
+    E_QL_MCM_SIM_PIN_STATE_DISABLED                 = 0xB04,    /**<  PIN not required.  */
+    E_QL_MCM_SIM_PIN_STATE_BLOCKED                  = 0xB05,    /**<  PIN verification has failed too many times and is blocked. Recoverable through PUK verification.  */
+    E_QL_MCM_SIM_PIN_STATE_PERMANENTLY_BLOCKED      = 0xB06,    /**<  PUK verification has failed too many times and is not recoverable.  */
+}QL_MCM_SIM_PIN_STATE_TYPE_T;
+
+typedef struct
+{
+    QL_MCM_SIM_SUBSCRIPTION_TYPE_T      subscription;           /**<   Type of subscription (i.e., primary, secondary, etc.). */
+    QL_MCM_SIM_APP_STATE_TYPE_T         app_state;              /**<   Current state of the application. */
+    E_QL_MCM_SIM_PERSO_FEATURE_TYPE_T   perso_feature;          /**<   Current personalization state and feature enabled. */
+    uint8_t                             perso_retries;          /**<   Number of personalization retries. */
+    uint8_t                             perso_unblock_retries;  /**<   Number of personalization unblock retries. */
+    QL_MCM_SIM_PIN_STATE_TYPE_T         pin1_state;             /**<   Current PIN 1 state. */
+    uint8_t                             pin1_num_retries;       /**<   Number of PIN 1 retries. */
+    uint8_t                             puk1_num_retries;       /**<   Number of PUK 1 retries. */
+    QL_MCM_SIM_PIN_STATE_TYPE_T         pin2_state;             /**<   Current PIN 2 state. */
+    uint8_t                             pin2_num_retries;       /**<   Number of PIN 2 retries. */
+    uint8_t                             puk2_num_retries;       /**<   Number of PUK 2 retries. */
+}QL_MCM_SIM_CARD_APP_INFO_T;
+
+typedef struct
+{
+    QL_MCM_SIM_CARD_APP_INFO_T          app_3gpp;               /**<   Stores 3GPP application information. */
+    QL_MCM_SIM_CARD_APP_INFO_T          app_3gpp2;              /**<   Stores 3GPP2 application information. */
+    QL_MCM_SIM_CARD_APP_INFO_T          app_isim;               /**<   Stores ISIM application information. */
+}QL_MCM_SIM_CARD_ALL_APP_INFO_T;
+
+typedef struct
+{
+    E_QL_MCM_SIM_CARD_STATE_TYPE_T      e_card_state;/**<   Current card and card error state. */
+    E_QL_MCM_SIM_CARD_TYPE_T            e_card_type; /**<   Card type. */
+    QL_MCM_SIM_CARD_ALL_APP_INFO_T      card_app_info; /**<   Stores all relevant application information. */
+}QL_MCM_SIM_CARD_STATUS_INFO_T;
+
+#define QL_MCM_SIM_PATH_LEN_MAX     20  /**  Maximum length of a full file path in ASCII format. */
+typedef struct
+{
+    uint16_t    offset;                         /**< Offset is only required for write file access where data length is indicated.*/
+    uint8_t     record_num;                     /**< Number of records involved in file access. A record number of 0 indicates transparent file access.*/
+    uint32_t    path_len;                       /**< Must be set to the number of elements in the path. */
+    char        path[QL_MCM_SIM_PATH_LEN_MAX];  /**< File path in ASCII characters. @newpagetable */
+}QL_MCM_SIM_CARD_FILE_ACCESS_INFO_T;
+
+#define QL_MCM_SIM_DATA_LEN_MAX     4096        /**  Maximum size of data to be read/written. */
+typedef struct
+{
+    QL_SIM_APP_ID_INFO_T                app_info;                       /**< Application identification information. */
+    QL_MCM_SIM_CARD_FILE_ACCESS_INFO_T  file_access;                    /**< File access information. */
+    uint32_t                            data_len;                       /**< Must be set to the number of elements in data. */
+    uint8_t                             data[QL_MCM_SIM_DATA_LEN_MAX];  /**< Data to be updated on the card. */
+}QL_MCM_SIM_CARD_WRITE_FILE_INFO_T;
+
+
+/** Request message; Reads data to a specific file on a specified application on the card. The type of file is determined
+    by the record number field, which indicates a transparent file when zero and a record-based file otherwise.*/
+typedef struct
+{
+    QL_SIM_APP_ID_INFO_T                app_info;                       /**< Application identification information. */
+    QL_MCM_SIM_CARD_FILE_ACCESS_INFO_T  file_access;                    /**< File access information. */
+}QL_MCM_SIM_CARD_FILE_INFO_TO_READ_T;
+
+typedef struct
+{
+    uint32_t    data_len;                                               /**< Must be set to the number of elements in data. */
+    uint8_t     data[QL_MCM_SIM_DATA_LEN_MAX];                          /**< Data retrieved from the card. */
+}QL_MCM_SIM_CARD_FILE_DATA_T;
+
+/** Retrieves the size of a specific file on a specified application on the card. */
+typedef struct
+{
+    QL_SIM_APP_ID_INFO_T    app_info;                       /**< Application identification information. */
+    uint32_t                path_len;                       /**< Must be set to the number of elements in path. */
+    char                    path[QL_MCM_SIM_PATH_LEN_MAX];  /**< File path in ASCII characters.*/
+}QL_MCM_SIM_CARD_GET_FILE_SIZE_INPUT_INFO_T;
+
+typedef enum
+{
+    E_QL_MCM_SIM_FILE_TYPE_UNKNOWN      = 0xB00,/**<  Unknown file type  */
+    E_QL_MCM_SIM_FILE_TYPE_TRANSPARENT  = 0xB01,/**< File structure consisting of a sequence of bytes.  */
+    E_QL_MCM_SIM_FILE_TYPE_CYCLIC       = 0xB02,/**< File structure consisting of a sequence of records, each containing the same fixed size in
+                                                     chronological order. Once all the records have been used, the oldest data is overwritten.  */
+    MCM_SIM_FILE_TYPE_LINEAR_FIXED  = 0xB03,    /**< File structure consisting of a sequence of records, each containing the same fixed size.  */
+}E_QL_MCM_SIM_FILE_TYPE_T;
+
+typedef struct
+{
+    E_QL_MCM_SIM_FILE_TYPE_T    e_file_type;    /**<   File type: */
+    uint16_t                    file_size;      /**<   Size of transparent files.*/
+    uint16_t                    record_size;    /**<   Size of each cyclic or linear fixed file record.*/
+    uint16_t                    record_count;   /**<   Number of cyclic or linear fixed file records.*/
+}QL_MCM_SIM_FILE_SIZE_INFO_T;
+
+typedef enum
+{
+    E_QL_MCM_SIM_REFRESH_EVENT              = 0xB00,    /**< Card refresh event  */
+    E_QL_MCM_SIM_CARD_STATUS_UPDATE_EVENT   = 0xB01,    /**< Card status update event.  */
+}E_QL_SIM_NFY_MSG_ID_T;
+
+
+typedef void (*QL_SIM_CardStatusIndMsgHandlerFunc_t)
+(
+    sim_client_handle_type  h_sim,
+    E_QL_SIM_NFY_MSG_ID_T   e_msg_id,
+    void                    *pv_data,
+    void                    *contextPtr
+);
+
+
+int QL_MCM_SIM_Client_Init(sim_client_handle_type  *ph_sim);
+
+int QL_MCM_SIM_Client_Deinit(sim_client_handle_type h_sim);
+
+/* Add callback function if anything changed specified by the mask in QL_LOC_Set_Indications*/
+int QL_MCM_SIM_AddRxIndMsgHandler(QL_SIM_CardStatusIndMsgHandlerFunc_t handlerPtr, void* contextPtr);
+
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_GetIMSI
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to retrieve the IMSI (for 3GPP)
+    or IMSI_M (for 3GPP2) from the SIM in ASCII form
+
+    @return
+    void
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_GetIMSI
+(
+    sim_client_handle_type          h_sim,
+    QL_SIM_APP_ID_INFO_T            *pt_info,   ///< [IN] The SIM identifier info.
+    char                            *imsi,      ///< [OUT] IMSI buffer
+    size_t                          imsiLen     ///< [IN] IMSI buffer length
+);
+
+
+E_QL_ERROR_CODE_T QL_MCM_SIM_GetIMEI
+(
+    sim_client_handle_type          h_sim,
+    char                            *imei,      ///< [OUT] IMSI buffer
+    size_t                          imeiLen     ///< [IN] IMSI buffer length
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_GetICCID
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to retrieve the ICCID from
+    SIM in ASCII form
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_GetICCID
+(
+    sim_client_handle_type          h_sim,
+    E_QL_MCM_SIM_SLOT_ID_TYPE_T     simId,     ///< [IN] The SIM identifier.
+    char                            *iccid,    ///< [OUT] ICCID
+    size_t                          iccidLen   ///< [IN] ICCID buffer length
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_GetPhoneNumber
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to retrieve the device phone
+    number from MSISDN (for 3GPP) or MDN (for 3GPP2) from the SIM in
+    ASCII form
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_GetPhoneNumber
+(
+    sim_client_handle_type          h_sim,
+    QL_SIM_APP_ID_INFO_T            *pt_info,   ///< [IN] The SIM identifier.
+    char                            *phone_num, ///< [OUT] phone number
+    size_t                          phoneLen    ///< [IN] phone number buffer length
+);
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_GetOperatorPlmnList
+
+===========================================================================*/
+/*
+    @brief
+    Function sends multiple record based read commands to the modem
+    to retrieve a list of operator preffered PLMN.
+
+    @note
+    Function should only be called for SIM/USIM
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_GetOperatorPlmnList
+(
+    sim_client_handle_type              h_sim,
+    E_QL_MCM_SIM_SLOT_ID_TYPE_T         simId,      ///< [IN] The SIM identifier.
+    QL_SIM_PREFERRED_OPERATOR_LIST_T    *pt_info    ///< [OUT] Preferred operator list
+);
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_VerifyPIN
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to verify either PIN1 or PIN2
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_VerifyPIN
+(
+    sim_client_handle_type      h_sim,
+    QL_SIM_VERIFY_PIN_INFO_T    *pt_info   ///< [IN] Verify PIN infor
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_ChangePin
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to change the value of
+    either PIN1 or PIN2
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_ChangePin
+(
+    sim_client_handle_type      h_sim,
+    QL_SIM_CHANGE_PIN_INFO_T    *pt_info   ///< [IN] Change PIN infor
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_UnblockPIN
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to unblock a PIN1 or PIN2 that
+    has been blocked
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_UnblockPIN
+(
+    sim_client_handle_type      h_sim,
+    QL_SIM_UNBLOCK_PIN_INFO_T   *pt_info   ///< [IN] Unblock PIN infor
+);
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_EnablePIN
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to enable PIN1 or PIN2
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_EnablePIN
+(
+    sim_client_handle_type      h_sim,
+    QL_SIM_ENABLE_PIN_INFO_T    *pt_info   ///< [IN] Enable PIN infor
+);
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_DisablePIN
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to disable PIN1 or PIN2
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_DisablePIN
+(
+    sim_client_handle_type      h_sim,
+    QL_SIM_DISABLE_PIN_INFO_T   *pt_info   ///< [IN] Disable PIN infor
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_GetCardStatus
+
+===========================================================================*/
+/*
+    @brief
+    Function retrieves the server cached card status informations and
+    sends the information to the client
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_GetCardStatus
+(
+    sim_client_handle_type          h_sim,
+    E_QL_MCM_SIM_SLOT_ID_TYPE_T     simId,     ///< [IN] The SIM identifier.
+    QL_MCM_SIM_CARD_STATUS_INFO_T   *pt_info   ///< [OUT] Cart status infor output
+);
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_Depersonalization
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to disable or unblock SIM Lock
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_Depersonalization
+(
+    sim_client_handle_type              h_sim,
+    QL_MCM_SIM_DEPERSONALIZE_INFO_T     *pt_info   ///< [OUT] Depersonalize information
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_Personalization
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to set the SIM Lock data
+    and concurrently enable SIM Lock.
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_Personalization
+(
+    sim_client_handle_type                  h_sim,
+    QL_MCM_SIM_PERSONALIZE_FEATURE_INFO_T   *pt_info   ///< [OUT] Unblock PIN infor
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_WriteFile
+
+===========================================================================*/
+/*
+    @brief
+    Function will determine whether the request is for transparent or
+    record based write command based on the record number and calls the
+    corresponding function to send the message to the card.
+
+    record number = 0  -  transparent
+    record number > 0  -  record based
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_WriteFile
+(
+    sim_client_handle_type              h_sim,
+    QL_MCM_SIM_CARD_WRITE_FILE_INFO_T   *pt_info   ///< [OUT] Verify PIN infor
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_ReadFile
+
+===========================================================================*/
+/*
+    @brief
+    Function will determine whether the request is for transparent or
+    record based read command based on the record number and calls the
+    corresponding function to send the message to the card.
+
+    record number = 0  -  transparent
+    record number > 0  -  record based
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_ReadFile
+(
+    sim_client_handle_type                  h_sim,
+    QL_MCM_SIM_CARD_FILE_INFO_TO_READ_T     *pt_info,   ///< [IN] input file info which to be read
+    QL_MCM_SIM_CARD_FILE_DATA_T             *pt_out     ///< [OUT] File data of the specified one by pt_info
+);
+
+/*===========================================================================
+
+  FUNCTION:  QL_MCM_SIM_GetFileSize
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to retrieve the file type, file
+    size(transparent files) or record size and record count (record based files)
+
+    @return
+    E_QL_ERROR_CODE_T
+*/
+/*=========================================================================*/
+E_QL_ERROR_CODE_T QL_MCM_SIM_GetFileSize
+(
+    sim_client_handle_type                          h_sim,
+    QL_MCM_SIM_CARD_GET_FILE_SIZE_INPUT_INFO_T      *pt_info,   ///< [IN] input file info which to be read
+    QL_MCM_SIM_FILE_SIZE_INFO_T                     *pt_out     ///< [OUT] output file size info
+);
+
+
+
+#endif // __QL_MCM_SIM_H__
+
diff --git a/mbtk/include/ql/ql_mcm_sms.h b/mbtk/include/ql/ql_mcm_sms.h
new file mode 100755
index 0000000..1055325
--- /dev/null
+++ b/mbtk/include/ql/ql_mcm_sms.h
@@ -0,0 +1,282 @@
+/**
+ *@file     ql_sms.h
+ *@date     2017-05-02
+ *@author   
+ *@brief    
+ */
+
+#ifndef __QL_SMS_H__
+#define __QL_SMS_H__
+
+#include "mbtk_type.h"
+
+typedef uint32 sms_client_handle_type;
+
+/**  Maximum length of an SMS. */
+#define QL_SMS_MAX_MT_MSG_LENGTH    1440
+
+/**  Maximum string length. */
+#define QL_SMS_MAX_ADDR_LENGTH      252
+
+/**  Maximum string length. */
+#define QL_SMS_MAX_SCA_TYPE_LENGTH 3
+
+
+typedef enum   
+{    
+    E_QL_SMS_FORMAT_GSM_7BIT        = 0,
+    E_QL_SMS_FORMAT_BINARY_DATA     = 1,
+    E_QL_SMS_FORMAT_UCS2            = 2,
+    //<2017/12/28-QCM9XOL00004C001-P01-Vicent.Gao, <[SMS] Segment 1==> CharSet to Alpha implementation.>
+    E_QL_SMS_FORMAT_IRA             = 3,
+    //>2017/12/28-QCM9XOL00004C001-P01-Vicent.Gao
+
+}E_QL_SMS_FORMAT_T;   
+
+typedef enum   
+{    
+    E_QL_SMS_TYPE_RX                = 0,    ///< SMS mobile terminated message.  
+    E_QL_SMS_TYPE_TX                = 1,    ///< SMS mobile originated message. 
+    E_QL_SMS_TYPE_BROADCAST_RX      = 2     ///< SMS Cell Broadcast message.   
+}E_QL_SMS_TYPE_T; 
+
+typedef enum 
+{
+    E_QL_SMS_STORAGE_TYPE_NONE      = -1,   /**<  Message no need to store. */
+    E_QL_SMS_STORAGE_TYPE_UIM       = 0,    /**<  Message store to UIM. */
+    E_QL_SMS_STORAGE_TYPE_NV        = 1,    /**<  Message store to NV. */
+}E_QL_SMS_STORAGE_TYPE_T;
+
+typedef enum 
+{
+    E_QL_SMS_MESSAGE_MODE_UNKNOWN   = -1,   /**<  Message type CDMA */
+    E_QL_SMS_MESSAGE_MODE_CDMA      = 0,    /**<  Message type CDMA */
+    E_QL_SMS_MESSAGE_MODE_GW        = 1,    /**<  Message type GW. */
+}E_QL_SMS_MODE_TYPE_T;
+
+typedef struct 
+ {
+    uint8_t total_segments;     /**<     The number of long  short message*/
+    uint8_t seg_number;         /**<     Current number.*/
+	uint8_t reference_number;   /**< reference_number.*/
+}ql_sms_user_data_head_t; 
+
+typedef struct
+{
+    /* If sms is stored, it won't parse, you need read it by yourself */
+    E_QL_SMS_STORAGE_TYPE_T e_storage;                          ///specify where stored this msg
+    
+    E_QL_SMS_FORMAT_T       format;
+    E_QL_SMS_TYPE_T         type;
+    char                    sms_number_addr[QL_SMS_MAX_ADDR_LENGTH]; ///Telephone number string
+    char                    sca_number_addr[QL_SMS_MAX_ADDR_LENGTH]; //.SMS Center Number  
+    int                     sms_data_len;
+    char                    sms_data[QL_SMS_MAX_MT_MSG_LENGTH];   ///SMS content, data format depends on format
+    char                    timestamp[21];                      ///Message time stamp (in text mode). string format: "yy/MM/dd,hh:mm:ss+/-TimeZone" 
+    uint8_t                 user_data_head_valid;               //indicate whether long sms. TRUE-long sms; FALSE-short message;
+    ql_sms_user_data_head_t  user_data_head;                    //long sms user data head info.
+    E_QL_SMS_MODE_TYPE_T    e_mode;                             ///specify where stored this msg cdma or gw area
+    uint32_t                storage_index;                      ///storage index, -1 means not store
+} ql_sms_info_t;
+     
+
+typedef struct
+{
+    E_QL_SMS_STORAGE_TYPE_T e_storage;
+    E_QL_SMS_MODE_TYPE_T    e_mode;
+    uint32_t                storage_idx;
+} ql_sms_storage_info_t;
+
+/*      0 = "REC UNREAD"    */
+/*      1 = "REC READ"      */
+/*      2 = "STO UNSENT"    */
+/*      3 = "STO SENT"      */
+typedef enum _ql_SMS_SIM_STATUS
+{
+    REC_UNREAD   = 0,
+    REC_READ     = 1,
+    STO_UNSENT   = 2,
+    STO_SENT     = 3
+}ql_SMS_SIM_STATUS;
+
+typedef enum 
+{
+    E_QL_SMS_MESSAGE_CLASS_0    = 0x00, //display only
+    E_QL_SMS_MESSAGE_CLASS_1    = 0x01, //store in ME
+    E_QL_SMS_MESSAGE_CLASS_2    = 0x02, //store in SIM
+    E_QL_SMS_MESSAGE_CLASS_3    = 0x03, //
+    E_QL_SMS_MESSAGE_CLASS_NONE = 0x04, 
+    E_QL_SMS_MESSAGE_CLASS_CDMA = 0x05, 
+    E_QL_SMS_MESSAGE_CLASS_MAX  = 0x06, 
+}E_QL_SMS_MESSAGE_CLASS_TYPE_T;
+
+typedef enum 
+{
+    E_QL_SMS_UNKNOWN            = -1, 
+    E_QL_SMS_DISCARD            = 0x00, /*  Incoming messages for this route are discarded by the WMS service without 
+                                            notifying QMI_WMS clients */
+    E_QL_SMS_STORE_AND_NOTIFY   = 0x01, /*  Incoming messages for this route are stored to the specified device 
+                                            memory, and new message notifications */
+    E_QL_SMS_TRANSFER_ONLY      = 0x02, /*  Incoming messages for this route are transferred to the client, and the
+                                            client is expected to send ACK to the network */
+    E_QL_SMS_TRANSFER_AND_ACK   = 0x03, /*  Incoming messages for this route are transferred to the client, and ACK is
+                                            sent to the network */
+}E_QL_SMS_RECEPTION_ACTION_TYPE_T;
+
+typedef struct 
+{
+  E_QL_SMS_MESSAGE_CLASS_TYPE_T     message_class;
+  E_QL_SMS_STORAGE_TYPE_T           route_storage;
+  E_QL_SMS_RECEPTION_ACTION_TYPE_T  receipt_action;
+}ql_sms_route_info_t;  /* Type */
+
+typedef struct 
+{
+    ql_sms_route_info_t     route_list[E_QL_SMS_MESSAGE_CLASS_MAX];
+}ql_sms_route_info_list_t;  /* Message */
+
+#define QL_WMS_MESSAGE_LENGTH_MAX 255
+
+typedef enum 
+ {
+    E_QL_WMS_MESSAGE_FORMAT_CDMA            = 0x00,     //- 0x00 -- MESSAGE_FORMAT_CDMA -- CDMA \n 
+    E_QL_WMS_MESSAGE_FORMAT_GW_PP           = 0x06,     //- 0x06 -- MESSAGE_FORMAT_GW_PP -- GW_PP
+}E_QL_WMS_MESSAGE_FORMAT_TYPE;
+
+
+typedef struct
+ {
+  E_QL_WMS_MESSAGE_FORMAT_TYPE format;
+  uint32_t raw_message_len;                             /**< Must be set to # of elements in raw_message */
+  uint8_t raw_message[QL_WMS_MESSAGE_LENGTH_MAX];       /**< Raw message data*/
+}ql_wms_send_raw_message_data_t; 
+
+
+typedef enum
+{
+  E_QL_WMS_TL_CAUSE_CODE_ADDR_VACANT                        = 0x00, 
+  E_QL_WMS_TL_CAUSE_CODE_ADDR_TRANSLATION_FAILURE           = 0x01, 
+  E_QL_WMS_TL_CAUSE_CODE_NETWORK_RESOURCE_SHORTAGE          = 0x02, 
+  E_QL_WMS_TL_CAUSE_CODE_NETWORK_FAILURE                    = 0x03, 
+  E_QL_WMS_TL_CAUSE_CODE_INVALID_TELESERVICE_ID             = 0x04, 
+  E_QL_WMS_TL_CAUSE_CODE_NETWORK_OTHER                      = 0x05, 
+  E_QL_WMS_TL_CAUSE_CODE_NO_PAGE_RESPONSE                   = 0x20, 
+  E_QL_WMS_TL_CAUSE_CODE_DEST_BUSY                          = 0x21, 
+  E_QL_WMS_TL_CAUSE_CODE_NO_ACK                             = 0x22, 
+  E_QL_WMS_TL_CAUSE_CODE_DEST_RESOURCE_SHORTAGE             = 0x23, 
+  E_QL_WMS_TL_CAUSE_CODE_SMS_DELIVERY_POSTPONED             = 0x24, 
+  E_QL_WMS_TL_CAUSE_CODE_DEST_OUT_OF_SERV                   = 0x25, 
+  E_QL_WMS_TL_CAUSE_CODE_DEST_NOT_AT_ADDR                   = 0x26, 
+  E_QL_WMS_TL_CAUSE_CODE_DEST_OTHER                         = 0x27, 
+  E_QL_WMS_TL_CAUSE_CODE_RADIO_IF_RESOURCE_SHORTAGE         = 0x40, 
+  E_QL_WMS_TL_CAUSE_CODE_RADIO_IF_INCOMPATABILITY           = 0x41, 
+  E_QL_WMS_TL_CAUSE_CODE_RADIO_IF_OTHER                     = 0x42, 
+  E_QL_WMS_TL_CAUSE_CODE_ENCODING                           = 0x60, 
+  E_QL_WMS_TL_CAUSE_CODE_SMS_ORIG_DENIED                    = 0x61, 
+  E_QL_WMS_TL_CAUSE_CODE_SMS_TERM_DENIED                    = 0x62, 
+  E_QL_WMS_TL_CAUSE_CODE_SUPP_SERV_NOT_SUPP                 = 0x63, 
+  E_QL_WMS_TL_CAUSE_CODE_SMS_NOT_SUPP                       = 0x64, 
+  E_QL_WMS_TL_CAUSE_CODE_MISSING_EXPECTED_PARAM             = 0x65, 
+  E_QL_WMS_TL_CAUSE_CODE_MISSING_MAND_PARAM                 = 0x66, 
+  E_QL_WMS_TL_CAUSE_CODE_UNRECOGNIZED_PARAM_VAL             = 0x67, 
+  E_QL_WMS_TL_CAUSE_CODE_UNEXPECTED_PARAM_VAL               = 0x68, 
+  E_QL_WMS_TL_CAUSE_CODE_USER_DATA_SIZE_ERR                 = 0x69, 
+  E_QL_WMS_TL_CAUSE_CODE_GENERAL_OTHER                      = 0x6A, 
+}E_QL_WMS_TL_CAUSE_CODE_TYPE;
+
+typedef struct
+ {
+  uint16_t                              message_id;            /*  Message ID */
+  uint8_t                               cause_code_valid;      /**< Must be set to true if cause_code is being passed */
+  E_QL_WMS_TL_CAUSE_CODE_TYPE           cause_code;  
+}ql_wms_raw_send_resp_t;
+
+typedef struct 
+ {
+  char service_center_addr[QL_SMS_MAX_ADDR_LENGTH + 1];         /**<   Address of the service center.*/
+  uint8_t service_center_addr_type_valid;
+  char service_center_addr_type[QL_SMS_MAX_SCA_TYPE_LENGTH + 1];    /**<   129 if the SMSC address does not start with a "+" characte;
+                                                                           145 if the SMSC address starts with a "+" character*/
+}ql_sms_service_center_cfg_t;
+
+typedef ql_sms_info_t       QL_SMS_Msg_t; 
+typedef ql_sms_info_t*      QL_SMS_MsgRef; 
+
+/* Callback function registered to QL_SMS_AddRxMsgHandler, msgRef contains the detail msg infor */
+typedef void (*QL_SMS_RxMsgHandlerFunc_t)   
+(    
+    QL_SMS_MsgRef       msgRef,  
+    void*               contextPtr    
+);
+
+/* Init SMS module and return h_sms, this should be called before any othe ones */
+int QL_SMS_Client_Init(sms_client_handle_type  *ph_sms);
+
+/* Add callback function, if any new msg arrived, it will notify app */
+int QL_SMS_AddRxMsgHandler(QL_SMS_RxMsgHandlerFunc_t handlerPtr, void* contextPtr);
+
+/* Send sms, you just need to fill format/src_addr/sms_data_len/sms_data,
+   if format is UCS2, the data should be Unicode-BE format.
+*/
+int QL_SMS_Send_Sms(sms_client_handle_type h_sms, ql_sms_info_t *pt_sms_info);
+
+/* DeInit SMS module and release resource, this should be called in the last one. */
+int QL_SMS_Client_Deinit(sms_client_handle_type h_sms);
+     
+/* Delete the SMS specified in the  pt_sms_storage */
+int QL_SMS_DeleteFromStorage(sms_client_handle_type  h_sms, ql_sms_storage_info_t  *pt_sms_storage);
+
+/* Set route list, normally, sms won't be stored, the route set to transfer_and_ack by default.
+   If you want to save to storage, you can specify it with this api.
+*/
+int QL_SMS_SetRouteList(sms_client_handle_type  h_sms,  ql_sms_route_info_list_t *pt_route_list);
+
+/* Send sms PDU.
+*/
+int QL_SMS_Send_SmsPdu( sms_client_handle_type     h_sms,
+                         ql_wms_send_raw_message_data_t *raw_message_data,
+                         ql_wms_raw_send_resp_t *rawresp);
+
+int QL_SMS_Get_By_id(ql_sms_storage_info_t  *pt_sms_storage);
+
+/* Get sms center address.
+*/
+int QL_SMS_GetSmsCenterAddress( sms_client_handle_type     h_sms,
+                       ql_sms_service_center_cfg_t *set_sca_cfg);
+
+/* Set sms center address.
+*/
+int QL_SMS_SetSmsCenterAddress( sms_client_handle_type     h_sms,
+                       ql_sms_service_center_cfg_t *get_sca_cfg);
+
+int QL_SMS_Get_Storage(sms_client_handle_type  *ph_sms);
+
+int QL_SMS_Save_Sms(sms_client_handle_type h_sms, ql_sms_info_t *pt_sms_info);
+
+int QL_SMS_Delete_Sms(sms_client_handle_type h_sms, ql_sms_info_t *pt_sms_info);
+/*
+Usage 1 (register callback and wait for new sms arrive): 
+1, QL_SMS_Client_Init
+2, QL_SMS_AddRxMsgHandler(pf_cb)
+3, wait for sms arrive, pf_cb will pass the detail sms info to app.
+4, QL_SMS_Client_Deinit
+
+
+Usage 2 (Send sms): 
+1, QL_SMS_Client_Init
+2, QL_SMS_AddRxMsgHandler(pf_cb)
+3, QL_SMS_Send_Sms
+4, QL_SMS_Client_Deinit
+
+
+Usage 3 (store sms): 
+1, QL_SMS_Client_Init
+2, QL_SMS_AddRxMsgHandler(pf_cb)
+3, QL_SMS_SetRouteList (Notice: class-0 not allowed to store, class-2 must be stored to UIM)
+4, pf_cb will be called when new sms arrived, and tell you where the sms stored
+5, you can call QL_SMS_DeleteFromStorage to delete specified sms, the location can be got from pf_cb.
+6, QL_SMS_Client_Deinit
+*/
+
+#endif // __QL_SMS_H__      
+     
diff --git a/mbtk/include/ql/ql_network.h b/mbtk/include/ql/ql_network.h
new file mode 100755
index 0000000..241c718
--- /dev/null
+++ b/mbtk/include/ql/ql_network.h
@@ -0,0 +1,51 @@
+/**
+ * @file ql_network.h
+ * @brief Quectel Openlinux network public function declarations.
+ *
+ * @note
+ *
+ * @copyright Copyright (c) 2009-2017 @ Quectel Wireless Solutions Co., Ltd.
+ */
+
+#ifndef __QL_NETWORK_H__
+#define __QL_NETWORK_H__
+#include "mbtk_type.h"
+#include "mbtk_info_api.h"
+
+
+ typedef struct {
+ 	char gw_ip[20];				/* Gateway Address*/
+	char netmask[20];			         /* netmask */
+	unsigned char enable_dhcp;            /* Whether to enable DHCP; boolean value. */
+  	char dhcp_start_ip[20]; 		         /*DHCP start IP address.*/
+   	char dhcp_end_ip[20];		         /*DHCP end IP address. */
+   	unsigned int lease_time; 	         /*DHCP lease time, in seconds.*/
+ }ql_lan_dhcp_config_s;
+
+
+
+/**
+* Set the network configuration: dhcp configuration.
+*s
+* @param [in]  lan_dhcp_config
+*
+* @return
+*	On success, 0 is returned.	On error, -1 is returned.
+*
+*/
+extern int QL_LAN_DHCP_Config_Set(ql_lan_dhcp_config_s lan_dhcp_config);
+
+/**
+* Get the network configuration: dhcp configuration.
+*
+* @param [out]	 lan_dhcp_config
+*
+* @return
+*	On success, 0 is returned.	On error, -1 is returned.
+*
+*/
+extern int QL_LAN_DHCP_Config_Get(ql_lan_dhcp_config_s *lan_dhcp_config);
+
+#endif
+
+
diff --git a/mbtk/include/ql/ql_nw.h b/mbtk/include/ql/ql_nw.h
new file mode 100755
index 0000000..8e1d237
--- /dev/null
+++ b/mbtk/include/ql/ql_nw.h
@@ -0,0 +1,292 @@
+/**
+  @file
+  ql_nw.h
+
+  @brief
+  This file provides the definitions for nw, and declares the
+  API functions.
+
+*/
+/*============================================================================
+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+ =============================================================================*/
+/*===========================================================================
+
+                        EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+
+WHEN        WHO            WHAT, WHERE, WHY
+----------  ------------   ----------------------------------------------------
+14/08/2019  Nebula.li      create
+=============================================================================*/
+
+#ifndef __QL_NW_H__
+#define __QL_NW_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define  QL_NW_IND_VOICE_REG_EVENT_FLAG  (1 << 0)  //VOICE注册事件
+#define  QL_NW_IND_DATA_REG_EVENT_FLAG  (1 << 1)   //DATA注册事件
+#define  QL_NW_IND_SIGNAL_STRENGTH_EVENT_FLAG  (1 << 2)  //信号强度事件
+#define  QL_NW_IND_NITZ_TIME_UPDATE_EVENT_FLAG  (1 << 3)  //时间跟新事件
+//START baron-2020.02.29: add for ims register state indication
+#define  QL_NW_IND_IMS_NETWORK_STATE_CHANGED_FLAG    (1 << 4) //ims register state change
+//END
+#define CELL_MAX_NUM 20
+
+typedef enum
+{
+	QL_NW_SUCCESS,
+	QL_NW_GENERIC_FAILURE,
+ 	QL_NW_RADIO_NOT_AVAILABLE,
+}QL_NW_ERROR_CODE;
+
+typedef enum {
+  QL_NW_PREF_NET_TYPE_GSM_WCDMA  = 0,
+  QL_NW_PREF_NET_TYPE_GSM_ONLY  = 1,
+  QL_NW_PREF_NET_TYPE_WCDMA  = 2,
+  QL_NW_PREF_NET_TYPE_GSM_WCDMA_AUTO  = 3, //根据 PRL自动选择GSM、WCDMA
+  QL_NW_PREF_NET_TYPE_LTE_GSM_WCDMA  = 9, //自动选择LTE、GSM、WCDMA
+  QL_NW_PREF_NET_TYPE_LTE_ONLY  = 11,
+  QL_NW_PREF_NET_TYPE_LTE_WCDMA  = 12,
+  QL_NW_PREF_NET_TYPE_LTE_GSM_GSM_PREF = 13, //优先GSM
+  QL_NW_PREF_NET_TYPE_LTE_GSM_LTE_PREF = 14, //优先LTE
+  QL_NW_PREF_NET_TYPE_LTE_GSM = 15,
+  QL_NW_PREF_NET_TYPE_LTE_WCDMA_WCDMA_PREF = 16,
+  QL_NW_PREF_NET_TYPE_LTE_WCDMA_LTE_PREF = 17,
+  QL_NW_PREF_NET_TYPE_LTE_GSM_WCDMA_GSM_PREF   = 19,
+  QL_NW_PREF_NET_TYPE_LTE_GSM_WCDMA_WCDMA_PREF = 20,
+  QL_NW_PREF_NET_TYPE_LTE_GSM_WCDMA_LTE_PREF   = 21,
+} QL_NW_PREFERRED_NETWORK_TYPE;
+
+typedef struct
+{
+  QL_NW_PREFERRED_NETWORK_TYPE  preferred_nw_mode;  //首选的网络制式,见QL_NW_PREFERRED_NETWORK_TYPE
+  int  roaming_pref;      //漫游开关。 0 关; 1 开
+}QL_NW_CONFIG_INFO_T;
+
+typedef struct
+{
+  char        nitz_time[32];  //格式:format: YY/MM/DD HH:MM:SS '+/-'TZ daylight,   18/09/19 07:40:18 +32 00.
+  unsigned long  abs_time;   //0表示不可用
+  unsigned char      leap_sec;   //0表示不可用
+}QL_NW_NITZ_TIME_INFO_T;
+
+typedef struct
+{
+  char long_eons[128];
+  char short_eons[128];
+  char mcc[4];
+  char mnc[4];
+}QL_NW_OPERATOR_INFO_T;
+
+//START baron-2020.02.29: add for ims register state
+typedef struct __volte_state
+{
+    int reg_state;    /*0: not registered, 1: registered*/
+}VOLTE_STATE;
+//END
+
+typedef enum
+{
+  QL_NW_ACCESS_TECH_GSM   = 0,
+  QL_NW_ACCESS_TECH_GSM_COMPACT    = 1,
+  QL_NW_ACCESS_TECH_UTRAN      = 2,
+  QL_NW_ACCESS_TECH_GSM_wEGPRS    = 3,
+  QL_NW_ACCESS_TECH_UTRAN_wHSDPA   = 4,
+  QL_NW_ACCESS_TECH_UTRAN_wHSUPA     = 5,
+  QL_NW_ACCESS_TECH_UTRAN_wHSDPA_HSUPA    = 6,
+  QL_NW_ACCESS_TECH_E_UTRAN    = 7,
+  QL_NW_ACCESS_TECH_UTRAN_HSPAP   = 8,
+  QL_NW_ACCESS_TECH_E_UTRAN_CA   = 9,
+  QL_NW_ACCESS_TECH_NONE = 10,
+}QL_NW_ACCESS_TECHNOLOGY;
+
+typedef struct
+{
+  int status; //0:未知的网络;1:可用的网络;2:当前的网络;3:禁止使用的网络
+  QL_NW_OPERATOR_INFO_T operator_name; //运营商信息,见QL_NW_OPERATOR_INFO_T。
+  QL_NW_ACCESS_TECHNOLOGY  act;  //注网制式,见QL_NW_RADIO_TECH_TYPE_T。
+}QL_NW_SCAN_ENTRY_INFO_T;
+
+typedef struct
+{
+  int  entry_len; //可用网络的个数
+  QL_NW_SCAN_ENTRY_INFO_T entry[40]; //可用网络的列表,见QL_NW_SCAN_ENTRY_INFO_T。
+}QL_NW_SCAN_RESULT_LIST_INFO_T;
+
+
+typedef enum {
+    QL_NW_RADIO_TECH_UNKNOWN = 0,
+    QL_NW_RADIO_TECH_GPRS = 1,
+    QL_NW_RADIO_TECH_EDGE = 2,
+    QL_NW_RADIO_TECH_UMTS = 3,
+    QL_NW_RADIO_TECH_IS95A = 4,
+    QL_NW_RADIO_TECH_IS95B = 5,
+    QL_NW_RADIO_TECH_1xRTT =  6,
+    QL_NW_RADIO_TECH_HSDPA = 9,
+    QL_NW_RADIO_TECH_HSUPA = 10,
+    QL_NW_RADIO_TECH_HSPA = 11,
+    QL_NW_RADIO_TECH_EHRPD = 13,
+    QL_NW_RADIO_TECH_LTE = 14,
+    QL_NW_RADIO_TECH_HSPAP = 15, // HSPA+
+    QL_NW_RADIO_TECH_GSM = 16,
+    QL_NW_RADIO_TECH_TD_SCDMA = 17,
+    QL_NW_RADIO_TECH_IWLAN = 18,
+    QL_NW_RADIO_TECH_LTEP = 19,
+    QL_NW_RADIO_TECH_DC_HSPA = 20
+} QL_NW_RADIO_TECHNOLOGY;
+
+typedef enum {
+  QL_NW_REG_STATE_NOT_REGISTERED=0,  //not registered, MT is not currently searching an operator to register to
+  QL_NW_REG_STATE_HOME_NETWORK=1,  //registered, home network
+  QL_NW_REG_STATE_TRYING_ATTACH_OR_SEARCHING=2, //not registered, but MT is currently trying to attach or searching an operator to register to
+  QL_NW_REG_STATE_DENIED=3, //registration denied
+  QL_NW_REG_STATE_UNKNOWN=4, //unknown
+  QL_NW_REG_STATE_ROAMING=5, //registered, roaming
+  QL_NW_REG_STATE_HOME_NETWORK_SMS_ONLY=6, //registered for “SMS only”, home network (not applicable)
+  QL_NW_REG_STATE_ROAMING_SMS_ONLY=7,// registered for “SMS only”, roaming (not applicable)
+  QL_NW_REG_STATE_ATTACHED_EMERGENCY_ONLY=8, //attached for emergency bearer services only
+  QL_NW_REG_STATE_HOME_NETWORK_CSFB_NOT_PREFERRED=9, //registered for “CSFB not preferred”, home network (not applicable)
+  QL_NW_REG_STATE_ROAMING_CSFB_NOT_PREFERRED=10,//registered for “CSFB not preferred”, roaming (not applicable)
+  QL_NW_REG_STATE_EMERGENCY_ONLY=11,//emergency bearer services only
+}QL_NW_REG_STATE;
+
+typedef struct
+{
+	QL_NW_REG_STATE state; //注册状态
+	int lac;
+	int cid;
+	QL_NW_RADIO_TECHNOLOGY  rat;
+	int rejectCause;  //注册被拒绝的原因
+	int psc; //Primary Scrambling Code
+} QL_NW_COMMON_REG_STATUS_INFO_T;
+
+typedef struct
+{
+	QL_NW_COMMON_REG_STATUS_INFO_T voice_reg;  //VOICE注册信息,见QL_NW_COMMON_REG_STATUS_INFO_T
+	QL_NW_COMMON_REG_STATUS_INFO_T data_reg;   //DATA注册信息。
+}QL_NW_REG_STATUS_INFO_T;
+
+typedef struct
+{
+  int   nw_selection_mode; //0 自动;1手动
+  char  mcc[4];
+  char  mnc[4];
+  QL_NW_ACCESS_TECHNOLOGY  act;  //selection 制式,见QL_NW_ACCESS_TECHNOLOGY。
+}QL_NW_SELECTION_INFO_T;
+
+typedef struct {
+  int rssi;
+  int bitErrorRate;
+  int rscp;
+	int ecio;
+} QL_NW_GW_SIGNAL_STRENGTH_INFO_T;
+
+typedef struct {
+  int rssi;
+  int rsrp;
+  int rsrq;
+	int rssnr;
+	int cqi;
+} QL_NW_LTE_SIGNAL_STRENGTH_INFO_T;
+
+typedef struct {
+    QL_NW_GW_SIGNAL_STRENGTH_INFO_T   GW_SignalStrength;
+    QL_NW_LTE_SIGNAL_STRENGTH_INFO_T  LTE_SignalStrength;
+}QL_NW_SIGNAL_STRENGTH_INFO_T;
+
+/* CSQ: just get rssi and ber */
+typedef struct {
+  int rssi;
+  int bitErrorRate;
+} QL_NW_CSQ_SIGNAL_STRENGTH_INFO_T;
+
+typedef struct
+{
+    int flag;       /**Cell type, 0:present,1:neighbor.*/
+    int cid;        /**Cell ID, (0 indicates information is not represent).*/
+    int mcc;        /**This field should be ignored when cid is not present*/
+    int mnc;        /**This field should be ignored when cid is not present*/
+    int lac;        /**Location area code.(This field should be ignord when cid is not present). */
+    int arfcn;      /**Absolute RF channel number. */
+    char bsic;       /**Base station identity code. (0 indicates information is not present). */
+    int lenOfMnc;      /**Length of MNC, value range (2,3) */
+}QL_MCM_NW_GSM_CELL_INFO_T;
+
+typedef struct
+{
+    int flag;          /**Cell type, 0:present,1:inter,2:intra.*/
+    int cid;           /**Cell ID, (0 indicates information is not represent).*/
+    int lcid;          /**UTRAN Cell ID (0 indicates information is not present). */
+    int mcc;           /**This field should be ignored when cid is not present*/
+    int mnc;           /**This field should be ignored when cid is not present*/
+    int lac;           /**Location area code. (This field should be ignored when cid is not present). */
+    int uarfcn;        /**UTRA absolute RF channel number. */
+    int psc;           /**Primary scrambling code. */
+    int lenOfMnc;      /**Length of MNC, value range (2,3) */
+}QL_MCM_NW_UMTS_CELL_INFO_T;
+
+typedef struct
+{
+    int flag;          /**Cell type, 0:present,1:inter,2:intra.*/
+    int cid;           /**<Cell ID, (0 indicates information is not represent).*/
+    int mcc;           /**This field should be ignored when cid is not present*/
+    int mnc;           /**This field should be ignored when cid is not present*/
+    int tac;           /**Tracing area code (This field should be ignored when cid is not present). */
+    int pci;           /**Physical cell ID. Range: 0 to 503. */
+    int earfcn;        /**E-UTRA absolute radio frequency channel number of the cell. RANGE: 0 TO 65535. */
+    int lenOfMnc;      /**Length of MNC, value range (2,3) */
+    int rsrp;
+    int rsrq;
+}QL_MCM_NW_LTE_CELL_INFO_T;
+
+/** Gets cell information. */
+typedef struct
+{
+    int                 gsm_info_valid;                         /**< Must be set to TRUE if gsm_info is being passed. */
+    int                 gsm_info_num;                           /**< Must be set to the number of elements in entry*/
+    QL_MCM_NW_GSM_CELL_INFO_T    gsm_info[CELL_MAX_NUM];  /**<   GSM cell information (Serving and neighbor. */
+    int                 umts_info_valid;                        /**< Must be set to TRUE if umts_info is being passed. */
+    int                 umts_info_num;                          /**< Must be set to the number of elements in entry*/
+    QL_MCM_NW_UMTS_CELL_INFO_T   umts_info[CELL_MAX_NUM];/**<   UMTS cell information (Serving and neighbor). */
+    int                 lte_info_valid;                         /**< Must be set to TRUE if lte_info is being passed. */
+    int                 lte_info_num;                           /**< Must be set to the number of elements in entry*/
+    QL_MCM_NW_LTE_CELL_INFO_T    lte_info[CELL_MAX_NUM];  /**<   LTE cell information (Serving and neighbor). */
+}QL_NW_CELL_INFO_T;
+
+
+typedef void (*QL_NW_EventHandlerFunc_t)(unsigned int ind_flag, void *ind_msg_buf, unsigned int ind_msg_len, void *contextPtr);
+
+QL_NW_ERROR_CODE ql_nw_init ();
+QL_NW_ERROR_CODE ql_nw_release();
+QL_NW_ERROR_CODE ql_nw_set_config(QL_NW_CONFIG_INFO_T  *pt_info);
+QL_NW_ERROR_CODE ql_nw_get_config(QL_NW_CONFIG_INFO_T  *pt_info);
+QL_NW_ERROR_CODE ql_nw_get_nitz_time_info(QL_NW_NITZ_TIME_INFO_T *pt_info);
+QL_NW_ERROR_CODE ql_nw_event_register(unsigned int  bitmask);
+QL_NW_ERROR_CODE ql_nw_get_operator_name(QL_NW_OPERATOR_INFO_T  *pt_info);
+QL_NW_ERROR_CODE ql_nw_perform_scan(QL_NW_SCAN_RESULT_LIST_INFO_T   *pt_info);
+QL_NW_ERROR_CODE ql_nw_get_reg_status(QL_NW_REG_STATUS_INFO_T  *pt_info);
+QL_NW_ERROR_CODE ql_nw_set_selection(QL_NW_SELECTION_INFO_T  *pt_info);
+QL_NW_ERROR_CODE ql_nw_get_selection(QL_NW_SELECTION_INFO_T  *pt_info);
+QL_NW_ERROR_CODE ql_nw_get_signal_strength(QL_NW_SIGNAL_STRENGTH_INFO_T    *pt_info);
+QL_NW_ERROR_CODE ql_nw_get_cell_info(QL_NW_CELL_INFO_T  *pt_info);
+QL_NW_ERROR_CODE ql_nw_add_event_handler(QL_NW_EventHandlerFunc_t handlerPtr, void* contextPtr);
+QL_NW_ERROR_CODE ql_nw_get_volte_state(VOLTE_STATE *state);
+/* CSQ: just get rssi and ber */
+QL_NW_ERROR_CODE ql_nw_csq_get_signal_strength(QL_NW_CSQ_SIGNAL_STRENGTH_INFO_T    *pt_info);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/mbtk/include/ql/ql_oe.h b/mbtk/include/ql/ql_oe.h
new file mode 100755
index 0000000..ad4f7db
--- /dev/null
+++ b/mbtk/include/ql/ql_oe.h
@@ -0,0 +1,41 @@
+/**  
+  @file
+  ql_oe.h
+
+  @brief
+  Include related header file for quectel common api.
+
+*/
+/*============================================================================
+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+ =============================================================================*/
+/*===========================================================================
+
+                        EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+
+WHEN        WHO            WHAT, WHERE, WHY
+----------  ------------   ----------------------------------------------------
+24/07/2019  Nebula.li      create
+03/08/2019  Juson.zhang    add spi and uart head file
+03/08/2019  Carola.zhang   add i2c and gpio head file
+=============================================================================*/
+
+#ifndef _QL_OE_H_
+#define _QL_OE_H_
+
+#include "DSI_ConnectManager.h"
+#include "ql_log.h"
+
+//-------------------------peripheral head file-------------------//
+#include "ql_uart.h"
+#include "ql_spi.h"
+#include "ql_gpio.h"
+#include "ql_i2c.h"
+#include "ql_sms.h"
+
+#endif
diff --git a/mbtk/include/ql/ql_sgmii.h b/mbtk/include/ql/ql_sgmii.h
new file mode 100755
index 0000000..292ab8c
--- /dev/null
+++ b/mbtk/include/ql/ql_sgmii.h
@@ -0,0 +1,162 @@
+/**
+ * @file ql_sgmii.h
+ * @brief Quectel Openlinux SGMII public function declarations.
+ *
+ * @note
+ *
+ * @copyright Copyright (c) 2009-2017 @ Quectel Wireless Solutions Co., Ltd.
+ */
+
+#ifndef __QL_SGMII_H__
+#define __QL_SGMII_H__
+#include "mbtk_type.h"
+
+
+typedef enum {
+	QL_SGMII_AUTONEG_OFF = 0,
+	QL_SGMII_AUTONEG_ON
+} ql_sgmii_autoneg_e;
+
+typedef enum {
+	QL_SGMII_SPEED_10MHZ = 0,
+	QL_SGMII_SPEED_100MHZ,
+	QL_SGMII_SPEED_1000MHZ /* this speed can not support */
+} ql_sgmii_speed_e;
+
+typedef enum {
+	QL_SGMII_DUPLEX_FULL = 0,
+	QL_SGMII_DUPLEX_HALF
+} ql_sgmii_duplex_e;
+
+struct ql_sgmii_info {
+	ql_sgmii_autoneg_e autoneg;
+	ql_sgmii_speed_e speed;
+	ql_sgmii_duplex_e duplex;
+	unsigned long tx_bytes;
+	unsigned long rx_bytes;
+	unsigned long tx_pkts;
+	unsigned long rx_pkts;
+};
+
+/**
+ * Enables the SGMII ethernet module.
+ *
+ * @param None
+ *
+ * @return
+ *   On success, 0 is returned.  On error, -1 is returned.
+ *
+ */
+extern int ql_sgmii_enable(void);
+
+/**
+ * Disable the SGMII ethernet module.
+ *
+ * @param None
+ *
+ * @return
+ *   On success, 0 is returned.  On error, -1 is returned.
+ *
+ */
+extern int ql_sgmii_disable(void);
+
+/**
+ * Set the SGMII ethernet configuration: the ethernet auto negotiation configuration.
+ *
+ * @param [in]         auto negotiation
+ *
+ * @return
+ *   On success, 0 is returned.  On error, -1 is returned.
+ *
+ * @dependencies
+ *   the ql_sgmii_enable must be set enable
+ *
+ */
+extern int ql_sgmii_autoneg_set(ql_sgmii_autoneg_e autoneg);
+
+/**
+ * Get the SGMII ethernet configuration: the ethernet auto negotiation configuration.
+ *
+ * @param [out]         auto negotiation
+ *
+ * @return
+ *   On success, 0 is returned.  On error, -1 is returned.
+ *
+ * @dependencies
+ *   the ql_sgmii_enable must be set enable
+ *
+ */
+extern int ql_sgmii_autoneg_get(ql_sgmii_autoneg_e *autoneg);
+
+/**
+ * Set the SGMII ethernet configuration: the ethernet speed configuration.
+ *
+ * @param [in]         ethernet speed
+ *
+ * @return
+ *   On success, 0 is returned.  On error, -1 is returned.
+ *
+ * @dependencies
+ *   the ql_sgmii_enable must be set enable
+ *
+ */
+extern int ql_sgmii_speed_set(ql_sgmii_speed_e speed);
+
+/**
+ * Get the SGMII ethernet configuration: the ethernet speed configuration.
+ *
+ * @param [out]         the ethernet current speed
+ *
+ * @return
+ *   On success, 0 is returned.  On error, -1 is returned.
+ *
+ * @dependencies
+ *   the ql_sgmii_enable must be set enable
+ *
+ */
+extern int ql_sgmii_speed_get(ql_sgmii_speed_e *speed);
+
+/**
+ * Set the SGMII ethernet configuration: the ethernet duplex configuration.
+ *
+ * @param [in]         ethernet duplex
+ *
+ * @return
+ *   On success, 0 is returned.  On error, -1 is returned.
+ *
+ * @dependencies
+ *   the ql_sgmii_enable must be set enable
+ *
+ */
+extern int ql_sgmii_duplex_set(ql_sgmii_duplex_e duplex);
+
+/**
+ * Get the SGMII ethernet configuration: the ethernet duplex configuration.
+ *
+ * @param [out]         the ethernet current duplex
+ *
+ * @return
+ *   On success, 0 is returned.  On error, -1 is returned.
+ *
+ * @dependencies
+ *   the ql_sgmii_enable must be set enable
+ *
+ */
+extern int ql_sgmii_duplex_get(ql_sgmii_duplex_e *duplex);
+
+/**
+ * Get the sgmii ethernet information: transmit and receive bytes, transmit and receive packets, speed, duplex.
+ *
+ * @param [out]         the ethernet information
+ *
+ * @return
+ *   On success, 0 is returned.  On error, -1 is returned.
+ *
+ * @dependencies
+ *   the ql_sgmii_enable must be set enable
+ *
+ */
+extern int ql_smgii_info_get(struct ql_sgmii_info *info);
+
+
+#endif /* end of __QL_SGMII_H__ */
diff --git a/mbtk/include/ql/ql_sim.h b/mbtk/include/ql/ql_sim.h
new file mode 100755
index 0000000..38ad65c
--- /dev/null
+++ b/mbtk/include/ql/ql_sim.h
@@ -0,0 +1,840 @@
+/**  
+  @file
+  ql_sim.h
+
+  @brief
+  This file provides the definitions for sim, and declares the 
+  API functions.
+
+*/
+/*============================================================================
+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+ =============================================================================*/
+/*===========================================================================
+
+                        EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+
+WHEN        WHO            WHAT, WHERE, WHY
+----------  ------------   ----------------------------------------------------
+21/08/2019  Nebula.li      create
+=============================================================================*/
+
+#ifndef __QL_SIM_H__
+#define __QL_SIM_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef unsigned char UINT8;
+typedef unsigned short UINT16;
+typedef unsigned long UINT32;
+typedef unsigned int UINT;
+
+typedef enum 
+{
+	QL_SIM_SUCCESS,
+	QL_SIM_GENERIC_FAILURE,
+ 	QL_SIM_RADIO_NOT_AVAILABLE,
+    QL_SIM_INCORRECT_PASSWORD,
+    QL_SIM_CARD_NO_INSERTED,
+    QL_SIM_CARD_BUSY,
+    QL_SIM_CARD_BLOCKED,
+}QL_SIM_ERROR_CODE;
+
+
+#define QL_SIM_MCC_LEN      4   /**  Length of the MCC. */
+#define QL_SIM_MNC_MAX      4   /**  Maximum length of the MNC. */
+#define QL_SIM_PLMN_NUM_MAX 24  /**  Maximum number of PLMN data sets. */
+typedef struct 
+{
+    uint8_t mcc[QL_SIM_MCC_LEN];  /**< MCC value in ASCII characters.*/
+    uint8_t mnc[QL_SIM_MNC_MAX];  /**< MNC value in ASCII characters.*/
+}QL_SIM_PLMN_INFO;  
+typedef struct 
+{
+    uint32_t            preferred_operator_list_num;                    /**< Must be set to the number of elements in preferred_operator_list. */
+    QL_SIM_PLMN_INFO    preferred_operator_list[QL_SIM_PLMN_NUM_MAX];   /**< Preferred operator list. */
+}QL_SIM_PREFERRED_OPERATOR_LIST;    /* Message */
+
+#define QL_SIM_PIN_LEN_MAX  16   /**  Maximum length of PIN data. */ 
+#define QUEC_CI_SIM_MAX_CMD_DATA_SIZE  261
+
+typedef struct 
+{
+    uint8_t                     pin_value[QL_SIM_PIN_LEN_MAX];  /*  Value of the PIN */
+}QL_SIM_VERIFY_PIN_INFO;  
+
+typedef struct 
+{
+    uint8_t                     old_pin_value[QL_SIM_PIN_LEN_MAX];  /**< Value of the old PIN as a sequence of ASCII characters. */
+    uint8_t                     new_pin_value[QL_SIM_PIN_LEN_MAX];  /**< Value of the new PIN as a sequence of ASCII characters. */
+}QL_SIM_CHANGE_PIN_INFO;  
+
+typedef struct 
+{
+    uint8_t                     puk_value[QL_SIM_PIN_LEN_MAX];      /**< Value of the PUK as a sequence of ASCII characters. */
+    uint8_t                     new_pin_value[QL_SIM_PIN_LEN_MAX];  /**< Value of the new PIN as a sequence of ASCII characters. */
+}QL_SIM_UNBLOCK_PIN_INFO;  
+
+typedef enum 
+{
+    QL_SIM_STAT_NOT_INSERTED,
+    QL_SIM_STAT_READY,
+    QL_SIM_STAT_SIM_PIN,
+    QL_SIM_STAT_SIM_PUK,
+    QL_SIM_STAT_PH_SIM_LOCK_PIN,
+    QL_SIM_STAT_PH_SIM_LOCK_PUK,
+    QL_SIM_STAT_PH_FSIM_PIN,
+    QL_SIM_STAT_PH_FSIM_PUK,
+    QL_SIM_STAT_SIM_PIN2,
+    QL_SIM_STAT_SIM_PUK2,
+    QL_SIM_STAT_PH_NET_PIN,
+    QL_SIM_STAT_PH_NET_PUK,
+    QL_SIM_STAT_PH_NET_SUB_PIN,
+    QL_SIM_STAT_PH_NET_SUB_PUK,
+    QL_SIM_STAT_PH_SP_PIN,
+    QL_SIM_STAT_PH_SP_PUK,
+    QL_SIM_STAT_PH_CORP_PIN,
+    QL_SIM_STAT_PH_CORP_PUK,
+    QL_SIM_STAT_BUSY,
+    QL_SIM_STAT_BLOCKED,
+    QL_SIM_STAT_UNKNOWN
+}QL_SIM_CARD_STATE;    /**< Card state. */
+typedef enum 
+{
+    QL_SIM_CARD_TYPE_UNKNOWN  = 0,    /**<  Unidentified card type.  */
+    QL_SIM_CARD_TYPE_ICC      = 1,    /**<  Card of SIM or RUIM type.  */
+    QL_SIM_CARD_TYPE_UICC     = 2,    /**<  Card of USIM or CSIM type.  */
+}QL_SIM_CARD_TYPE;  
+
+typedef enum CI_SIM_PRIM
+{
+  CI_SIM_PRIM_EXECCMD_REQ = 1,						/**< \brief Requests to execute a SIM command \details   */
+  CI_SIM_PRIM_EXECCMD_CNF,							/**< \brief Confirms the request to execute a SIM command \details   */
+  CI_SIM_PRIM_DEVICE_IND,								/**< \brief Indicates that the current SIM status changed \details   */
+  CI_SIM_PRIM_PERSONALIZEME_REQ,						/**< \brief Requests that ME personalization be activated, deactivated, disabled, or queried \details   */
+  CI_SIM_PRIM_PERSONALIZEME_CNF,						/**< \brief Confirms the request to activate, deactivate, disable, or query ME personalization \details   */
+  CI_SIM_PRIM_OPERCHV_REQ,							/**< \brief Requests that CHVs be verified, enabled, disabled, changed, unblocked, or queried \details   */
+  CI_SIM_PRIM_OPERCHV_CNF,							/**< \brief Confirms the request to verify, enable, disable, change, unblock, or query CHVs \details   */
+  CI_SIM_PRIM_DOWNLOADPROFILE_REQ,					/**< \brief Requests a download of the profile that shows ME capabilities relevant to SIM Application Toolkit functionality \details The functionality of this primitive is equivalent to using the SIM command TERMINAL PROFILE in the CI_SIM_PRIM_EXECCMD_REQ primitive.
+  *  This primitive saves upper layer effort to build a header for the Terminal Profile SIM command.
+  *  If the pProfile pointer is NULL for this request, the communications interface assumes that the application layer does not support
+  *  SIM Application Toolkit operations.  */
+  CI_SIM_PRIM_DOWNLOADPROFILE_CNF,					/**< \brief Confirms the request to download the profile that shows ME capabilities relevant to SIM Application Toolkit functionality  \details   */
+  CI_SIM_PRIM_ENDATSESSION_IND,						/**< \brief  \details NOT SUPPORTED REMOVE FROM API  */
+  CI_SIM_PRIM_PROACTIVE_CMD_IND,						/**< \brief Indicates a SIMAT proactive command  \details This primitive forwards the SIMAT proactive command with its original syntax. The primitive CI_SIM_PRIM_ENABLE_SIMAT_INDS_REQ enables and disables proactive command indication.  */
+  CI_SIM_PRIM_PROACTIVE_CMD_RSP,						/**< \brief Responds to the SIMAT proactive command  \details The primitive forwards a SIMAT proactive command response from the entity, such as DISPLAY or TERMINAL, that received the proactive command.  */
+  CI_SIM_PRIM_ENVELOPE_CMD_REQ,						/**< \brief Requests that an ENVELOPE command be executed \details   */
+  CI_SIM_PRIM_ENVELOPE_CMD_CNF,						/**< \brief Confirms the request to execute an ENVELOPE command  \details   */
+  CI_SIM_PRIM_GET_SUBSCRIBER_ID_REQ,					/**< \brief Requests the subscriber ID \details   */
+  CI_SIM_PRIM_GET_SUBSCRIBER_ID_CNF,					/**< \brief Confirms the request for the subscriber ID  \details   */
+  CI_SIM_PRIM_GET_PIN_STATE_REQ,						/**< \brief Requests the current PIN state \details   */
+  CI_SIM_PRIM_GET_PIN_STATE_CNF,						/**< \brief Confirms the request for the current PIN state \details   */
+  CI_SIM_PRIM_GET_TERMINALPROFILE_REQ,				/**< \brief Requests the SIMAT terminal profile  \details   */
+  CI_SIM_PRIM_GET_TERMINALPROFILE_CNF,				/**< \brief Confirms the request and returns the SIMAT terminal profile \details   */
+  CI_SIM_PRIM_ENABLE_SIMAT_INDS_REQ,					/**< \brief Requests that SIMAT related indications, such as the proactive SIM command indication and the SIMAT session ended indication, be enabled or disabled  \details   */
+  CI_SIM_PRIM_ENABLE_SIMAT_INDS_CNF,					/**< \brief Confirms the request to enable or disable SIMAT related indications  \details   */
+  CI_SIM_PRIM_LOCK_FACILITY_REQ,						/**< \brief Requests to lock, unlock, or query SIM-related ME  \details   */
+  CI_SIM_PRIM_LOCK_FACILITY_CNF,						/**< \brief Confirms a request to lock, unlock, or query SIM-related ME  \details   */
+  CI_SIM_PRIM_GET_FACILITY_CAP_REQ,					/**< \brief Requests the bitmask of supported SIM-related facility codes \details   */
+  CI_SIM_PRIM_GET_FACILITY_CAP_CNF,					/**< \brief Confirms the request for the bitmask of supported SIM-related facility codes \details   */
+  CI_SIM_PRIM_GET_SIMAT_NOTIFY_CAP_REQ,				/**< \brief Requests SIM Application Toolkit (SIMAT) notification capability information. \details   */
+  CI_SIM_PRIM_GET_SIMAT_NOTIFY_CAP_CNF,				/**< \brief Confirms the request for SIM Application Toolkit (SIMAT) notification capability information \details   */
+  CI_SIM_PRIM_GET_CALL_SETUP_ACK_IND,				/**< \brief Indicates that the SIM Application Toolkit (SIMAT) has initiated an outgoing CALL SETUP operation, and requests confirmation/acknowledgment from the mobile user \details The application returns the required acknowledgment in a CI_SIM_PRIM_GET_CALL_SETUP_ACK_RSP response.  */
+  CI_SIM_PRIM_GET_CALL_SETUP_ACK_RSP,				/**< \brief Responds with an acknowledgment from the mobile user for an outgoing CALL SETUP indication  \details The mobile user may accept (allow) or reject (disallow) the SIMAT initiated CALL SETUP operation.
+*     If the user allows the CALL SETUP, it proceeds. If the user disallows the CALL SETUP, it is aborted.
+*     If the CALL SETUP is allowed to proceed, the MO call progression is managed by the normal call control procedures. See the
+*     CI CC Service Group API definition for more information.  */
+
+  /* service provider name */
+  CI_SIM_PRIM_GET_SERVICE_PROVIDER_NAME_REQ,		/**< \brief Requests the service provider name, as stored on SIM or USIM \details The PIN status is not required to read this information.  */
+  CI_SIM_PRIM_GET_SERVICE_PROVIDER_NAME_CNF,		/**< \brief Confirms the request to get the service provider name, as stored on SIM or USIM \details The service provider name is coded as 7-bit GSM characters, with the most-significant bit of each character set to zero.
+  *  The service provider name pointer is NULL if the result code indicates an error.  */
+
+  /* Message Waiting Information */
+  CI_SIM_PRIM_GET_MESSAGE_WAITING_INFO_REQ,		/**< \brief Requests to get message waiting information stored on SIM or USIM \details The PIN status is required to read this information.  */
+  CI_SIM_PRIM_GET_MESSAGE_WAITING_INFO_CNF,			/**< \brief Confirms the request to get message waiting information stored on SIM or USIM \details If the result code indicates an error, the message waiting status information is not useful.
+  *  There is a difference between the message categories defined for 2G and 3G SIM storage. This is rationalized by the CCI implementation.  */
+  CI_SIM_PRIM_SET_MESSAGE_WAITING_INFO_REQ,			/**< \brief Requests to set message waiting information on SIM or USIM  \details Requires PIN status to write this information. There is a difference between the message categories defined for 2G and 3G SIM storage. This is rationalized by the CCI implementation.  */
+  CI_SIM_PRIM_SET_MESSAGE_WAITING_INFO_CNF,			/**< \brief Confirms a request to set the message waiting information on SIM or USIM \details   */
+
+  /* SIM Service Table */
+  CI_SIM_PRIM_GET_SIM_SERVICE_TABLE_REQ,				/**< \brief Requests to get the SIM Service Table from SIM or USIM  \details The PIN status is required to read this information. If CPHS features are not supported by the handset, this information is unavailable.  */
+  CI_SIM_PRIM_GET_SIM_SERVICE_TABLE_CNF,				/**< \brief Confirms the request to get the SIM Service Table from SIM or USIM \details If CPHS features are not supported by the handset, this information is unavailable.  */
+
+  /* CPHS Customer Service Profile */
+  CI_SIM_PRIM_GET_CUSTOMER_SERVICE_PROFILE_REQ,	/**< \brief Requests to get the CPHS customer service profile from SIM or USIM \details The PIN status is required to read this information. If CPHS features are not supported by the handset, this information is unavailable. */
+  CI_SIM_PRIM_GET_CUSTOMER_SERVICE_PROFILE_CNF,	/**< \brief Confirms the request and returns the CPHS customer service profile from SIM or USIM. \details If CPHS features are not supported by the handset, this information is unavailable.  */
+
+  /* Display Alpha and Icon Identifiers */
+  CI_SIM_PRIM_SIMAT_DISPLAY_INFO_IND,					/**< \brief Indicates to the application that text and optionally an icon should be displayed.
+														 *  The text to be displayed results from a SAT transaction such as SS, SMS, USSD, SS, or send DTMF. \details   */
+
+  /* Default Language */
+  CI_SIM_PRIM_GET_DEFAULT_LANGUAGE_REQ,			/**< \brief Requests the default language stored on the SIM/USIM card \details   */
+  CI_SIM_PRIM_GET_DEFAULT_LANGUAGE_CNF,				/**< \brief Confirms the request to get the default language stored on the SIM/USIM card and returns the first entry in the EF_LP file \details Extract from ETSI TS 102.221: "the language code is a pair of alphanumeric characters, as defined in ISO 639 [30].
+  *  Each alphanumeric character shall be coded on one byte using the SMS default 7-bit coded alphabet as defined in TS 23.038
+  *  ("Man-machine Interface (MMI) of the User Equipment", revision 3.4.0, Doc Number 3GPP TS 22.030)
+  *  with bit 8 set to 0.". 'FF FF' means undefined default language.  */
+
+  /* Generic SIM commands */
+  CI_SIM_PRIM_GENERIC_CMD_REQ,						/**< \brief Requests to send a generic command to the SIM/USIM card
+													 * \details The request reflects the structure of a SIM application protocol data unit (APDU),
+													 * as defined in ETSI 102.221. The 'class of instruction' element is not controlled by the user, comm. use class 0x0 or 0xa depending on the command.
+													 * Note that updating a file using this command only updates the file on the SIM; it does not trigger a REFRESH of the ME memory. */
+  CI_SIM_PRIM_GENERIC_CMD_CNF,						/**< \brief Confirms a request to send a generic command to the SIM or USIM  \details  */
+
+  /* Indication of card type, status and PIN state */
+  CI_SIM_PRIM_CARD_IND,								/**< \brief Indicates that the current SIM/USIM status changed \details This indication is sent each time CI_SIM_PRIM_DEVICE_IND is sent.  */
+
+  CI_SIM_PRIM_IS_EMERGENCY_NUMBER_REQ,				/**< \brief Requests to determine if the specified dial number is an emergency call code \details   */
+  CI_SIM_PRIM_IS_EMERGENCY_NUMBER_CNF,				/**< \brief Confirms the request to determine if the specified number is an emergency call code \details If a SIM card is present, the EF_ECC SIM card file is searched for the specified number. If a SIM card is not present, a default table of possible emergency call codes is searched for the specified number, as per TS 22.101. */
+
+  CI_SIM_PRIM_SIM_OWNED_IND,							/**< \brief Indicates whether the SIM is owned
+														 * \details This indication is sent each time a SIM-OK notification is received
+ * from the protocol stack and indicates that the SIM card can be accessed. SIM owned is TRUE if the IMSI did not change
+ * since the last SIM-OK notification.  */
+  CI_SIM_PRIM_SIM_CHANGED_IND,						/**< \brief Indicates whether the IMSI on the current SIM has changed
+													 * \details  This indication is sent each time a SIM-OK notification is received
+ * from the protocol stack. */
+  CI_SIM_PRIM_DEVICE_STATUS_REQ,						/**< \brief Requests SIM status \details   */
+  CI_SIM_PRIM_DEVICE_STATUS_CNF,						/**< \brief Confirms the request for the current SIM status \details   */
+  CI_SIM_PRIM_READ_MEP_CODES_REQ,			/**< \brief   Requests the MEP codes for a specified category  \details This operation does not require a password.*/
+  CI_SIM_PRIM_READ_MEP_CODES_CNF,			/**< \brief   Confirms the request and returns the MEP codes for the specified category \details */
+  CI_SIM_PRIM_UDP_LOCK_REQ, 					/**< \brief   Requests an activate, deactivate, or query UDP lock  \details  An operation can be done on only one category at a time. A password is required for an unlock operation. */
+  CI_SIM_PRIM_UDP_LOCK_CNF, 					/**< \brief   Confirms the UDP lock request \details */
+  CI_SIM_PRIM_UDP_CHANGE_PASSWORD_REQ,  	/**< \brief   Requests to set a new password for a UDP lock \details */
+  CI_SIM_PRIM_UDP_CHANGE_PASSWORD_CNF, 	/**< \brief   Confirms the request to set a new password for a UDP lock \details */
+  CI_SIM_PRIM_UDP_ASL_REQ,					/**< \brief  Requests to manipulate the UDP authorized SIM list \details */
+  CI_SIM_PRIM_UDP_ASL_CNF,					/**< \brief  Confirms the request to manipulate the UDP authorized SIM list  \details */
+/* Michal Bukai - Virtual SIM support - START */
+   CI_SIM_PRIM_SET_VSIM_REQ,                /**< \brief  Requests to enable virtual SIM
+											 * \details Virtual SIM can be enabled if no SIM is inserted.
+											 * An error is sent if the user tried to enable virtual SIM while a SIM is inserted.
+											 * The application needs to reset the communication subsystem after receiving a confirmation. */
+   CI_SIM_PRIM_SET_VSIM_CNF,                 /**< \brief Confirms setting virtual SIM
+											  * \details Virtual SIM can be enabled if no SIM is inserted.
+											 * An error is sent if the user tried to enable virtual SIM while a SIM is inserted.
+											 * The application needs to reset the communication subsystem after receiving a confirmation. */
+   CI_SIM_PRIM_GET_VSIM_REQ,                 /**< \brief Requests the current setting of the virtual SIM (enabled / disabled) \details*/
+   CI_SIM_PRIM_GET_VSIM_CNF,                 /**< \brief Confirms the request and returns the current setting of the virtual SIM (enabled / disabled) \details*/
+/* Michal Bukai - Virtual SIM support - END */
+/*Michal Bukai - OTA support for AT&T - START*/
+  CI_SIM_PRIM_CHECK_MMI_STATE_IND,	/**< \brief  \details NOT SUPPORTED REMOVE FROM API  */
+  CI_SIM_PRIM_CHECK_MMI_STATE_RSP,	/**< \brief  \details NOT SUPPORTED REMOVE FROM API  */
+/*Michal Bukai - OTA support for AT&T - END*/
+/*Michal Bukai - BT SAP support - START*/
+  CI_SIM_PRIM_BTSAP_CONNECT_REQ,					/**< \brief Requests to start a BT SAP session \details */
+  CI_SIM_PRIM_BTSAP_CONNECT_CNF,					/**< \brief Confirms the request to start a BT SAP session \details */
+  CI_SIM_PRIM_BTSAP_DISCONNECT_REQ, 				/**< \brief Requests to disconnect from a BT SAP session \details */
+  CI_SIM_PRIM_BTSAP_DISCONNECT_CNF, 				/**< \brief Confirms the request to disconnect from a BT SAP session \details */
+  CI_SIM_PRIM_BTSAP_TRANSFER_APDU_REQ,				/**< \brief Requests to transfer APDU to the SIM/USIM \details */
+  CI_SIM_PRIM_BTSAP_TRANSFER_APDU_CNF,				/**< \brief Confirms the request to transfer APDU to the SIM/USIM and may return a response APDU from the SIM/USIM \details */
+  CI_SIM_PRIM_BTSAP_TRANSFER_ATR_REQ,				/**< \brief Requests to get Answer To Reset data from SIM/USIM \details */
+  CI_SIM_PRIM_BTSAP_TRANSFER_ATR_CNF,				/**< \brief Confirms the request to get Answer To Reset data from SIM/USIM \details */
+  CI_SIM_PRIM_BTSAP_SIM_CONTROL_REQ,				/**< \brief Requests to control SIM/USIM status, this command can be used to power off, power on or reset the SIM/USIM \details */
+  CI_SIM_PRIM_BTSAP_SIM_CONTROL_CNF,				/**< \brief Confirms the SIM control request \details */
+  CI_SIM_PRIM_BTSAP_STATUS_IND,						/**< \brief indicates a change in the availably of the subscription module during BT SAP connection \details */
+  CI_SIM_PRIM_BTSAP_STATUS_REQ,						/**< \brief Requests the subscription module availability status during BT SAP connection \details */
+  CI_SIM_PRIM_BTSAP_STATUS_CNF,						/**< \brief Confirms the request and returns the status of the subscription module during BT SAP connection \details */
+  CI_SIM_PRIM_BTSAP_SET_TRANSPORT_PROTOCOL_REQ,		/**< \brief Requests to set transport protocol \details */
+  CI_SIM_PRIM_BTSAP_SET_TRANSPORT_PROTOCOL_CNF,		/**< \brief Confirms the request to set transport protocol \details */
+/*Michal Bukai - BT SAP support - END*/
+/*Michal Bukai - Add IMSI to MEP code group - START*/
+  CI_SIM_PRIM_MEP_ADD_IMSI_REQ,	/**< \brief  Requests to add the current IMSI to MEP SIM /USIM code group
+								* \details This operation requires a password.
+								* This operation requires that SIM/USIM personalization is deactivated.*/
+  CI_SIM_PRIM_MEP_ADD_IMSI_CNF,	/**< \brief Confirms the request to add the current IMSI to MEP SIM /USIM code group. \details   */
+/*Michal Bukai - Add IMSI to MEP code group - END*/
+/*Michal Bukai - SIM Logic CH - NFC\ISIM support - START*/
+  CI_SIM_PRIM_OPEN_LOGICAL_CHANNEL_REQ,		/**< \brief  Requests to open a logical channel that will be used to access the UICC application identified by DFname.  \details The UICC will open a new logical channel; select the application identified by the DFname, and return a session ID that will be used to identify the new channel.*/
+  CI_SIM_PRIM_OPEN_LOGICAL_CHANNEL_CNF,		/**< \brief  Confirms the request to open a logical channel and returns the session ID.  \details */
+  CI_SIM_PRIM_CLOSE_LOGICAL_CHANNEL_REQ,	/**< \brief  Requests to close a logical channel.  \details */
+  CI_SIM_PRIM_CLOSE_LOGICAL_CHANNEL_CNF,	/**< \brief  Confirms the request to close a logical channel.  \details */
+/*Michal Bukai - SIM Logic CH - NFC\ISIM support support - END*/
+/*Michal Bukai - additional SIMAT primitives - START*/
+  CI_SIM_PRIM_SIMAT_CC_STATUS_IND,					/**< \brief Indicates the SIM Application Toolkit (SIMAT) call control status response 
+													* \details If call control service in SIMAT is activated, all dialled digit strings, supplementary service control strings and USSD strings are passed to the UICC before the call setup request, 
+													* the supplementary service operation or the USSD operation is sent to the network.
+													* The SIMAT has the ability to allow, bar or modify the request. 
+													* In addition SIMAT has the ability to replace the request by another operation, for instance call request may be replaced by SS or USSD operation.
+													*/
+  CI_SIM_PRIM_SIMAT_SEND_CALL_SETUP_RSP_IND,		/**< \brief Indicates the response sent to SIM Application Toolkit (SIMAT) after call setup. \details */
+  CI_SIM_PRIM_SIMAT_SEND_SS_USSD_RSP_IND, 			/**< \brief Indicates the response sent to SIM Application Toolkit (SIMAT) after SS or USSD operation. \details */
+  CI_SIM_PRIM_SIMAT_SM_CONTROL_STATUS_IND, 			/**< \brief Indicates the SIM Application Toolkit (SIMAT) short message control status response. 
+													\details If SM control service in SIMAT is activated, all MO short messages are passed to the UICC before the short message is sent to the network.
+													* The SIMAT has the ability to allow, bar or modify the destination address.
+													*/
+  CI_SIM_PRIM_SIMAT_SEND_SM_RSP_IND,				/**< \brief Indicates the response sent to SIM Application Toolkit (SIMAT) after SM operation. \details */
+/*Michal Bukai - additional SIMAT primitives - END*/
+
+/*Michal Bukai - RSAP support - START*/
+  CI_SIM_PRIM_RSAP_CONN_REQ_IND,		/**< \brief  Request to connect to a remote SIM received from the protocol stack \details */
+  CI_SIM_PRIM_RSAP_CONN_REQ_RSP,		/**< \Response to protocol stack request to connect to a remote SIM \details */
+  CI_SIM_PRIM_RSAP_STAT_REQ,			/**< \brief  Request received from a SAP conversion module to update the RSAP card status. 
+										* \details This request is actually an indication from a remote SAP conversion module indicating a status change in the remote connection or card status */
+  CI_SIM_PRIM_RSAP_STAT_CNF,			/**< \brief  Confirms that the update of the remote card status was received by the protocol stack \details */
+  CI_SIM_PRIM_RSAP_DISCONN_REQ_IND,		/**< \brief  Request to disconnect from a remote SIM received from the protocol stack \details */
+  CI_SIM_PRIM_RSAP_DISCONN_REQ_RSP,		/**< \Response to protocol stack request to disconnect from a remote SIM \details */
+  CI_SIM_PRIM_RSAP_GET_ATR_IND,			/**< \brief Request to get ATR from a remote SIM received from the protocol stack \details */
+  CI_SIM_PRIM_RSAP_GET_ATR_RSP,			/**< \brief Response from a remote SIM with the ATR APDU \details */
+  CI_SIM_PRIM_RSAP_GET_STATUS_REQ_IND,	/**< \brief  Request from the protocol stack to get the RSAP connection status. 
+										* \details The request is answered by CI_SIM_PRIM_RSAP_CONN_STAT_REQ */
+
+  CI_SIM_PRIM_RSAP_SET_TRAN_P_REQ_IND,	/**< \brief Request from the protocol stack to change the transport protocol of the remote SIM \details */
+  CI_SIM_PRIM_RSAP_SET_TRAN_P_REQ_RSP,	/**< \brief Response to a protocol stack request to change the transport protocol of the remote SIM.
+										* \details If the requested transport protocol is supported by the remote SIM and by the SAP conversion module, 
+										* the requested transport protocol is selected and the remote SIM is reset.	If the requested transport protocol is not supported, 
+										* SIM status is changed to CARD_NOT_ACC. The request is followed by CI_SIM_PRIM_RSAP_CONN_STAT_REQ, which indicates the new remote SIM status.*/
+  CI_SIM_PRIM_RSAP_SIM_CONTROL_REQ_IND,	/**< \brief  Request from the protocol stack to control the remote SIM status. 
+										* \details This command can be used to power off, power on, or reset the remote SIM */
+  CI_SIM_PRIM_RSAP_SIM_CONTROL_REQ_RSP,	/**< \brief  Response to a protocol stack request to control the remote SIM status. 
+										* \details The response is followed by CI_SIM_PRIM_RSAP_CONN_STAT_REQ, which indicates the new status of the remote SIM.*/
+  CI_SIM_PRIM_RSAP_SIM_SELECT_REQ,		/**< \brief Request to select the local or remote SIM \details */
+  CI_SIM_PRIM_RSAP_SIM_SELECT_CNF,		/**< \brief Confirms the request to select the local or remote SIM \details */
+  CI_SIM_PRIM_RSAP_STATUS_IND,			/**< \brief Indicates that the current SIM/USIM status changed during RSAP connection \details */
+  CI_SIM_PRIM_RSAP_TRANSFER_APDU_IND,	/**< \brief Request from the protocol stack to transfer APDU to the remote SIM \details */
+  CI_SIM_PRIM_RSAP_TRANSFER_APDU_RSP,	/**< \brief Request from the protocol stack to transfer APDU to the remote SIM. 
+										* \details A response APDU is returned if the transfer of APDU is successful.*/
+  /*Michal Bukai - RSAP support - END*/
+
+  CI_SIM_PRIM_DEVICE_RSP, 				/**< \brief Response to CI_SIM_PRIM_DEVICE_RSP.
+										* \details This response is confirms that the CI_SIM_PRIM_DEVICE_RSP has been received and handled. Specially the SIM clock stop level. This indicates the Comm that D2 can be enabled on SIM driver level.*/
+//ICC ID feature
+  CI_SIM_PRIM_ICCID_IND, 				/**< \brief Indicates the content of the EF-ICCID file. This indication is sent at init. The EF-ICCID can be accessed even if PIN is required.*/
+  CI_SIM_PRIM_GET_ICCID_REQ, 			/**< \brief Request to get the content of the EF-ICCID file. Can be sent if ICC is ready.
+										* \details Can be sent when the SIM state is CI_SIM_ST_READY or CI_SIM_ST_INSERTED.	Otherwise the request will fail.*/
+
+  CI_SIM_PRIM_GET_ICCID_CNF,			/**< \brief Confirmation with the ICC id to the request to get the ICC Id.*/
+//ICC ID feature
+  CI_SIM_PRIM_EAP_AUTHENTICATION_REQ,	/**< \brief Requests to exchange EAP packets with the UICC. */
+  CI_SIM_PRIM_EAP_AUTHENTICATION_CNF,	/**< \brief Confirms the EAP authentication request and returns the authentication response */
+
+  CI_SIM_EAP_RETRIEVE_PARAMETERS_REQ, /**< \brief Requests to retrieve EAP parameters from the UICC. */
+  CI_SIM_EAP_RETRIEVE_PARAMETERS_CNF, /**< \brief Confirms the request to retrieve EAP parameters and returns the contents of the
+										* \elementary file corresponding to requested parameter.*/
+
+  CI_SIM_PRIM_GET_NUM_UICC_APPLICATIONS_REQ,/**< \brief Requests to get number of applications available on the UICC. */
+  CI_SIM_PRIM_GET_NUM_UICC_APPLICATIONS_CNF,/**< \brief Confirms the request to get number of applications available on the UICC. */
+
+  CI_SIM_PRIM_GET_UICC_APPLICATIONS_INFO_REQ, /**< \brief Requests to get list of applications available on the UICC. */
+  CI_SIM_PRIM_GET_UICC_APPLICATIONS_INFO_CNF, /**< \brief Confirms the request to get list of applications available on the UICC. */
+  /* ADD NEW COMMON PRIMITIVES HERE, BEFORE 'CI_SIM_PRIM_LAST_COMMON_PRIM' */
+  /*2013.12.11, added by Xili for CQ00051618, begin*/
+  CI_SIM_PRIM_ISIM_AID_IND,                         /**< \brief Indicates the content of the ISIM Aid. This indication is sent at init if it had one. */
+  /*2013.12.11, added by Xili for CQ00051618, end*/
+
+  /* Add by jungle for CQ00057999 on 2014-04-02 Begin */
+  CI_SIM_PRIM_APP_PIN_REQ,
+  CI_SIM_PRIM_APP_PIN_CNF,
+  /* Add by jungle for CQ00057999 on 2014-04-02 End*/
+
+  /*2014.05.08, added by Xili for CQ00060947, begin*/
+  CI_SIM_PRIM_ADMIN_DATA_IND,  
+  /*2014.05.08, added by Xili for CQ00060947, end*/
+
+  /*2015.03.19, mod by Xili for adding ECC list indication, CQ00088196 begin*/
+  CI_SIM_PRIM_ECC_LIST_IND,  
+  /*2015.03.19, mod by Xili for adding ECC list indication, CQ00088196 end*/
+
+  /* Mod by jungle for CQ00089692 on 2015-04-08 Begin */
+  CI_SIM_PRIM_EXEC_LARGE_CMD_CNF,
+  CI_SIM_PRIM_GENERIC_LARGE_CMD_CNF,
+  /* Mod by jungle for CQ00089692 on 2015-04-08 End */
+
+  CI_SIM_PRIM_UPDATE_COUNT_REQ,
+  CI_SIM_PRIM_UPDATE_COUNT_CNF,
+  
+  /* END OF COMMON PRIMITIVES LIST */
+  CI_SIM_PRIM_LAST_COMMON_PRIM
+
+  /* The customer specific extension primitives are added starting from
+  * CI_SIM_PRIM_firstCustPrim = CI_SIM_PRIM_LAST_COMMON_PRIM as the first identifier.
+  * The actual primitive names and IDs are defined in the associated
+  * 'ci_sim_cust_xxx.h' file.
+  */
+
+  /* DO NOT ADD ANY MORE PRIMITIVES HERE */
+
+} _QuecCiSimPrim;
+
+typedef struct 
+{
+    uint8_t                         pin1_num_retries;       /**<   Number of PIN 1 retries. */
+    uint8_t                         puk1_num_retries;       /**<   Number of PUK 1 retries. */
+    uint8_t                         pin2_num_retries;       /**<   Number of PIN 2 retries. */
+    uint8_t                         puk2_num_retries;       /**<   Number of PUK 2 retries. */
+}QL_SIM_CARD_PIN_INFO;  
+ 
+typedef struct 
+{
+    QL_SIM_CARD_TYPE      card_type; // SIM card type
+    QL_SIM_CARD_STATE     card_state;  //SIM card state
+    QL_SIM_CARD_PIN_INFO  card_pin_info; // PIN info
+}QL_SIM_CARD_STATUS_INFO;  
+
+
+#define QL_SIM_DATA_LEN_MAX     255
+typedef struct 
+{
+    uint32_t    data_len;                        /**< Must be set to the number of elements in data. */
+    uint8_t     data[QL_SIM_DATA_LEN_MAX];       /**< Data retrieved from the card. */
+}QL_SIM_CARD_FILE_DATA;  
+ 
+typedef enum 
+{
+    QL_SIM_FILE_TYPE_UNKNOWN      = 0,/**<  Unknown file type  */
+    QL_SIM_FILE_TYPE_TRANSPARENT  = 1,/**< File structure consisting of a sequence of bytes.  */
+    QL_SIM_FILE_TYPE_CYCLIC       = 2,/**< File structure consisting of a sequence of records, each containing the same fixed size in 
+                                                     chronological order. Once all the records have been used, the oldest data is overwritten.  */
+    QL_SIM_FILE_TYPE_LINEAR_FIXED  = 3,    /**< File structure consisting of a sequence of records, each containing the same fixed size.  */
+}QL_SIM_FILE_TYPE;
+
+typedef enum 
+{
+    QL_SIM_FILE_ACCESS_TYPE_ALWAYS      =0,
+    QL_SIM_FILE_ACCESS_TYPE_CHV1        =1,
+    QL_SIM_FILE_ACCESS_TYPE_CHV2        =2,
+    QL_SIM_FILE_ACCESS_TYPE_ADM         =3,
+}QL_SIM_FILE_ACCESS_TYPE;
+
+typedef enum 
+{
+    QL_SIM_FILE_STATUS_INVALID      =0,
+    QL_SIM_FILE_STATUS_EFFECTIVE    =1,
+}QL_SIM_FILE_STATUS;
+
+typedef struct 
+{
+    QL_SIM_FILE_ACCESS_TYPE read_access;
+    QL_SIM_FILE_ACCESS_TYPE update_access;
+}QL_SIM_FILE_ACCESS_INFO;
+
+typedef struct 
+{
+    unsigned int                id;
+    QL_SIM_FILE_TYPE            type;    /**<   File type: */
+    QL_SIM_FILE_ACCESS_INFO     access;    /**<   File access conditions: */
+    QL_SIM_FILE_STATUS          status;    /**<   File status: */
+    unsigned int                size;      /**<   Size of transparent files.*/
+    unsigned int                record_len;    /**<   Size of each cyclic or linear fixed file record.*/
+    unsigned int                record_count;   /**<   Number of cyclic or linear fixed file records.*/
+}QL_SIM_FILE_INFO;  
+
+typedef struct 
+{
+    int sw1;
+    int sw2;
+}QL_SIM_FILE_OPERATION_RET;
+
+typedef struct 
+{ // when write, if phonenum is empty, it means to delete this item specified by index  
+    int          index;  // the record index in phone book
+    uint8_t      username[32];   //  username
+    uint8_t      phonenum[24];   //  Phone number, it can include '+'*/
+}QL_SIM_PHONE_BOOK_RECORD_INFO;
+
+typedef struct
+{
+    int total;      //total number of locations
+    int used;       //used number of locations
+}QL_SIM_PHONEBOOK_STATE;
+
+#define QL_SIM_PHONE_BOOK_RECORDS_MAX_COUNT 20
+typedef struct 
+{
+    int record_count;  //the count of record
+    QL_SIM_PHONE_BOOK_RECORD_INFO record[QL_SIM_PHONE_BOOK_RECORDS_MAX_COUNT]; // the list of record
+}QL_SIM_PHONE_BOOK_RECORDS_INFO;
+
+typedef enum
+{
+    QL_SIM_PHONE_BOOK_STORAGE_DC,
+    QL_SIM_PHONE_BOOK_STORAGE_EN,
+    QL_SIM_PHONE_BOOK_STORAGE_FD,
+    QL_SIM_PHONE_BOOK_STORAGE_LD,
+    QL_SIM_PHONE_BOOK_STORAGE_MC,
+    QL_SIM_PHONE_BOOK_STORAGE_ME,
+    QL_SIM_PHONE_BOOK_STORAGE_MT,
+    QL_SIM_PHONE_BOOK_STORAGE_ON,
+    QL_SIM_PHONE_BOOK_STORAGE_RC,
+    QL_SIM_PHONE_BOOK_STORAGE_SM,
+    QL_SIM_PHONE_BOOK_STORAGE_AP,
+    QL_SIM_PHONE_BOOK_STORAGE_MBDN,
+    QL_SIM_PHONE_BOOK_STORAGE_MN,
+    QL_SIM_PHONE_BOOK_STORAGE_SDN,
+    QL_SIM_PHONE_BOOK_STORAGE_ICI,
+    QL_SIM_PHONE_BOOK_STORAGE_OCI,
+}QL_SIM_PHONE_BOOK_STORAGE;
+
+
+
+typedef enum 
+{
+    QL_SIM_CARD_STATUS_UPDATE_EVENT   = 0,    /**< Card status update event.  */
+    
+}QL_SIM_NFY_MSG_ID;  
+
+typedef void (*QL_SIM_CardStatusIndMsgHandlerFunc_t)   
+(    
+    QL_SIM_NFY_MSG_ID     msg_id,
+    void                  *pv_data,
+    int                   pv_data_len,
+    void                  *contextPtr    
+);
+
+
+QL_SIM_ERROR_CODE ql_sim_init();
+
+QL_SIM_ERROR_CODE ql_sim_release();
+
+/* Add callback function if anything changed specified by the mask in QL_LOC_Set_Indications*/
+QL_SIM_ERROR_CODE ql_sim_add_event_handler(QL_SIM_CardStatusIndMsgHandlerFunc_t handlerPtr, void* contextPtr);
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_get_imsi
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to retrieve the IMSI (for 3GPP)
+    or IMSI_M (for 3GPP2) from the SIM in ASCII form
+
+    @return
+    void
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_get_imsi
+(
+    uint8_t   *imsi,      ///< [OUT] IMSI buffer
+    size_t    imsiLen     ///< [IN] IMSI buffer length
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_get_iccid
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to retrieve the ICCID from
+    SIM in ASCII form
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_get_iccid
+(
+    uint8_t    *iccid,    ///< [OUT] ICCID
+    size_t     iccidLen   ///< [IN] ICCID buffer length
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  QL_SIM_GetPhoql_sim_get_phonenumberneNumber
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to retrieve the device phone
+    number from MSISDN (for 3GPP) or MDN (for 3GPP2) from the SIM in
+    ASCII form
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_get_phonenumber
+(
+    uint8_t   *phone_num, ///< [OUT] phone number
+    size_t    phoneLen    ///< [IN] phone number buffer length
+);
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_get_operator_plmn_list
+
+===========================================================================*/
+/*
+    @brief
+    Function sends multiple record based read commands to the modem
+    to retrieve a list of operator preffered PLMN.
+
+    @note
+    Function should only be called for SIM/USIM
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_get_operator_plmn_list
+(
+    QL_SIM_PREFERRED_OPERATOR_LIST      *pt_info    ///< [OUT] Preferred operator list
+);
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_verify_pin
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to verify either PIN1 or PIN2
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_verify_pin
+(
+    QL_SIM_VERIFY_PIN_INFO      *pt_info   // [IN] PIN/PIN2
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_change_pin
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to change the value of
+    either PIN
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_change_pin
+(
+    QL_SIM_CHANGE_PIN_INFO      *pt_info   // [IN] PIN 
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_unblock_pin
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to unblock a PIN1 or PIN2 that
+    has been blocked
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_unblock_pin
+(
+    QL_SIM_UNBLOCK_PIN_INFO     *pt_info   // [IN] input PUK/PUK2 and new PIN/PIN2
+);
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_enable_pin
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to enable PIN
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_enable_pin
+(
+    QL_SIM_VERIFY_PIN_INFO      *pt_info   // [IN] PIN
+);
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_disable_pin
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to disable PIN
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_disable_pin
+(
+    QL_SIM_VERIFY_PIN_INFO     *pt_info   // [IN] PIN 
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_get_card_status
+
+===========================================================================*/
+/*
+    @brief
+    Function get sim card status informations
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_get_card_status
+(
+    QL_SIM_CARD_STATUS_INFO     *pt_info   ///< [OUT] sim card status info output
+);
+
+
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_get_file_info
+
+===========================================================================*/
+/*
+    @brief
+    Function sends a command to the modem to retrieve the file info
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_get_file_info
+(
+    unsigned int fileid,
+    QL_SIM_FILE_INFO  *file_info,     // [OUT] output file info
+    QL_SIM_FILE_OPERATION_RET *operation_ret // [OUT] return the operation status code 
+);
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_read_file
+
+===========================================================================*/
+/*
+    @brief
+    Function get the data of a EF file.
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_read_file
+(
+    unsigned int fileid,  // EF file id
+    unsigned int index,   // the index of record for a record EF file, the offest of date for a transparent EF file.
+    unsigned int data_max_len, // the max length of output data.
+    QL_SIM_CARD_FILE_DATA  *file_data,     // [OUT] File data
+    QL_SIM_FILE_OPERATION_RET *operation_ret // [OUT] return the operation status code 
+);
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_write_file
+
+===========================================================================*/
+/*
+    @brief
+    Function write data to a EF file.
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_write_file
+(
+    unsigned int fileid, // EF file id
+    int index, // the index of record for a record EF file, the offest of date for a transparent EF file.
+    QL_SIM_CARD_FILE_DATA  *file_data,     ///< [IN] File data of the specified one by pt_info
+    QL_SIM_FILE_OPERATION_RET *operation_ret // [OUT] return the operation status code
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_read_phonebook_record
+
+===========================================================================*/
+/*
+    @brief
+    Function will get the phone book record.
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_read_phonebook_record
+(
+    QL_SIM_PHONE_BOOK_STORAGE storage, //IN the storage position of the phone book
+    int start_index, // the start index of records, 0: read record by username.
+    int end_index, // the end index of records
+    uint8_t *username, // the username in a record, it is valid when start_index is 0
+    QL_SIM_PHONE_BOOK_RECORDS_INFO   *records  // the list of records 
+);
+
+
+/*===========================================================================
+
+  FUNCTION:  ql_sim_write_phonebook_record
+
+===========================================================================*/
+/*
+    @brief
+    Function will write  a record to a phone book.
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_write_phonebook_record
+(
+    QL_SIM_PHONE_BOOK_STORAGE storage, //IN the storage position of the phone book
+    QL_SIM_PHONE_BOOK_RECORD_INFO   *record //IN  a record
+);
+
+
+/*===========================================================================*/
+/*
+    @brief
+    Function will return the state of currently selected phonebook
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_get_phonebook_state(QL_SIM_PHONEBOOK_STATE *state);
+
+
+/*===========================================================================*/
+/*
+    @brief
+    Function will request to select the local or remote SIM
+
+    @return
+    QL_SIM_ERROR_CODE
+*/
+/*=========================================================================*/
+QL_SIM_ERROR_CODE ql_sim_select(UINT service, UINT is_remote);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif 
diff --git a/mbtk/include/ql/ql_sleep_wakelock.h b/mbtk/include/ql/ql_sleep_wakelock.h
new file mode 100755
index 0000000..e3266d1
--- /dev/null
+++ b/mbtk/include/ql/ql_sleep_wakelock.h
@@ -0,0 +1,31 @@
+#ifndef __QL_SLEEP_WAKELOCK_H__
+#define __QL_SLEEP_WAKELOCK_H__
+#include <stddef.h>
+
+/*
+ * create wakelock, return the file description of the wakelock
+ */
+extern int Ql_SLP_WakeLock_Create(const char *name, size_t len);
+
+/*
+ * lock the wakelock by the file description of the wakelock
+ */
+extern int Ql_SLP_WakeLock_Lock(int fd);
+
+
+/*
+ * unlock the wakelock by the file description of the wakelock
+ */
+extern int Ql_SLP_WakeLock_Unlock(int fd);
+
+/*
+ * destroy the wakelock by the file description of the wakelock
+ */
+extern int Ql_SLP_WakeLock_Destroy(int fd);
+
+/*
+ * Enable/Disable autosleep function
+ */
+extern int Ql_Autosleep_Enable(char enable);
+
+#endif  //__QL_SLEEP_WAKELOCK_H__
diff --git a/mbtk/include/ql/ql_sms.h b/mbtk/include/ql/ql_sms.h
new file mode 100755
index 0000000..cf5c872
--- /dev/null
+++ b/mbtk/include/ql/ql_sms.h
@@ -0,0 +1,196 @@
+/*****************************************************************************
+ *  Copyright Statement:
+ *  --------------------
+ *  This software is protected by Copyright and the information contained
+ *  herein is confidential. The software may not be copied and the information
+ *  contained herein may not be used or disclosed except with the written
+ *  permission of Quectel Co., Ltd. 2016
+ *
+ *****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ *   ql_sms.h
+ *
+ * Project:
+ * --------
+ *   OpenLinux
+ *
+ * Description:
+ * ------------
+ *   API definition for SMS.
+ *
+ *============================================================================
+ *             HISTORY
+ *----------------------------------------------------------------------------
+ * WHO            WHEN                WHAT
+ *----------------------------------------------------------------------------
+ * Pony.ma       19/09/2019           Create
+ ****************************************************************************/
+
+#ifndef __QL_SMS_H__
+#define __QL_SMS_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define MAX_ADDR_LEN            24
+#define FALSE                   0
+#define TRUE                    1
+
+#define QL_SMS_MIN_LEN          1       
+#define MAX_LONGSMS_SEGMENT     8
+#define MAX_SMS_LENGTH          (160*4)
+#define SMS_BUF_LEN             (MAX_SMS_LENGTH + 32)
+#define MAX_LONGSMS_LENGTH      (160*4*MAX_LONGSMS_SEGMENT)
+#define CI_MAX_COUNT_SMS_OF_SIM 50
+
+
+typedef unsigned char           UINT8;
+typedef unsigned short          UINT16;
+typedef unsigned int            UINT32;
+
+typedef enum{
+	QL_SMS_SUCCESS,
+	QL_SMS_GENERIC_FAILURE,
+	QL_SMS_PRAR_ERROR,
+	QL_GET_RESPONSE_ERROR,
+}QL_SMS_ERROR_CODE;
+
+typedef enum 
+{
+	QL_SMS_RECV_EVENT   = 0,    /**< SMS come event.  */
+	QL_SMS_RECV_INDEX_EVENT,    /**< SMS come event for index.  */
+}QL_SMS_NFY_MSG_ID; 
+
+typedef enum 
+{
+	QL_SMS_MODE_GSM = 0,    //GSM
+    QL_SMS_MODE_UCS2        //UCS2
+}QL_SMS_CODE_MODE;
+
+typedef struct
+{
+	char number[32];
+	char body[280]; // 姣忔潯鏀跺埌鐨勭煭淇¢暱搴︽渶澶т负280
+	char time[32];
+	int  body_len;
+    QL_SMS_CODE_MODE  code_mode;
+	char *pdu_str;
+}QL_SMS_STATUS_INFO;
+
+typedef struct
+{
+	int  item;
+	char *name;
+}ql_sms_item;
+
+typedef void (*QL_SMS_StatusIndMsgHandlerFunc_t)   
+	(    
+	 QL_SMS_NFY_MSG_ID     msg_id,
+	 void                  *pv_data,
+	 int                   pv_data_len,
+	 void                  *contextPtr    
+	);
+
+typedef enum{
+	QL_SMS_ClientInit = 0,
+	QL_SMS_ClientRelease,
+	//QL_SMS_SendSMS,
+	QL_SMS_DeleteSMS,	
+	QL_SMS_SearchSMSTextMessage,
+	QL_SMS_SearchSMSPduMessage,
+	QL_SMS_AddSMSEventHandler,
+	QL_SMS_GetSMSCenterAddress,
+	QL_SMS_SetSMSCenterAddress,
+	QL_SMS_SetSaveLocation,
+	QL_SMS_GetSaveLocation,
+	QL_SMS_SetSMSNotSave,
+	QL_SMS_SetSMSMsgMode,
+	QL_SMS_GetSMSMsgMode,
+	QL_SMS_SetSMSCodeMode,
+	QL_SMS_GetSMSCodeMode,
+	QL_SMS_SetSMSReceiveDealmode,
+	QL_SMS_SendTextSMS,
+	QL_SMS_SendPduSMS,
+	QL_SMS_GetSimNum,
+	QL_SMS_GetIndex,
+	QL_SMS_OptionMax,
+}QL_SMS_OPTION;
+
+typedef struct
+{
+	char mem[5];
+	int  cur_num;  //current sms numbers
+	int  max_nums; //Maximum number of messages that can be stored
+}sms_mem_t;
+
+typedef struct
+{
+	sms_mem_t mem1; //messages to be read and deleted from this memory storage.
+	sms_mem_t mem2; //messages will be written and sent to this memory storage.
+	sms_mem_t mem3; //received messages will be placed in this memory storage if routing to PC is not set.
+}ql_sms_mem_info_t;
+
+typedef struct recvmessage_struct{
+	char num[32];
+	char buf[400];
+	int buflen;	
+}recvmessage;
+typedef struct{
+	int storage_index;					  // 存贮索引
+} ql_sms_recv_index_event_t;
+
+
+typedef struct{
+	int sms_index[CI_MAX_COUNT_SMS_OF_SIM];
+	int count;
+} ql_auto_sms_index;
+
+
+
+
+/* init sms client */
+QL_SMS_ERROR_CODE ql_sms_init();
+/* deinit sms clint */
+QL_SMS_ERROR_CODE ql_sms_release();
+/* send message api */
+//QL_SMS_ERROR_CODE ql_sms_send_msg(uint8_t *destNum,uint8_t *data,size_t dataLen,int sms_type);
+/* get smsc api */
+QL_SMS_ERROR_CODE ql_sms_get_sms_center_address(uint8_t *sms_center_addree);
+/* register sms event header api*/
+QL_SMS_ERROR_CODE ql_sms_add_event_handler(QL_SMS_StatusIndMsgHandlerFunc_t handlerPtr, void* contextPtr);
+/* set smsc api */
+QL_SMS_ERROR_CODE ql_sms_set_sms_center_address(unsigned char *destNum);
+/* delete message api */
+QL_SMS_ERROR_CODE ql_sms_delete_msg(size_t index); 
+/* set sms storage api */
+QL_SMS_ERROR_CODE ql_sms_set_sms_pref_storage(size_t location);
+/* set sms not storage api */
+QL_SMS_ERROR_CODE ql_sms_set_sms_desave();
+QL_SMS_ERROR_CODE ql_set_sms_msg_mode(int messagemode);
+QL_SMS_ERROR_CODE ql_get_sms_msg_mode(int *messagemode);
+QL_SMS_ERROR_CODE ql_set_sms_code_mode(char* codemode);
+QL_SMS_ERROR_CODE ql_get_sms_code_mode(char *codemode);
+QL_SMS_ERROR_CODE ql_sms_get_sms_pref_storage(ql_sms_mem_info_t *mem_info);
+//QL_SMS_ERROR_CODE ql_search_sms_message(int index, recvmessage* payload);
+QL_SMS_ERROR_CODE ql_search_sms_text_message(int index, recvmessage* payload);
+QL_SMS_ERROR_CODE ql_search_sms_pdu_message(int index, recvmessage* payload);
+QL_SMS_ERROR_CODE ql_set_sms_recive_dealmode(int dealmode);
+QL_SMS_ERROR_CODE ql_sms_send_pdu_msg(uint8_t *phone_num,uint8_t *data,int sms_type);
+QL_SMS_ERROR_CODE ql_sms_send_text_msg(uint8_t *phone_num,uint8_t *data,int sms_type);
+QL_SMS_ERROR_CODE ql_sms_get_sim_num(uint8_t *sim_num);
+QL_SMS_ERROR_CODE ql_get_sms_index( int *sms_msg_info_ptr,int *smsnum);
+QL_SMS_ERROR_CODE ql_sms_list_sms(int stat, int index, char *data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/mbtk/include/ql/ql_spi.h b/mbtk/include/ql/ql_spi.h
new file mode 100755
index 0000000..d33660b
--- /dev/null
+++ b/mbtk/include/ql/ql_spi.h
@@ -0,0 +1,79 @@
+/**  
+  @file
+  ql_spi.h
+
+  @brief
+  This file provides the definitions for spi driver, and declares the 
+  API functions.
+
+*/
+/*============================================================================
+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+ =============================================================================*/
+/*===========================================================================
+
+                        EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+
+WHEN        WHO            WHAT, WHERE, WHY
+----------  ------------   ----------------------------------------------------
+2019/08/20  Juson          create
+=============================================================================*/
+#ifndef __QL_SPI_H__
+#define __QL_SPI_H__
+
+#define SPI_CPHA		0x01
+#define SPI_CPOL		0x02
+
+typedef enum
+{
+	SPIMODE0  =   (0|0),
+	SPIMODE1  =   (0|SPI_CPHA),
+	SPIMODE2  =   (SPI_CPOL|0),
+	SPIMODE3  =   (SPI_CPOL|SPI_CPHA),
+}SPI_MODE;
+
+typedef enum
+{
+	S_6_5M  =   6500000,
+	S_13M 	=   13000000,
+	S_26M  	=   26000000,
+	S_52M  	=   50000000,
+}SPI_SPEED;
+
+/**
+ * Function:  Ql_SPI_Init
+ * Description: spi init
+ * Parameters:  dev_name---device name
+ *              mode---spi mode
+ *              bits---spi per word
+ *              speed---spi transfer clock
+ * Return: spi fd
+ **/ 
+int Ql_SPI_Init(const char *dev_name, SPI_MODE mode, unsigned char bits, SPI_SPEED speed);
+
+/**
+ * Function: Ql_SPI_DeInit
+ * Description: spi deinit
+ * Parameters: fd---spi fd
+ * Return:
+ */ 
+int Ql_SPI_DeInit(int fd);
+
+/**
+ * Function: Ql_SPI_Write_Read
+ * Description: spi write read function
+ * Parameters: fd---spi fd
+ *              w_buf---write buffer
+ *              r_buf---read buffer
+ *              len---spi transfer length
+ * Return: 0---transfer success
+ *          other---failed
+ **/
+int Ql_SPI_Write_Read(int fd, unsigned char *w_buf, unsigned char *r_buf, unsigned int len);
+
+#endif/* __QL_SPI_H__ */
\ No newline at end of file
diff --git a/mbtk/include/ql/ql_tlv_user.h b/mbtk/include/ql/ql_tlv_user.h
new file mode 100755
index 0000000..a4e710a
--- /dev/null
+++ b/mbtk/include/ql/ql_tlv_user.h
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ *
+ *  Filename: ql_tlv_user.h
+ *
+ *  Description: flash tlv format param config header file.
+ *
+ *  When        Who         Why
+ *  2019/09/28  juson       Creation of file
+ *
+ *  Notes:
+ *
+ ******************************************************************************/
+#ifndef __QL_TLV_USER_H__
+#define __QL_TLV_USER_H__
+
+typedef enum {
+    SYS_CONFIG_START = 0,
+    SYS_CONFIG_AP_RSTLEVEL_ID,
+    SYS_CONFIG_MODEM_RSTLEVEL_ID,
+    SYS_CONFIG_RECOVERY_ID,
+    SYS_CONFIG_CONSOLE_LOG_ID,
+    SYS_CONFIG_END,
+}SYS_CFG_ID_E;
+
+/* 128bytes */
+typedef struct ql_tlv_struct {
+    SYS_CFG_ID_E type;
+    unsigned int len;
+    char value[120];
+}ql_tlv_t;
+
+int quectel_tlv_write(SYS_CFG_ID_E param_id, ql_tlv_t tlv_data);
+int quectel_tlv_read(SYS_CFG_ID_E param_id, ql_tlv_t *tlv_data);
+int ql_onoff_console_log(unsigned char onoff_flag);
+
+#endif /* __QL_TLV_USER_H__ */
+
+
diff --git a/mbtk/include/ql/ql_uart.h b/mbtk/include/ql/ql_uart.h
new file mode 100755
index 0000000..3808419
--- /dev/null
+++ b/mbtk/include/ql/ql_uart.h
@@ -0,0 +1,89 @@
+/**  
+  @file
+  ql_uart.h
+
+  @brief
+  This file provides the definitions for uart, and declares the 
+  API functions.
+
+*/
+/*============================================================================
+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+ =============================================================================*/
+/*===========================================================================
+
+                        EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+
+WHEN        WHO            WHAT, WHERE, WHY
+----------  ------------   ----------------------------------------------------
+2019/08/20  Juson          create
+=============================================================================*/
+
+#ifndef __QL_UART_H__
+#define __QL_UART_H__
+
+typedef enum {
+    FC_NONE = 0,  // None Flow Control
+    FC_RTSCTS,    // Hardware Flow Control (rtscts)
+    FC_XONXOFF    // Software Flow Control (xon/xoff)
+}Enum_FlowCtrl;
+
+typedef enum {
+    PB_NONE = 0,  //none parity check
+    PB_ODD,       //odd parity check
+    PB_EVEN       //even parity check
+}Enum_ParityBit;
+
+typedef enum {
+    DB_CS5 = 5,
+    DB_CS6 = 6,
+    DB_CS7 = 7,
+    DB_CS8 = 8
+}Enum_DataBit;
+
+typedef enum {
+    SB_1 = 1,
+    SB_2 = 2
+}Enum_StopBit;
+
+typedef enum {
+	B_300 		= 300,
+	B_600 		= 600,
+	B_1200 		= 1200,
+	B_2400 		= 2400,
+	B_4800 		= 4800,
+	B_9600 		= 9600,
+	B_19200 	= 19200,
+	B_38400 	= 38400,
+	B_57600 	= 57600,
+	B_115200 	= 115200,
+	B_230400 	= 230400,
+	B_460800 	= 460800,
+	B_921600	= 921600,
+	B_3000000	= 3000000,
+	B_4000000	= 4000000,
+}Enum_BaudRate;
+
+typedef struct {
+    Enum_BaudRate       baudrate; 
+    Enum_DataBit       	databit;
+    Enum_StopBit       	stopbit;
+    Enum_ParityBit      parity;
+    Enum_FlowCtrl       flowctrl;
+}ST_UARTDCB;
+
+int Ql_UART_Open(const char* port, Enum_BaudRate baudrate, Enum_FlowCtrl flowctrl);
+int Ql_UART_Read(int fd, char* buf, unsigned int buf_len);
+int Ql_UART_Write(int fd, const char* buf, unsigned int buf_len);
+int Ql_UART_SetDCB(int fd, ST_UARTDCB *dcb);
+int Ql_UART_GetDCB(int fd, ST_UARTDCB *dcb);
+int Ql_UART_IoCtl(int fd, unsigned int cmd, void* pValue);
+int Ql_UART_Close(int fd);
+
+#endif /* __QL_UART_H__ */
+
diff --git a/mbtk/include/ql/ql_vcall.h b/mbtk/include/ql/ql_vcall.h
new file mode 100755
index 0000000..c1b0545
--- /dev/null
+++ b/mbtk/include/ql/ql_vcall.h
@@ -0,0 +1,296 @@
+/**
+ *@file     ql_voicecall.h
+ *@date     2017-05-02
+ *@author   
+ *@brief    
+ */
+
+#ifndef __QL_VCALL_H__
+#define __QL_VCALL_H__
+
+#define QL_QMI_VCALL_ECALL_MSD_MAX_LEN 140
+
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Reference returned by Start function and used by End function
+ */
+//--------------------------------------------------------------------------------------------------
+//typedef struct QL_VCALL_Call* ST_VCALL_CallRef;
+typedef int ST_VCALL_CallRef;
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * SIM identifiers.
+ *
+ */
+//--------------------------------------------------------------------------------------------------
+typedef enum
+{
+    E_QL_VCALL_EXTERNAL_SLOT_1,
+    E_QL_VCALL_EXTERNAL_SLOT_2,
+    E_QL_VCALL_EMBEDDED,
+    E_QL_VCALL_REMOTE,
+    E_QL_VCALL_ID_MAX
+}E_QL_VCALL_ID_T;
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Voice call establishment states.
+ */
+//--------------------------------------------------------------------------------------------------
+typedef enum
+{
+    E_QL_VCALL_EVENT_ALERTING = 0,
+   ///< Voice call establishment in progress.
+   ///< Far end is now alerting its user (outgoing call).
+
+    E_QL_VCALL_EVENT_CONNECTED = 1,
+   ///< Call has been established, and is media is active.
+
+    E_QL_VCALL_EVENT_TERMINATED = 2,
+   ///< Call has terminated.
+
+    E_QL_VCALL_EVENT_OFFLINE = 3,
+   ///< NO Service available to try establish a voice call.
+
+    E_QL_VCALL_EVENT_BUSY = 4,
+   ///< Remote party (callee) is busy.
+
+    E_QL_VCALL_EVENT_RESOURCE_BUSY = 5,
+   ///< All local connection resources (lines/channels) are in use.
+
+    E_QL_VCALL_EVENT_CALL_END_FAILED = 6,
+   ///< Call ending failed.
+
+    E_QL_VCALL_EVENT_CALL_ANSWER_FAILED = 7,
+   ///< Call answering failed.
+
+    E_QL_VCALL_EVENT_INCOMING = 8
+   ///< Incoming voice call in progress.
+}E_QL_VCALL_EVENT_T;
+
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Voice call termination reason.
+ */
+//--------------------------------------------------------------------------------------------------
+typedef enum
+{
+    E_QL_VCALL_TERM_NETWORK_FAIL = 0,
+   ///< Network could not complete the call.
+
+    E_QL_VCALL_TERM_BAD_ADDRESS = 1,
+   ///< Remote address could not be resolved.
+
+    E_QL_VCALL_TERM_BUSY = 2,
+   ///< Caller is currently busy and cannot take the call.
+
+    E_QL_VCALL_TERM_LOCAL_ENDED = 3,
+   ///< Local party ended the call.
+
+    E_QL_VCALL_TERM_REMOTE_ENDED = 4,
+   ///< Remote party ended the call.
+
+    E_QL_VCALL_TERM_UNDEFINED = 5
+   ///< Undefined reason.
+}E_QL_VCALL_TerminationReason_t;
+
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Reference type used by Add/Remove functions for EVENT 'QL_VCALL_State'
+ */
+//--------------------------------------------------------------------------------------------------
+//typedef struct QL_VCALL_StateHandler* QL_VCALL_StateHandlerRef_t;
+typedef int QL_VCALL_StateHandlerRef_t;
+
+
+typedef enum
+{
+    E_QL_VCALL_DIRECTION_MO = 1,
+    E_QL_VCALL_DIRECTION_MT = 2
+}E_QL_VCALL_DIRECTION_T;
+
+typedef enum
+{
+    E_QL_VCALL_STATE_ORIGINATING = 1,   //Origination
+    E_QL_VCALL_STATE_INCOMING,          //Incoming
+    E_QL_VCALL_STATE_CONVESATION,       //Conversation
+    E_QL_VCALL_STATE_CC_IN_PROGRESS,    //Call is originating but waiting for call control to complete
+    E_QL_VCALL_STATE_ALERTING,          //Alerting
+    E_QL_VCALL_STATE_HOLD,              //Hold
+    E_QL_VCALL_STATE_WAITING,           //Waiting
+    E_QL_VCALL_STATE_DISCONNECTING,     //Disconnecting
+    E_QL_VCALL_STATE_END,               //End
+    E_QL_VCALL_STATE_SETUP,             //MT call is in setup state in 3GPP
+}E_QL_VCALL_STATE_T;
+
+typedef enum
+{
+    E_QL_VCALL_TYPE_VOICE = 0,      //Voice
+    E_QL_VCALL_TYPE_VOICE_FORCED,   //Avoid modem call classification
+    E_QL_VCALL_TYPE_VOICE_IP,       //Voice over IP
+    E_QL_VCALL_TYPE_VT,             //VideoTelephony call over IP
+    E_QL_VCALL_TYPE_VIDEOSHARE ,    //Videoshare
+    E_QL_VCALL_TYPE_TEST,           //Test call
+    E_QL_VCALL_TYPE_OTAPA,          //OTAPA
+    E_QL_VCALL_TYPE_STD_OTASP,      //Standard OTASP
+    E_QL_VCALL_TYPE_NON_STD_OTASP,  //Nonstandard OTASP
+    E_QL_VCALL_TYPE_EMERGENCY,      //Emergency
+    E_QL_VCALL_TYPE_SUPS,           //Supplementary Service
+    E_QL_VCALL_TYPE_EMERGENCY_IP,   //Emergency VoIP
+    E_QL_VCALL_TYPE_ECALL           //eCall
+}E_QL_VCALL_TYPE_T;
+
+typedef struct
+{
+    uint8_t                 call_id;
+    char                    PhoneNum[20];      ///Telephone number string.  
+    E_QL_VCALL_DIRECTION_T  e_direct;
+    E_QL_VCALL_STATE_T      e_state;
+    E_QL_VCALL_TYPE_T       e_type;
+} vcall_info_t;
+
+typedef enum
+{
+    E_QL_VCALL_ECALL_MANUAL = 5,
+    E_QL_VCALL_ECALL_AUTO = 6
+}E_QL_VCALL_ECALL_CAT_T;
+
+typedef enum 
+{
+    E_QL_VCALL_ECALL_TEST		   	= 0x01, 
+    E_QL_VCALL_ECALL_EMERGENCY     	= 0x02, 
+    E_QL_VCALL_ECALL_RECONFIG		= 0x03, 
+}E_QL_VCALL_ECALL_VARIANT_T;
+
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Handler for voice call state changes.
+ *
+ * @param reference
+ *   Event voice call object reference.
+ * @param identifier
+ *   Identifier of the remote party
+ * @param event
+ *   Voice call event.
+ * @param contextPtr
+ */
+//--------------------------------------------------------------------------------------------------
+typedef void (*QL_VCALL_StateHandlerFunc_t)
+(
+    ST_VCALL_CallRef reference,
+    const char* 	identifier,
+    E_QL_VCALL_STATE_T  event,
+    void* contextPtr
+);
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Add handler function for EVENT 'QL_VCALL_State'
+ *
+ * This event provides information on voice call state changes
+ */
+//--------------------------------------------------------------------------------------------------
+QL_VCALL_StateHandlerRef_t QL_VCALL_AddStateHandler
+(
+    QL_VCALL_StateHandlerFunc_t handlerPtr,
+   ///< [IN]
+
+    void* contextPtr
+   ///< [IN]
+);
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Remove handler function for EVENT 'QL_VCALL_State'
+ */
+//--------------------------------------------------------------------------------------------------
+void QL_VCALL_RemoveStateHandler
+(
+    QL_VCALL_StateHandlerRef_t addHandlerRef
+   ///< [IN]
+);
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Start a voice call.
+ *
+ * @return
+ * - Reference to the voice call (to be used later for releasing the voice call)
+ * - NULL if the voice call could not be processed
+ */
+//--------------------------------------------------------------------------------------------------
+ST_VCALL_CallRef QL_VCALL_Start
+(
+    E_QL_VCALL_ID_T simId,
+    const char* DestinationID
+   ///< [IN] Destination identifier for the voice
+);
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Release a voice call.
+ *
+ * @return
+ * - E_QL_OK if the end of voice call can be processed.
+ * - E_QL_NOT_FOUND if the voice call object reference is not found.
+ */
+//--------------------------------------------------------------------------------------------------
+int QL_VCALL_End
+(
+    ST_VCALL_CallRef reference
+   ///< [IN] Voice call object reference to hang-up.
+);
+
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Answer to incoming voice call.
+ *
+ * @return
+ * - E_QL_OK if the incoming voice call can be answered
+ * - E_QL_NOT_FOUND if the incoming voice call object reference is not found.
+ */
+//--------------------------------------------------------------------------------------------------
+int QL_VCALL_Answer
+(
+    ST_VCALL_CallRef reference
+   ///< [IN] Incoming voice call object reference to answer.
+);
+
+//--------------------------------------------------------------------------------------------------
+/**
+ * Get the termination reason of a voice call reference.
+ *
+ * @return
+ * - E_QL_OK if the termination reason is got
+ * - E_QL_NOT_FOUND if the incoming voice call object reference is not found.
+ * - E_QL_FAULT if the voice call is not terminated.
+ */
+//--------------------------------------------------------------------------------------------------
+int QL_VCALL_GetTerminationReason
+(
+    ST_VCALL_CallRef reference,
+   ///< [IN] Voice call object reference to read from.
+
+    E_QL_VCALL_TerminationReason_t* reasonPtr
+   ///< [OUT] Termination reason of the voice call.
+);
+
+
+int QL_VCALL_Ecall(E_QL_VCALL_ID_T 				simId,
+					char*           			phone_number, 
+                    char* 						ecall_msd,
+                    E_QL_VCALL_ECALL_CAT_T  	emer_cat,
+                    E_QL_VCALL_ECALL_VARIANT_T	eCallModeType, 
+                    ST_VCALL_CallRef   			*reference);	//call id
+
+int QL_VCALL_UpdateMsd(	const char *msd);
+
+
+#endif // __QL_VCALL_H__
+
diff --git a/mbtk/include/ql/ql_voice.h b/mbtk/include/ql/ql_voice.h
new file mode 100755
index 0000000..7d4e038
--- /dev/null
+++ b/mbtk/include/ql/ql_voice.h
@@ -0,0 +1,201 @@
+/**  
+  @file
+  ql_voice.h
+
+  @brief
+  This file provides the definitions for voice, and declares the 
+  API functions.
+
+*/
+/*============================================================================
+  Copyright (c) 2017 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+ =============================================================================*/
+/*===========================================================================
+
+                        EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+
+WHEN        WHO            WHAT, WHERE, WHY
+----------  ------------   ----------------------------------------------------
+14/11/2019  gunner.yang      create
+06/01/2020  pony.made        add net_state
+18/02/2020  gale.gao       Add API: imsd get, wait status get, voice unhold;
+=============================================================================*/
+
+#ifndef __QL_VOICE_H__
+#define __QL_VOICE_H__
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum 
+{
+	QL_VOICE_SUCCESS,
+	QL_VOICE_GENERIC_FAILURE,
+ 	QL_VOICE_RADIO_NOT_AVAILABLE,
+}QL_VOICE_ERROR_CODE;
+
+typedef enum{
+    GSM = 0,
+    GSM_COMPACT,
+    GSM_wEGPRS,
+    UTRAN,
+    UTRAN_wHSDPA,
+    UTRAN_wHSUPA,
+    UTRAN_wHSDPA_HSUPA,
+    E_UTRAN,
+    UTRAN_HSPA_PLUS,
+}QL_REG_STATE;
+
+typedef enum{
+    REASON_INVALID=-1,
+    REASON_UNCONDITIONAL =0,
+    REASON_DEVICE_BUSY =1,
+    REASON_DEVICE_NO_REPLY =2,
+    REASON_DEVICE_UNREACHABLE =3,
+    REASON_DEVICE_ALL_FORWARDING =4,
+    REASON_DEVICE_ALL_CONDITIONAL =5,
+}QL_VOICE_CALL_FW_REASON;
+
+typedef enum{
+    MODE_DISABLE=0,
+    MODE_ENABLE,
+    MODE_QUERY_STATUS,
+    MODE_REGISTRATION,
+    MODE_ERASURE,
+}QL_VOICE_CALL_FW_MODE;
+
+typedef struct
+{
+    int     status;
+    int     fw_class;
+    char    num[20];
+    int     type;
+    char    subaddr[20];
+    int     satype;
+    int     time;
+} ql_voice_call_fw_list_t;
+
+typedef enum {
+    QL_CALL_ACTIVE = 0,
+    QL_CALL_HOLDING = 1,
+    QL_CALL_DIALING = 2,    /* MO call only */
+    QL_CALL_ALERTING = 3,   /* MO call only */
+    QL_CALL_INCOMING = 4,   /* MT call only */
+    QL_CALL_WAITING = 5,     /* MT call only */
+    QL_CALL_OFFERING = 6,	  /*MT call offering (call setup)*/
+    QL_CALL_DISCONNECTING = 7, /*call in disconnect procedure*/
+    QL_CALL_DISCONNECTED = 8, /*call is disconnected*/
+} QL_CallState;
+
+typedef struct
+{
+    int idx;            /*call index, identification number*/
+    int dir;            /*0: mobile originated(MO) call, 1: mobile terminated(MT) call*/
+    int state;          /*define in QL_CallState*/
+    char number[20];    /*string type phone number in format specified by <type>*/
+    int type;           /*type of address octet in interger format(refer TS24.008 subclause 10.5.4.7)*/
+}ql_voice_call_item;
+
+typedef struct
+{
+    int count;
+    ql_voice_call_item items[16];
+}ql_voice_call_list_t;
+/*
+    callbackfunction prototype
+*/
+typedef void (*QL_VOICE_EventHandlerFunc_t)(QL_CallState voice_flag, char *number,void *contextPtr);
+
+QL_VOICE_ERROR_CODE ql_voice_call_init ();
+QL_VOICE_ERROR_CODE ql_voice_call_release();
+
+/*
+    Register voice call event.
+     -handlerPtr    : user_cb
+     -contextPtr    : user_cb_data
+*/
+QL_VOICE_ERROR_CODE ql_voice_call_event_register(QL_VOICE_EventHandlerFunc_t handlerPtr, void* contextPtr);
+
+
+/*
+    Phone call.
+     -call_num   : dst phone number
+*/
+QL_VOICE_ERROR_CODE ql_voice_call_start(char* call_num);
+
+
+/*
+    Put through.
+*/
+QL_VOICE_ERROR_CODE ql_voice_call_answer();
+QL_VOICE_ERROR_CODE ql_voice_auto_answer(int seconds);
+
+
+/*
+    Hang up.
+*/
+QL_VOICE_ERROR_CODE ql_voice_call_end();
+
+
+/* dfmf call */
+QL_VOICE_ERROR_CODE ql_voice_call_dtmf(char *dtmf,int duration);
+
+/* get voice net state
+ * Just use in call to judge Volte or CS-vioce 
+ * regstate: 
+ * 		7	-> Volte call
+ * 		else	-> CS call
+*/
+QL_VOICE_ERROR_CODE ql_voice_call_get_regstate(int* regstate);
+
+/* set imsd value
+    1: open votle
+    0: close votle
+ */
+QL_VOICE_ERROR_CODE ql_voice_call_set_imsd(int imsd);
+
+/* get imsd value 
+   1: open volte
+   0: close volte
+ */
+QL_VOICE_ERROR_CODE ql_voice_call_get_imsd(int *imsd);
+
+/* set call wait
+    0: close
+    1: open  */
+QL_VOICE_ERROR_CODE ql_voice_call_set_wait(int wait);
+
+/* get call wait status
+    0: close
+    1: open  */
+QL_VOICE_ERROR_CODE ql_voice_call_get_wait(int *wait);
+
+/* hold the voice */
+QL_VOICE_ERROR_CODE ql_voice_call_hold();
+
+/* unhold the voice */
+QL_VOICE_ERROR_CODE ql_voice_call_unhold();
+
+QL_VOICE_ERROR_CODE ql_voice_call_fw_set(QL_VOICE_CALL_FW_REASON reason, QL_VOICE_CALL_FW_MODE mode, char *num);
+
+QL_VOICE_ERROR_CODE ql_voice_call_fw_query(QL_VOICE_CALL_FW_REASON reason, ql_voice_call_fw_list_t *resp_data);
+
+/**
+ * get the current call list, same as AT+CLCC
+*/
+QL_VOICE_ERROR_CODE ql_voice_call_get_current_list(ql_voice_call_list_t *resp_data);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/mbtk/include/ql/ql_wifi.h b/mbtk/include/ql/ql_wifi.h
new file mode 100755
index 0000000..a5f97d7
--- /dev/null
+++ b/mbtk/include/ql/ql_wifi.h
@@ -0,0 +1,652 @@
+/**
+ * @file ql_wifi.h
+ * @brief Quectel Openlinux WiFi public function declarations.
+ * 
+ * @note 
+ *
+ * @copyright Copyright (c) 2009-2017 @ Quectel Wireless Solutions Co., Ltd.
+ */
+/*================================================================
+  Copyright (c) 2018 Quectel Wireless Solution, Co., Ltd.  All Rights Reserved.
+  Quectel Wireless Solution Proprietary and Confidential.
+=================================================================*/
+
+/*=====================================================================
+  
+                         EDIT HISTORY FOR MODULE
+
+  This section contains comments describing changes made to the module.
+  Notice that changes are listed in reverse chronological order.
+
+  WHEN             WHO         WHAT, WHERE, WHY
+  ------------     -------     ----------------------------------------
+  11/20/2011       Paddy        Initial creation.
+
+=======================================================================*/
+
+#ifndef __QL_WIFI_H__
+#define __QL_WIFI_H__
+
+#include <stdbool.h>
+#include <netinet/in.h>
+
+#define QL_WIFI_AP_AUTH_OPEN                  "none"
+#define QL_WIFI_AP_AUTH_WPA_PSK               "psk"
+#define QL_WIFI_AP_AUTH_WPA2_PSK              "psk2"
+#define QL_WIFI_AP_AUTH_WPA_WPA2_PSK          "psk-mixed"
+
+#define QL_WIFI_AP_AUTH_WPA_PAIRWISE_TKIP     "tkip"
+#define QL_WIFI_AP_AUTH_WPA_PAIRWISE_AES      "aes"
+#define QL_WIFI_AP_AUTH_WPA_PAIRWISE_BOTH     "tkip+aes"
+
+#define QL_WIFI_AP_BANDWIDTH_20MHZ             "HT20"
+#define QL_WIFI_AP_BANDWIDTH_40MHZ             "HT40-"
+#define QL_WIFI_AP_BANDWIDTH_80MHZ             "HT40+"
+
+#define QL_WIFI_AP_MODE_80211B                "11b"
+#define QL_WIFI_AP_MODE_80211BG               "11bg"
+#define QL_WIFI_AP_MODE_80211BGN              "11bgn"
+
+
+typedef enum {
+	WIFI_WORK_MODE_E_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum.	Do not change or use*/
+	WIFI_WORK_MODE_AP_V01 = 0, 
+	WIFI_WORK_MODE_STA_V01 = 1, 
+	WIFI_WORK_MODE_AP_STA_V01 = 2, 
+	WIFI_WORK_MODE_AP_AP_V01 = 3, 
+	WIFI_WORK_MODE_MAX_V01 = 4, 
+	WIFI_WORK_MODE_E_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum.  Do not change or use*/
+}wifi_work_mode_e_v01;
+	
+typedef enum {
+	WIFI_IEEE80211_MODE_E_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum.  Do not change or use*/
+	WIFI_MODE_11A_V01 = 0, 
+	WIFI_MODE_11AN_V01 = 1, 
+	WIFI_MODE_11B_V01 = 2, 
+	WIFI_MODE_11BG_V01 = 3, 
+	WIFI_MODE_11BGN_V01 = 4, 
+	WIFI_MODE_11AC_V01 = 5, 
+	WIFI_IEEE80211_MODE_E_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum.  Do not change or use*/
+}wifi_ieee80211_mode_e_v01;;
+
+
+	
+typedef enum {
+	WIFI_BANDWIDTH_E_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum.  Do not change or use*/
+	WIFI_BANDWIDTH_20MHZ_V01 = 0, 
+	WIFI_BANDWIDTH_40MHZ_V01 = 1, 
+	WIFI_BANDWIDTH_80MHZ_V01 = 2, 
+	WIFI_BANDWIDTH_160MHZ_V01 = 3, 
+	WIFI_BANDWIDTH_MAX_V01 = 4, 
+	WIFI_BANDWIDTH_E_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum.  Do not change or use*/
+}wifi_bandwidth_e_v01;
+
+typedef enum {
+	WIFI_AUTH_E_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum.  Do not change or use*/
+	WIFI_AUTH_OPEN_V01 = 0, 
+	WIFI_AUTH_WEP_V01 = 1, 
+	WIFI_AUTH_WPA_PSK_V01 = 2, 
+	WIFI_AUTH_WPA2_PSK_V01 = 3, 
+	WIFI_AUTH_WPA_WPA2_PSK_BOTH_V01 = 4, 
+	WIFI_AUTH_WPA_V01 = 5, 
+	WIFI_AUTH_WPA2_V01 = 6, 
+	WIFI_AUTH_WPA_WPA2_BOTH_V01 = 7, 
+	WIFI_AUTH_WPS_V01 = 8, 
+	WIFI_AUTH_E_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum.  Do not change or use*/
+}wifi_auth_e_v01;
+/**
+    @}
+  */
+
+/** @addtogroup ql_manager_access_msgr_wifi_qmi_enums
+    @{
+  */
+typedef enum {
+	WIFI_WPA_PAIRWISE_E_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum.  Do not change or use*/
+	WIFI_AUTH_WPA_PAIRWISE_TKIP_V01 = 0, 
+	WIFI_AUTH_WPA_PAIRWISE_AES_V01 = 1, 
+	WIFI_AUTH_WPA_PAIRWISE_BOTH_V01 = 2, 
+	WIFI_WPA_PAIRWISE_E_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum.  Do not change or use*/
+}wifi_wpa_pairwise_e_v01;
+
+typedef enum {
+    QL_WIFI_EVENT_ENABLE_STATUS = 0,
+    QL_WIFI_EVENT_DISABLE_STATUS,
+    QL_WIFI_EVENT_AP_STATION,
+    QL_WIFI_EVENT_STA_STATUS,
+    QL_WIFI_EVENT_STA_SCAN_DONE,
+} ql_wifi_event_type_e;
+
+typedef enum {
+    QL_WIFI_STATUS_ENABLE = 0,
+    QL_WIFI_STATUS_DISABLE,
+    QL_WIFI_STATUS_ERR_DRIVER,
+    QL_WIFI_STATUS_ERR_SOFTWARE,
+} ql_wifi_status_e;
+
+typedef enum {
+    QL_WIFI_STATION_DISABLE = 0,    /* WiFi station is not enable */
+    QL_WIFI_STATION_CONNECTED,      /* WiFi station is connected hotspot */
+    QL_WIFI_STATION_DISCONNECTED    /* WiFi station is disconnect hotspot */
+} ql_wifi_station_status_e;
+
+typedef struct {
+    ql_wifi_event_type_e id;
+    union {
+        /* the QL_WIFI_ENABLE_STATUS or QL_WIFI_DISABLE_STATUS event */
+        ql_wifi_status_e status;
+        struct {
+            /* 
+             * If connected is true, the station is connected wifi hotspot.
+             * If connected is false, the station is disconnected wifi hotspot.
+             */
+            bool connected;
+            unsigned char mac[6];
+        } ap_sta_info;
+        ql_wifi_station_status_e sta_status;
+    };
+} ql_wifi_event_s;
+
+typedef void (*wifi_event_handle)(ql_wifi_event_s *event, void *arg);
+
+typedef enum {
+    QL_WIFI_WORK_MODE_STA = 0,      /* WiFi is in STA Mode */
+    QL_WIFI_WORK_MODE_AP0,          /* WiFi is in AP Mode */
+    QL_WIFI_WORK_MODE_AP0_STA,      /* WiFi is in AP/STA Mode */
+    QL_WIFI_WORK_MODE_AP0_AP1       /* WiFi is in AP/AP Mode */
+} ql_wifi_work_mode_e;
+
+typedef enum {
+    QL_WIFI_AP_INDEX_AP0 = 0,       /* Index 0 of AP/AP-STA/AP-AP Mode */
+    QL_WIFI_AP_INDEX_AP1            /* Index 1 of AP/AP-STA/AP-AP Mode */
+} ql_wifi_ap_index_e;
+
+typedef enum {
+    QL_WIFI_MODE_80211B = 0,        /* IEEE 802.11b (2.4 GHz) */
+    QL_WIFI_MODE_80211BG,           /* IEEE 802.11bg (2.4 GHz) */
+    QL_WIFI_MODE_80211BGN,          /* IEEE 802.11bgn (2.4 GHz) */
+    QL_WIFI_MODE_80211A,            /* IEEE 802.11a (5 GHz) */
+    QL_WIFI_MODE_80211AN,           /* IEEE 802.11an (5 GHz) */
+    QL_WIFI_MODE_80211AC            /* IEEE 802.11ac (5 GHz) */
+} ql_wifi_mode_type_e;
+
+typedef enum {
+    QL_WIFI_BANDWIDTH_HT20 = 0,    
+    QL_WIFI_BANDWIDTH_HT40,
+    QL_WIFI_BANDWIDTH_HT80
+} ql_wifi_bandwidth_type_e;
+
+typedef enum {
+    QL_WIFI_SSID_HIDE_DISABLE = 0,    
+    QL_WIFI_SSID_HIDE_ENABLE,
+} ql_wifi_ssidhide_type_e;
+
+typedef enum {
+    QL_WIFI_AUTH_OPEN = 0,             /* Open */
+    QL_WIFI_AUTH_WPA_PSK,              /* WPA Personal */
+    QL_WIFI_AUTH_WPA2_PSK,             /* WPA2 Personal */
+    QL_WIFI_AUTH_WPA_WPA2_PSK_BOTH,    /* WPA&WPA2 Personal */
+} ql_wifi_auth_e;
+
+typedef enum {
+    QL_WIFI_AUTH_WPA_PAIRWISE_AUTO = 0,    /* contain TKIP and AES */
+    QL_WIFI_AUTH_WPA_PAIRWISE_TKIP,
+    QL_WIFI_AUTH_WPA_PAIRWISE_AES
+} ql_wifi_auth_wpa_psk_e;
+
+typedef struct {
+    int auth;
+    union {
+        struct {
+            int default_index;
+            char passwd[4][64];
+        } wep;
+
+        struct {
+            short pairwise;
+            char passwd[64];
+            int group_rekey;
+        } wpa_psk;
+    };
+} ql_wifi_ap_auth_s;
+
+
+typedef enum {
+	WIFI_IDX_AP_0 = 1,
+	WIFI_IDX_AP_1,
+	WIFI_IDX_STA_0
+} wifi_index_e;
+
+typedef enum {
+	WIFI_WORK_MODE_AP = 0,
+	WIFI_WORK_MODE_STA,
+	WIFI_WORK_MODE_AP_STA,
+	WIFI_WORK_MODE_AP_AP,
+	WIFI_WORK_MODE_MAX
+} wifi_work_mode_e;
+
+typedef enum {
+	WIFI_START = 0,
+	WIFI_STOP,
+	WIFI_RESTART,
+} wifi_active_e;
+
+typedef enum {
+	WIFI_MODE_11A = 0,
+	WIFI_MODE_11AN,
+	WIFI_MODE_11B,
+	WIFI_MODE_11BG,
+	WIFI_MODE_11BGN,
+	WIFI_MODE_11AC
+} wifi_ieee80211_mode_e;
+
+typedef enum {
+	WIFI_BANDWIDTH_20MHZ = 0,
+	WIFI_BANDWIDTH_40MHZ,
+	WIFI_BANDWIDTH_80MHZ,
+	WIFI_BANDWIDTH_160MHZ,
+	WIFI_BANDWIDTH_MAX,
+} wifi_bandwidth_e;
+
+typedef enum {
+	WIFI_AUTH_OPEN = 0,
+	WIFI_AUTH_WEP,
+	WIFI_AUTH_WPA_PSK,
+	WIFI_AUTH_WPA2_PSK,
+	WIFI_AUTH_WPA_WPA2_PSK_BOTH,
+	WIFI_AUTH_WPA,
+	WIFI_AUTH_WPA2,
+	WIFI_AUTH_WPA_WPA2_BOTH,
+	WIFI_AUTH_WPS
+} wifi_auth_e;
+
+typedef enum {
+	WIFI_AUTH_WPA_PAIRWISE_TKIP = 0,
+	WIFI_AUTH_WPA_PAIRWISE_AES,
+	WIFI_AUTH_WPA_PAIRWISE_BOTH
+} wifi_wpa_pairwise_e;
+
+typedef enum {
+	WIFI_SSID_HIDE_DISABLE = 0,
+	WIFI_SSID_HIDE_ENABLE
+} wifi_ssid_hide_state_e;
+
+
+struct _auth {
+	unsigned char auth;
+	struct {
+		unsigned char pairwise;
+		unsigned char group_rekey;
+		unsigned char passwd[64];
+	} wpa_psk;
+	
+};
+
+
+typedef enum {
+	WIFI_INDEX_E_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum.  Do not change or use*/
+	WIFI_IDX_AP_0_V01 = 1, 
+	WIFI_IDX_AP_1_V01 = 2, 
+	WIFI_IDX_STA_0_V01 = 3, 
+	WIFI_INDEX_E_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum.  Do not change or use*/
+}wifi_index_e_v01;
+
+typedef enum {
+	RTK_WIFI_IEEE80211_MODE_E_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum.  Do not change or use*/
+	RTK_WIFI_WORKMODE_11B_V01 = 1, 
+	RTK_WIFI_WORKMODE_11BG_V01 = 3, 
+	RTK_WIFI_WORKMODE_11BGN_V01 = 11, 
+	RTK_WIFI_IEEE80211_MODE_E_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum.  Do not change or use*/
+}rtk_wifi_ieee80211_mode_e_v01;
+
+typedef enum {
+    QL_WIFI_AUTH_OPEN_V01 = 0,             /* Open */
+    QL_WIFI_SHARED_KEY,              /* Shared key */
+    QL_WIFI_AUTO                   /* Auto */
+} ql_wifi_auth_type_e;
+
+typedef enum {
+    QL_WIFI_ENCRYPT_TKIP = 2,           /* TKIP */
+    QL_WIFI_ENCRYPT_AES = 8,        /* AES */
+    QL_WIFI_ENCRYPT_TKIP_AES_MIXED = 10     /* TKIP & AES MIXED */
+} ql_wifi_encrypt_mode_e;
+
+typedef enum {
+    QL_WIFI_PSK_DISABLE = 0,    /* Encrypt disable */
+    QL_WIFI_PSK_WPA,            /* WPA */
+    QL_WIFI_PSK_WPA2,           /* WPA2 */
+    QL_WIFI_PSK_WPA_WPA2,       /* WPA-WPA2 */
+} ql_wifi_psk_enable_e;
+
+
+
+#define QL_WIFI_MAX_STA_NUM 16
+	
+	struct ql_mgmt_client_wifi_work_mode {
+		/*
+		 * WiFi work mode support AP, STA, AP+STA, AP-AP
+		 */
+		wifi_work_mode_e work_mode;
+	};
+	
+	struct ql_mgmt_client_wifi_enable {
+		bool state;
+	};
+	
+	struct ql_mgmt_client_wifi_country_code {
+		char country_code[2];
+	};
+	
+	struct ql_mgmt_client_wifi_mode {
+		wifi_index_e id;
+		wifi_ieee80211_mode_e mode;
+	};
+	
+	struct ql_mgmt_client_wifi_channel {
+		wifi_index_e id;
+		int channel;
+	};
+	
+	struct ql_mgmt_client_wifi_essid {
+		wifi_index_e id;
+		char ssid[32];
+	};
+	
+	struct ql_mgmt_client_wifi_ssid_hide {
+		wifi_index_e id;
+		wifi_ssid_hide_state_e state;
+	};
+	
+	struct ql_mgmt_client_wifi_bandwidth {
+		wifi_index_e id;
+		wifi_bandwidth_e bandwidth;
+	};
+	
+	struct ql_mgmt_client_wifi_max_sta {
+		wifi_index_e id;
+		int num;
+	};
+
+	
+	struct ql_mgmt_client_wifi_active {
+		wifi_index_e_v01 id;
+		unsigned char action_type;
+	};
+	
+	struct ql_mgmt_client_wifi_auth {
+		wifi_index_e id;
+		wifi_auth_e auth;
+		union {
+			struct {
+				int default_index;
+				char password[4][64];
+			} wep;
+			struct {
+				wifi_wpa_pairwise_e pairwise;
+				char password[64];
+				int group_rekey;
+			} wpa_psk;
+		};
+	};
+	
+	struct ql_mgmt_client_wifi_rssi {
+		wifi_index_e id;
+		int rssi;
+	};
+	
+	struct ql_mgmt_client_wifi_sta_info {
+		int count;
+		struct {
+			int ip;
+			char mac[6];
+			char hostname[32];
+			char ssid[32];
+			int uptime;
+			long long tx_bytes;
+			long long rx_bytes;
+		} sta[QL_WIFI_MAX_STA_NUM];
+	};
+	typedef struct{
+		struct ql_mgmt_client_wifi_enable enable;
+	
+	
+	}ql_mgmt_client_wifi_s_test;
+	
+	typedef struct {
+		union {
+			struct ql_mgmt_client_wifi_work_mode work_mode;
+			struct ql_mgmt_client_wifi_enable enable;
+			struct ql_mgmt_client_wifi_country_code country_code;
+			struct ql_mgmt_client_wifi_mode mode;
+			struct ql_mgmt_client_wifi_channel channel;
+			struct ql_mgmt_client_wifi_essid ssid;
+			struct ql_mgmt_client_wifi_ssid_hide ssid_hide;
+			struct ql_mgmt_client_wifi_bandwidth bandwidth;
+			struct ql_mgmt_client_wifi_max_sta max_sta;
+			struct ql_mgmt_client_wifi_active active;
+			struct ql_mgmt_client_wifi_auth auth;
+			struct ql_mgmt_client_wifi_rssi rssi;
+			struct ql_mgmt_client_wifi_sta_info sta_info;
+		};
+	} ql_mgmt_client_wifi_s;
+
+
+extern int ql_wifi_enable(void);
+
+/**
+ * Disables the WLAN. This function removes the kernel module for the Wi-Fi driver.
+ *
+ * @param None
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ */
+extern int ql_wifi_disable(void);
+
+/**
+ * Create thread to enables the WLAN. This function enables the WLAN based on the hostpad or wpa_supplicant 
+ * configuration provided. This function inserts the WLAN kernel module and advertises the SSID.
+ * 
+ * @param None
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ */
+
+
+extern int ql_wifi_status_get(ql_wifi_status_e *status);
+
+/**
+ * Set the WiFi configuration: WiFi work mode configuration.
+ *
+ * @param [in]   WiFi work mode
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ * @dependencies
+ *   ql_wifi_disable is must be disable
+ *
+ */
+
+extern int ql_wifi_ap_ssid_set(ql_wifi_ap_index_e idx, char *ssid);
+
+/**
+ * Get the WiFi configuration: the hotspot ssid mode configuration.
+ *
+ * @param [in]    Index of AP mode
+ * @param [out]   the hotspot ssid name
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ */
+extern int ql_wifi_ap_ssid_get(ql_wifi_ap_index_e idx, char *ssid);
+
+/**
+ * Set the WiFi configuration: hidden hotspot configuration.
+ *
+ * @param [in]    Index of AP mode
+ * @param [in]    If set true, hidden hotspot
+ *                If set false, open hotspot
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ */
+extern int ql_wifi_ap_ssid_hide_set(ql_wifi_ap_index_e idx, bool hide);
+
+/**
+ * Get the WiFi configuration: hidden hotspot configuration.
+ *
+ * @param [in]    Index of AP mode
+ * @param [in]    Get the hotspot hidden status
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ */
+extern int ql_wifi_ap_ssid_hide_get(ql_wifi_ap_index_e idx, bool *hide);
+
+/**
+ * Set the WiFi configuration: Operation mode configuration, such as 802.11a/b/n/ac.
+ *
+ * @param [in]   Index of AP mode
+ * @param [in]   Operation mode
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ */
+extern int ql_wifi_ap_mode_set(ql_wifi_ap_index_e idx, ql_wifi_mode_type_e mode);
+
+/**
+ * Get the WiFi configuration: Operation mode configuration, such as 802.11a/b/n/ac.
+ *
+ * @param [in]    Index of AP mode
+ * @param [out]   Operation mode
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ */
+extern int ql_wifi_ap_mode_get(ql_wifi_ap_index_e idx, ql_wifi_mode_type_e *mode);
+
+/**
+ * Set the WiFi configuration: HT or VHT capabilities (20MHz, 40MHz, 80MHz).
+ *
+ * @param [in]   Index of AP mode
+ * @param [in]   Bandwidth
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ * @dependencies
+ *   The WiFi Operation mode must be set 802.11bgn/802.11an/802.11ac.
+ */
+extern int ql_wifi_ap_bandwidth_set(ql_wifi_ap_index_e idx, ql_wifi_bandwidth_type_e bandwidth);
+
+/**
+ * Get the WiFi configuration: HT or VHT capabilities (20MHz, 40MHz, 80MHz).
+ *
+ * @param [in]    Index of AP mode
+ * @param [Out]   Bandwidth
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ * @dependencies
+ *   The WiFi Operation mode must be set 802.11bgn/802.11an/802.11ac.
+ */
+extern int ql_wifi_ap_bandwidth_get(ql_wifi_ap_index_e idx, ql_wifi_bandwidth_type_e *bandwidth);
+
+/**
+ * Set the WiFi configuration: channel number configuration.
+ *
+ * @param [in]   Index of AP mode
+ * @param [in]   Channel number
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ * @dependencies
+ *   1. if WiFi set 2.4GHz, the channel list: 
+ *   0/1/2/3/4/5/6/7/8/9/10/11/12/13/14
+ *   2. if WiFi set 5GHz, the channel list:
+ *   36/40/44/48/52/56/60/64/100/104/108/112/116/120/124/128/132/136/140/144/149/153/157/161/165/175/181 
+ */
+extern int ql_wifi_ap_channel_set(ql_wifi_ap_index_e idx, int channel);
+
+/**
+ * Get the WiFi configuration: channel number configuration.
+ *
+ * @param [in]    Index of AP mode
+ * @param [out]   Channel number
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ * @dependencies
+ *   1. if WiFi set 2.4GHz, the channel list: 
+ *   0/1/2/3/4/5/6/7/8/9/10/11/12/13/14
+ *   2. if WiFi set 5GHz, the channel list:
+ *   36/40/44/48/52/56/60/64/100/104/108/112/116/120/124/128/132/136/140/144/149/153/157/161/165/175/181 
+ */
+extern int ql_wifi_ap_channel_get(ql_wifi_ap_index_e idx, int *channel);
+
+/**
+ * Set the WiFi configuration: IEEE 802.11 specifies two authentication algorithms and WPA/IEEE 802.11i configuration.
+ *
+ * @param [in]   Index of AP mode
+ * @param [in]   authentication configuration
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ */
+extern int ql_wifi_ap_auth_set(ql_wifi_ap_index_e idx, ql_wifi_ap_auth_s *auth);
+
+/**
+ * Get the WiFi configuration: IEEE 802.11 specifies two authentication algorithms and WPA/IEEE 802.11i configuration.
+ *
+ * @param [in]   Index of AP mode
+ * @param [out]   authentication configuration
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ */
+extern int ql_wifi_ap_auth_get(ql_wifi_ap_index_e idx, ql_wifi_ap_auth_s *auth);
+
+/**
+ * Set the WiFi configuration: Maximum number of stations allowed in station table.
+ *
+ * @param [in]   Index of AP mode
+ * @param [in]   Maximum number of stations
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ */
+extern int ql_wifi_ap_max_sta_set(ql_wifi_ap_index_e idx, int max_sta_num);
+
+/**
+ * Get the WiFi configuration: Maximum number of stations allowed in station table.
+ *
+ * @param [in]    Index of AP mode
+ * @param [out]   Maximum number of stations
+ *
+ * @return 
+ *   On success, 0 is returned.  On error, -1 is returned.
+ * 
+ */
+extern int ql_wifi_ap_max_sta_get(ql_wifi_ap_index_e idx, int *max_sta_num);
+
+extern int ql_wifi_set_to_ap(ql_wifi_ap_index_e idx);
+
+extern int ql_wifi_set_to_sta(ql_wifi_ap_index_e idx);
+
+#endif /* end of __QL_WIFI_H__ */
+