[Feature][ZXW-124] add qser sim/sms demo

Only Configure:No
Affected branch:master
Affected module:uci
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update:No

Change-Id: Iab5de0f578ae562c908ce9c294ed83728198cd5b
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc.conf b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc.conf
index d5acc77..d8c6a80 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc.conf
+++ b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc.conf
@@ -225,6 +225,8 @@
 	service \
 	service-test \
         lynq-ril-service \
+        lynq-qser-sim-demo \
+        lynq-qser-sms-demo \
         uci \
         gdb \
         mobiletek-tester-rdit \
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
index 88778a9..31697ed 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
+++ b/cap/zx297520v3/sources/meta-zxic-custom/conf/distro/vehicle_dc_ref.conf
@@ -263,6 +263,8 @@
         poweralarm-demo \
         lynq-systime-demo \
         lynq-fota-backup \
+        lynq-qser-sim-demo \
+        lynq-qser-sms-demo \
         lynq-qser-data-demo \
         "
 
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sim-demo/files/lynq-qser-sim-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sim-demo/files/lynq-qser-sim-demo.cpp
new file mode 100755
index 0000000..abcea42
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sim-demo/files/lynq-qser-sim-demo.cpp
@@ -0,0 +1,436 @@
+#include <stdlib.h>

+#include <stdio.h>

+#include <string.h>

+#include <sys/types.h>

+#include <pthread.h>

+#include <unistd.h>

+#include <dlfcn.h>

+#include <stdint.h>

+

+#include"lynq-qser-sim-demo.h"

+

+

+#define BUF_SIZE 32

+#define BUF_PIN 8

+

+typedef uint32_t sim_client_handle_type;

+

+sim_client_handle_type  ph_sim = 2023;

+sim_client_handle_type  h_sim = 2023;

+int flag_init = 0;

+

+int (*qser_sim_client_init)(sim_client_handle_type  *ph_sim);

+int (*qser_sim_client_deinit)(sim_client_handle_type h_sim);

+int (*qser_sim_getimsi)(

+    sim_client_handle_type          h_sim,

+    QSER_SIM_APP_ID_INFO_T            *pt_info,   ///< [IN] The SIM identifier info.

+    char                            *imsi,      ///< [OUT] IMSI buffer

+    size_t                          imsiLen     ///< [IN] IMSI buffer length

+);

+

+int (*qser_sim_geticcid)

+(

+    sim_client_handle_type          h_sim,

+    QSER_SIM_SLOT_ID_TYPE_T     simId,     ///< [IN] The SIM identifier.

+    char                            *iccid,    ///< [OUT] ICCID

+    size_t                          iccidLen   ///< [IN] ICCID buffer length

+);

+

+int (*qser_sim_getphonenumber)

+(

+    sim_client_handle_type          h_sim,

+    QSER_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

+);

+int (*qser_sim_verifypin)(sim_client_handle_type h_sim, QSER_SIM_VERIFY_PIN_INFO_T *pt_info);

+int (*qser_sim_changepin)(sim_client_handle_type h_sim, QSER_SIM_CHANGE_PIN_INFO_T *pt_info);

+int (*qser_sim_unblockpin)(sim_client_handle_type h_sim, QSER_SIM_UNBLOCK_PIN_INFO_T *pt_info);

+int (*qser_sim_enablepin)(sim_client_handle_type h_sim, QSER_SIM_ENABLE_PIN_INFO_T *pt_info);

+int (*qser_sim_disablepin)(sim_client_handle_type h_sim, QSER_SIM_DISABLE_PIN_INFO_T *pt_info);

+int (*qser_sim_getcardstatus)(sim_client_handle_type h_sim, QSER_SIM_SLOT_ID_TYPE_T simId, QSER_SIM_CARD_STATUS_INFO_T *pt_info);

+

+

+typedef struct

+{

+    int  cmdIdx;

+    const char *funcName;

+} st_api_test_case;

+    

+//for server test

+st_api_test_case at_api_testcases[] = 

+{

+    {0,   "qser_sim_init"},

+    {1,   "qser_get_imsi"},

+    {2,   "qser_get_iccid"},

+    {3,   "qser_get_phonenumber"},

+    {4,   "qser_verify_pin"},

+    {5,   "qser_change_pin"},

+    {6,   "qser_unlock_pin"},

+    {7,   "qser_enable_pin"},

+    {8,   "qser_disable_pin"},

+    {9,   "qser_get_sim_status"},

+    {10,   "qser_deinit_sim"},

+    {-1,    NULL}

+};

+

+void print_help(void)

+{

+    int i;

+    printf("Supported test cases:\n");

+    for(i = 0; ; i++)

+    {

+        if(at_api_testcases[i].cmdIdx == -1)

+        {

+            break;

+        }

+        printf("%d:\t%s\n", at_api_testcases[i].cmdIdx, at_api_testcases[i].funcName);

+    }

+}

+

+int main(int argc, char const *argv[])

+{

+    int cmdIdx = 0;

+    int res    = 0;

+    

+    const char *lynq_libpath_sim = "/lib/liblynq-qser-sim.so";

+    void *dlHandle_sim = dlopen(lynq_libpath_sim, RTLD_NOW);

+    if (dlHandle_sim == NULL) 

+    {

+        printf("dlopen dlHandle_sim failed: %s\n", dlerror());

+        exit(EXIT_FAILURE);

+    }

+

+    print_help();

+    while(1)

+    {

+        printf("\nplease input cmd index(-1 exit): ");

+        scanf("%d", &cmdIdx);

+        if(cmdIdx == -1)

+        {

+            break;

+        }

+

+        switch(cmdIdx)

+        {

+            //"qser_sim_init"

+            case 0:

+            {

+                if(flag_init == 1)

+                {

+                   printf("init is already\n"); 

+                   break;

+                }

+                else{

+                    //int token;

+                    //printf("input token\n");

+                    //scanf("%d", &token);

+                    qser_sim_client_init = (int(*)(sim_client_handle_type  *ph_sim))dlsym(dlHandle_sim,"qser_sim_client_init");

+                    if(NULL != qser_sim_client_init)

+                    {

+                        res = qser_sim_client_init(&ph_sim);

+                        if(res == 0)

+                        {

+                            printf("Run qser_sim_client_init\n");

+                            flag_init = 1;

+                        }else{

+                            printf("qser_sim_client_init error\n");

+                        }

+                    }else{

+                        printf("qser_sim_client_init dlsym error\n");

+                    }

+                    break;

+                }

+            }

+    

+            //"qser_sim_getimsi"

+            case 1:

+            {

+                if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    char imsi[BUF_SIZE] = {0};

+                    QSER_SIM_APP_ID_INFO_T pt_info;

+                    qser_sim_getimsi = (int(*)(sim_client_handle_type h_sim, QSER_SIM_APP_ID_INFO_T *pt_info, char *imsi, size_t imsiLen))dlsym(dlHandle_sim,"qser_sim_getimsi");

+                    if(NULL != qser_sim_getimsi)

+                    {

+                        res = qser_sim_getimsi(h_sim, &pt_info, imsi, 0);

+                        if(res == 0)

+                        {

+                            printf("imsi is %s!!!\n",imsi);

+                        }else{

+                            printf("get imsi error, res = %d\n", res);

+                        }

+                    }else{

+                        printf("qser_sim_getimsi dlsym error\n");

+                    }

+                }

+                break;

+            }

+

+            //"qser_get_iccid"

+            case 2:

+            {

+                if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    char iccid[BUF_SIZE] = {0};

+                     qser_sim_geticcid = (int(*)(sim_client_handle_type h_sim, QSER_SIM_SLOT_ID_TYPE_T simId, char *iccid, size_t iccidLen))dlsym(dlHandle_sim,"qser_sim_geticcid");

+                    if(NULL != qser_sim_geticcid)

+                    {

+                        res = qser_sim_geticcid(h_sim, QSER_SIM_SLOT_ID_1, iccid, 0);

+                        if(res == 0)

+                        {

+                            printf("get iccid success!!! iccid is %s\n",iccid);

+                        }else{

+                            printf("get iccid error, res = %d\n", res);

+                        }

+                    }else{

+                        printf("qser_sim_geticcid dlsym error\n");

+                    }

+                }

+                break;

+            }

+            //qser_get_phonenumber

+            case 3:

+            {

+                if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    char phonenumber[BUF_SIZE] = "";

+                    QSER_SIM_APP_ID_INFO_T pt_info;

+                    qser_sim_getphonenumber = (int(*)(sim_client_handle_type h_sim, QSER_SIM_APP_ID_INFO_T *pt_info, char *phone_num, size_t phoneLen))dlsym(dlHandle_sim,"qser_sim_getphonenumber");

+                    if(NULL != qser_sim_getphonenumber)

+                    {

+                        res = qser_sim_getphonenumber(h_sim, &pt_info, phonenumber, 0);

+                        if(res == 0)

+                        {

+                            printf("get phonenumber success!!! phonenumber is %s\n",phonenumber);

+                        }else{

+                            printf("get phonenumber error, res = %d\n", res);

+                        }

+                    }else{

+                        printf("qser_sim_getphonenumber dlsym error\n");

+                    }

+                }

+                break;

+           }

+            //qser_verify_pin

+            case 4:

+            {

+                if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    char pin[BUF_PIN] = {0};

+                    QSER_SIM_VERIFY_PIN_INFO_T pt_info;

+                    printf("input pin\n");

+                    scanf("%s", pin);

+                    strncpy(pt_info.pin_value, pin, BUF_PIN);

+                    printf("pin_value = %s , pin = %s\n", pt_info.pin_value, pin);

+                    

+                    qser_sim_verifypin = (int(*)(sim_client_handle_type h_sim, QSER_SIM_VERIFY_PIN_INFO_T *pt_info))dlsym(dlHandle_sim,"qser_sim_verifypin");

+                    if(NULL != qser_sim_verifypin)

+                    {

+                        res = qser_sim_verifypin(h_sim, &pt_info);

+                        if(res == 0)

+                        {

+                            printf("verify pin success!!!\n");

+                        }else{

+                            printf("verify pin error, res = %d\n", res);

+                        }

+                    }else{

+                        printf("qser_sim_verifypin dlsym error\n");

+                    }

+                }

+                break;

+            }

+            //qser_change_pin

+            case 5:

+            {

+                if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    char old_pin[BUF_PIN] = {0};

+                    QSER_SIM_CHANGE_PIN_INFO_T pt_info;

+                    printf("input old pin\n");

+                    scanf("%s", old_pin);

+                    char new_pin[BUF_PIN] = {0};

+                    printf("input new pin\n");

+                    scanf("%s", new_pin);

+                    strncpy(pt_info.old_pin_value, old_pin, BUF_PIN);

+                    strncpy(pt_info.new_pin_value, new_pin, BUF_PIN);

+                    printf("pt_info.old_pin_value = %s, old_pin = %s\n", pt_info.old_pin_value, old_pin);

+                    printf("pt_info.new_pin_value = %s, new_pin = %s\n", pt_info.new_pin_value, new_pin);

+

+                    qser_sim_changepin = (int(*)(sim_client_handle_type h_sim, QSER_SIM_CHANGE_PIN_INFO_T *pt_info))dlsym(dlHandle_sim,"qser_sim_changepin");

+                    if(NULL != qser_sim_changepin)

+                    {

+                        res = qser_sim_changepin(h_sim, &pt_info);

+                        if(res == 0)

+                        {

+                            printf("change pin success!!!\n");

+                        }else{

+                            printf("change pin error, res = %d\n", res);

+                        }

+                    }else{

+                        printf("lynq_change_pin dlsym error\n");

+                    }

+                }

+                break;

+            }

+            //qser_unlock_pin

+            case 6:

+            {

+                if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    char puk[BUF_PIN] = {0};

+                    QSER_SIM_UNBLOCK_PIN_INFO_T pt_info;

+                    printf("input  puk\n");

+                    scanf("%s", puk);

+                    char new_pin[BUF_PIN] = {0};

+                    printf("input new pin\n");

+                    scanf("%s", new_pin);

+

+                    strncpy(pt_info.puk_value, puk, BUF_PIN);

+                    strncpy(pt_info.new_pin_value, new_pin, BUF_PIN);

+                    printf("pt_info.puk_value = %s, puk = %s\n", pt_info.puk_value, puk);

+                    printf("pt_info.new_pin_value = %s, new_pin = %s\n", pt_info.new_pin_value, new_pin);

+                    

+                    qser_sim_unblockpin = (int(*)(sim_client_handle_type h_sim, QSER_SIM_UNBLOCK_PIN_INFO_T *pt_info))dlsym(dlHandle_sim,"qser_sim_unblockpin");

+                    if(NULL != qser_sim_unblockpin)

+                    {

+                        res = qser_sim_unblockpin(h_sim, &pt_info);

+                        if(res == 0)

+                        {

+                            printf("unlock pin success!!!\n");

+                        }else{

+                            printf("unlock pin error, res = %d\n", res);

+                        }

+                    }else{

+                        printf("qser_sim_unblockpin dlsym error\n");

+                    }

+                }

+                break;

+            }

+            //qser_enable_pin

+            case 7:

+           {   

+                if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    char pin[BUF_PIN] = {0};

+                    QSER_SIM_ENABLE_PIN_INFO_T pt_info;

+                    printf("input pin\n");

+                    scanf("%s", pin);

+                    strncpy(pt_info.pin_value, pin, BUF_PIN);

+                    

+                    qser_sim_enablepin = (int(*)(sim_client_handle_type h_sim, QSER_SIM_ENABLE_PIN_INFO_T *pt_info))dlsym(dlHandle_sim,"qser_sim_enablepin");

+                    if(NULL != qser_sim_enablepin)

+                    {

+                        res = qser_sim_enablepin(h_sim, &pt_info);

+                        if(res == 0)

+                        {

+                            printf("pin enabled!!!\n");

+                        }else{

+                            printf("pin enable error, res =%d\n", res);

+                        }

+                    }else{

+                        printf("qser_sim_enablepin dlsym error\n");

+                    }                                    

+                }

+                break;

+            }

+            //qser_disable_pin

+            case 8:

+            {

+                if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    char pin[BUF_PIN] = {0};

+                    QSER_SIM_ENABLE_PIN_INFO_T pt_info;

+                    printf("input pin\n");

+                    scanf("%s", pin);

+                    strncpy(pt_info.pin_value, pin, BUF_PIN);

+                    

+                    qser_sim_disablepin = (int(*)(sim_client_handle_type h_sim, QSER_SIM_DISABLE_PIN_INFO_T *pt_info))dlsym(dlHandle_sim,"qser_sim_disablepin");

+                    if(NULL != qser_sim_disablepin)

+                    {

+                        res = qser_sim_disablepin(h_sim, &pt_info);

+                        if(res == 0)

+                        {

+                            printf("pin disnabled!!!\n");

+                        }else{

+                            printf("pin disable error,res = %d\n", res);

+                        }

+                    }else{

+                        printf("qser_sim_disablepin dlsym error\n");

+                    }

+                }

+                break;

+            }

+            //qser_get_sim_status   

+            case 9:

+            {

+                if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    QSER_SIM_CARD_STATUS_INFO_T pt_info;

+                    

+                    qser_sim_getcardstatus = (int(*)(sim_client_handle_type h_sim, QSER_SIM_SLOT_ID_TYPE_T simId, QSER_SIM_CARD_STATUS_INFO_T *pt_info))dlsym(dlHandle_sim,"qser_sim_getcardstatus");

+                    if(NULL != qser_sim_getcardstatus)

+                    {

+                        res = qser_sim_getcardstatus(h_sim, QSER_SIM_SLOT_ID_1, &pt_info);

+                        if(res == 0)

+                        {

+                            printf("state is %d !!!\n",pt_info.e_card_state);

+                        }else{

+                            printf("get imsi error,res = %d\n", res);

+                        }

+                    }else{

+                        printf("qser_sim_getcardstatus dlsym error\n");

+                    }

+                }

+                break;

+            }

+            //qser_deinit_sim

+            case 10:

+            {

+                qser_sim_client_deinit = (int(*)(sim_client_handle_type h_sim))dlsym(dlHandle_sim,"qser_sim_client_deinit");

+                if(NULL != qser_sim_client_deinit)

+                {

+                    res = qser_sim_client_deinit(h_sim);

+                    if(res == 0)

+                    {

+                        printf("sim deinit success is!!!\n");

+                    }else{

+                        printf("get imsi error, res = %d\n", res);

+                    }

+                }else{

+                    printf("qser_sim_client_deinit dlsym error\n");

+                }

+                flag_init = 0;

+                break;

+            }

+            default:

+                print_help();

+                break;

+        }

+            

+    }

+    

+   return 0;

+

+    

+}

+

+

diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sim-demo/files/lynq-qser-sim-demo.h b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sim-demo/files/lynq-qser-sim-demo.h
new file mode 100755
index 0000000..cdd905d
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sim-demo/files/lynq-qser-sim-demo.h
@@ -0,0 +1,167 @@
+#define QSER_SIM_IMSI_LEN_MAX     16  /**  Maximum length of IMSI data. */

+#define QSER_SIM_ICCID_LEN_MAX    20  /**  Maximum length of ICCID data. */

+

+

+typedef enum 

+{

+    E_QSER_SUCCESS                        = 0,    /**<  Success. */

+    E_QSER_ERROR_BADPARM                  = 4,    /**<  Bad parameter. */

+}E_QSER_ERROR_CODE_T;

+

+typedef enum 

+{

+    QSER_SIM_SLOT_ID_1          = 0xB01,    /**< Identify card in slot 1.  */

+    QSER_SIM_SLOT_ID_2          = 0xB02,    /**< Identify card in slot 2.  */

+}QSER_SIM_SLOT_ID_TYPE_T;

+

+typedef enum 

+{

+    QSER_SIM_APP_TYPE_UNKNOWN   = 0xB00,    /**<  Unknown application type  */

+    QSER_SIM_APP_TYPE_3GPP      = 0xB01,    /**< Identify the SIM/USIM application on the card.  */

+    QSER_SIM_APP_TYPE_3GPP2     = 0xB02,    /**< Identify the RUIM/CSIM application on the card.  */

+    QSER_SIM_APP_TYPE_ISIM      = 0xB03,    /**< Identify the ISIM application on the card.  */

+}QSER_SIM_APP_TYPE_T;

+

+typedef struct 

+{

+    QSER_SIM_SLOT_ID_TYPE_T     e_slot_id;  /**< Indicates the slot to be used. */

+    QSER_SIM_APP_TYPE_T         e_app;      /**< Indicates the type of the application. */

+}QSER_SIM_APP_ID_INFO_T;  /* Type */

+

+#define QSER_SIM_PIN_LEN_MAX  8   /**  Maximum length of PIN data. */

+

+typedef enum 

+{

+    QSER_SIM_PIN_ID_1 = 0xB01,  /**< Level 1 user verification.  */

+    QSER_SIM_PIN_ID_2 = 0xB02,  /**< Level 2 user verification.  */

+}QSER_SIM_PIN_ID_TYPE_T;

+

+typedef struct 

+{

+    QSER_SIM_APP_ID_INFO_T        app_info;                           /**< Application identification information. */

+    QSER_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[QSER_SIM_PIN_LEN_MAX];  /*  Value of the PIN */

+}QSER_SIM_VERIFY_PIN_INFO_T;

+

+typedef struct 

+{

+    QSER_SIM_APP_ID_INFO_T        app_info;                               /**< Application identification information. */

+    QSER_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[QSER_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[QSER_SIM_PIN_LEN_MAX];  /**< Value of the new PIN as a sequence of ASCII characters. */

+}QSER_SIM_CHANGE_PIN_INFO_T;

+

+typedef struct 

+{

+    QSER_SIM_APP_ID_INFO_T        app_info;                               /**< Application identification information. */

+    QSER_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[QSER_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[QSER_SIM_PIN_LEN_MAX];  /**< Value of the new PIN as a sequence of ASCII characters. */

+}QSER_SIM_UNBLOCK_PIN_INFO_T;

+

+/** Enables the PIN on an application. */

+typedef  QSER_SIM_VERIFY_PIN_INFO_T QSER_SIM_ENABLE_PIN_INFO_T; //Same 

+

+/** Disables the PIN of an application, */

+typedef  QSER_SIM_VERIFY_PIN_INFO_T QSER_SIM_DISABLE_PIN_INFO_T; //Same 

+

+

+typedef enum 

+{

+    QSER_SIM_PERSO_FEATURE_TYPE_UNKNOWN                 = 0xB00, /**<  Unknown personalization feature.  */

+    QSER_SIM_PERSO_FEATURE_TYPE_3GPP_NETWORK            = 0xB01, /**<  Featurization based on 3GPP MCC and MNC.  */

+    QSER_SIM_PERSO_FEATURE_TYPE_3GPP_NETWORK_SUBSET     = 0xB02, /**<  Featurization based on 3GPP MCC, MNC, and IMSI digits 6 and 7.  */

+    QSER_SIM_PERSO_FEATURE_TYPE_3GPP_SERVICE_PROVIDER   = 0xB03, /**<  Featurization based on 3GPP MCC, MNC, and GID1.  */

+    QSER_SIM_PERSO_FEATURE_TYPE_3GPP_CORPORATE          = 0xB04, /**<  Featurization based on 3GPP MCC, MNC, GID1, and GID2.  */

+    QSER_SIM_PERSO_FEATURE_TYPE_3GPP_SIM                = 0xB05, /**<  Featurization based on the 3GPP IMSI.  */

+    QSER_SIM_PERSO_FEATURE_TYPE_3GPP2_NETWORK_TYPE_1    = 0xB06, /**<  Featurization based on 3GPP2 MCC and MNC.  */

+    QSER_SIM_PERSO_FEATURE_TYPE_3GPP2_NETWORK_TYPE_2    = 0xB07, /**<  Featurization based on 3GPP2 IRM code.  */

+    QSER_SIM_PERSO_FEATURE_TYPE_3GPP2_RUIM              = 0xB08, /**<  Featurization based on 3GPP2 IMSI_M.  */

+}QSER_SIM_PERSO_FEATURE_TYPE_T;

+

+typedef enum 

+{

+    QSER_SIM_CARD_STATE_UNKNOWN                     = 0xB01,    /**< Card state unknown. */

+    QSER_SIM_CARD_STATE_ABSENT                      = 0xB02,    /**< Card is absent. */

+    QSER_SIM_CARD_STATE_PRESENT                     = 0xB03,    /**< Card is present. */

+    QSER_SIM_CARD_STATE_ERROR_UNKNOWN               = 0xB04,    /**< Unknown error state. */

+    QSER_SIM_CARD_STATE_ERROR_POWER_DOWN            = 0xB05,    /**< Power down. */

+    QSER_SIM_CARD_STATE_ERROR_POLL_ERROR            = 0xB06,    /**< Poll error. */

+    QSER_SIM_CARD_STATE_ERROR_NO_ATR_RECEIVED       = 0xB07,    /**<  Failed to receive an answer to reset.  */

+    QSER_SIM_CARD_STATE_ERROR_VOLT_MISMATCH         = 0xB08,    /**< Voltage mismatch. */

+    QSER_SIM_CARD_STATE_ERROR_PARITY_ERROR          = 0xB09,    /**< Parity error. */

+    QSER_SIM_CARD_STATE_ERROR_SIM_TECHNICAL_PROBLEMS= 0xB0A,    /**< Card returned technical problems. */

+}QSER_SIM_CARD_STATE_TYPE_T;  /**< Card state. */

+

+typedef enum 

+{

+    QSER_SIM_CARD_TYPE_UNKNOWN  = 0xB00,    /**<  Unidentified card type.  */

+    QSER_SIM_CARD_TYPE_ICC      = 0xB01,    /**<  Card of SIM or RUIM type.  */

+    QSER_SIM_CARD_TYPE_UICC     = 0xB02,    /**<  Card of USIM or CSIM type.  */

+}QSER_SIM_CARD_TYPE_T;

+

+typedef enum 

+{

+    QSER_SIM_PROV_STATE_NONE    = 0xB00,    /**<  Nonprovisioning.  */

+    QSER_SIM_PROV_STATE_PRI     = 0xB01,    /**<  Primary provisioning subscription.  */

+    QSER_SIM_PROV_STATE_SEC     = 0xB02,    /**<  Secondary provisioning subscription.  */

+}QSER_SIM_SUBSCRIPTION_TYPE_T;

+

+typedef enum 

+{

+    QSER_SIM_APP_STATE_UNKNOWN                  = 0xB00,    /**< Application state unknown. */

+    QSER_SIM_APP_STATE_DETECTED                 = 0xB01,    /**<  Detected state.  */

+    QSER_SIM_APP_STATE_PIN1_REQ                 = 0xB02,    /**<  PIN1 required.  */

+    QSER_SIM_APP_STATE_PUK1_REQ                 = 0xB03,    /**<  PUK1 required.  */

+    QSER_SIM_APP_STATE_INITALIZATING            = 0xB04,    /**<  Initializing.  */

+    QSER_SIM_APP_STATE_PERSO_CK_REQ             = 0xB05,    /**<  Personalization control key required.  */

+    QSER_SIM_APP_STATE_PERSO_PUK_REQ            = 0xB06,    /**<  Personalization unblock key required.  */

+    QSER_SIM_APP_STATE_PERSO_PERMANENTLY_BLOCKED= 0xB07,    /**<  Personalization is permanently blocked.  */

+    QSER_SIM_APP_STATE_PIN1_PERM_BLOCKED        = 0xB08,    /**<  PIN1 is permanently blocked.  */

+    QSER_SIM_APP_STATE_ILLEGAL                  = 0xB09,    /**<  Illegal application state.  */

+    QSER_SIM_APP_STATE_READY                    = 0xB0A,    /**<  Application ready state.  @newpage */

+}QSER_SIM_APP_STATE_TYPE_T;

+

+typedef enum 

+{

+    QSER_SIM_PIN_STATE_UNKNOWN                  = 0xB01,    /**< Unknown PIN state. */

+    QSER_SIM_PIN_STATE_ENABLED_NOT_VERIFIED     = 0xB02,    /**<  PIN required, but has not been verified.  */

+    QSER_SIM_PIN_STATE_ENABLED_VERIFIED         = 0xB03,    /**<  PIN required and has been verified.  */

+    QSER_SIM_PIN_STATE_DISABLED                 = 0xB04,    /**<  PIN not required.  */

+    QSER_SIM_PIN_STATE_BLOCKED                  = 0xB05,    /**<  PIN verification has failed too many times and is blocked. Recoverable through PUK verification.  */

+    QSER_SIM_PIN_STATE_PERMANENTLY_BLOCKED      = 0xB06,    /**<  PUK verification has failed too many times and is not recoverable.  */

+}QSER_SIM_PIN_STATE_TYPE_T;

+

+typedef struct 

+{

+    QSER_SIM_SUBSCRIPTION_TYPE_T      subscription;           /**<   Type of subscription (i.e., primary, secondary, etc.). */

+    QSER_SIM_APP_STATE_TYPE_T         app_state;              /**<   Current state of the application. */

+    QSER_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. */

+    QSER_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. */

+    QSER_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. */

+}QSER_SIM_CARD_APP_INFO_T;

+

+typedef struct 

+{

+    QSER_SIM_CARD_APP_INFO_T          app_3gpp;               /**<   Stores 3GPP application information. */

+    QSER_SIM_CARD_APP_INFO_T          app_3gpp2;              /**<   Stores 3GPP2 application information. */

+    QSER_SIM_CARD_APP_INFO_T          app_isim;               /**<   Stores ISIM application information. */

+}QSER_SIM_CARD_ALL_APP_INFO_T;

+

+typedef struct 

+{

+    QSER_SIM_CARD_STATE_TYPE_T      e_card_state;/**<   Current card and card error state. */

+    QSER_SIM_CARD_TYPE_T            e_card_type; /**<   Card type. */

+    QSER_SIM_CARD_ALL_APP_INFO_T      card_app_info; /**<   Stores all relevant application information. */

+}QSER_SIM_CARD_STATUS_INFO_T;

diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sim-demo/lynq-qser-sim-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sim-demo/lynq-qser-sim-demo.bb
new file mode 100755
index 0000000..391a5f9
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sim-demo/lynq-qser-sim-demo.bb
@@ -0,0 +1,33 @@
+# Package summary
+SUMMARY = "lynq-qser-sim-demo"
+# License, for example MIT
+LICENSE = "MIT"
+# License checksum file is always required
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+		  
+SRC_URI = "file://lynq-qser-sim-demo.h file://lynq-qser-sim-demo.cpp"
+
+SRC-DIR = "${S}/../lynq-qser-sim-demo"
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+#Parameters passed to do_compile()
+EXTRA_OEMAKE = "'TARGET_PLATFORM = ${TARGET_PLATFORM}'\"
+EXTRA_OEMAKE += "'MOBILETEK_RIL_CFG = ${MOBILETEK_RIL_CFG}'"
+
+LOCAL_C_INCLUDES = "-I."
+
+LOCAL_LIBS = "-L. -ldl -lstdc++"
+
+#INHIBIT_PACKAGE_STRIP = "1"
+S = "${WORKDIR}"
+
+#INHIBIT_PACKAGE_STRIP = "1"
+do_compile () {
+
+	${CXX} -Wall lynq-qser-sim-demo.cpp ${LOCAL_LIBS} ${LOCAL_C_INCLUDES} -o lynq-qser-sim-demo
+}
+
+do_install() {
+	install -d ${D}${bindir}/
+	install -m 0755 ${S}/lynq-qser-sim-demo ${D}${bindir}/
+}
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.cpp
new file mode 100755
index 0000000..16be058
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.cpp
@@ -0,0 +1,287 @@
+#include <stdlib.h>

+#include <stdio.h>

+#include <string.h>

+#include <sys/types.h>

+#include <pthread.h>

+#include <unistd.h>

+#include <dlfcn.h>

+#include <stdint.h>

+

+#include"lynq-qser-sms-demo.h"

+

+

+#define SMS_BUF  64

+#define MSG_BUF  100

+

+int flag_init = 0;

+

+typedef uint32_t sim_client_handle_type;

+sms_client_handle_type  ph_sms = 2022;

+sms_client_handle_type  h_sms = 2022;

+

+

+int (*qser_sms_client_init)(sms_client_handle_type  *ph_sms);

+int (*qser_sms_client_deinit)(sms_client_handle_type h_sms);

+int (*qser_sms_send_sms)(sms_client_handle_type h_sms, QSER_sms_info_t *pt_sms_info);

+int (*qser_sms_addrxmsghandler)(QSER_SMS_RxMsgHandlerFunc_t handlerPtr, void* contextPtr);

+int (*qser_sms_deletefromstorage)(sms_client_handle_type  h_sms, QSER_sms_storage_info_t  *pt_sms_storage);

+int (*qser_sms_getsmscenteraddress)(sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *set_sca_cfg);

+int (*qser_sms_setsmscenteraddress)(sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *get_sca_cfg);

+

+

+typedef struct

+{

+    int  cmdIdx;

+    const char *funcName;

+} st_api_test_case;

+    

+//for server test

+st_api_test_case at_api_testcases[] = 

+{

+    {0,   "qser_sms_client_init"},

+    {1,   "qser_sms_client_deinit"},

+    {2,   "qser_sms_send_sms"},

+    {3,   "qser_sms_addrxmsghandler"},

+    {4,   "qser_sms_deletefromstorage"},

+    {5,   "qser_sms_getsmscenteraddress"},

+    {6,   "qser_sms_setsmscenteraddress"},

+    {-1,    NULL}

+};

+

+void print_help(void)

+{

+    int i;

+    printf("Supported test cases:\n");

+    for(i = 0; ; i++)

+    {

+        if(at_api_testcases[i].cmdIdx == -1)

+        {

+            break;

+        }

+        printf("%d:\t%s\n", at_api_testcases[i].cmdIdx, at_api_testcases[i].funcName);

+    }

+}

+

+void qser_sms_handler(QSER_SMS_MsgRef msgRef, void* contextPtr) {

+    printf("[%s-%d] sms handler, msgRef->sms_data = %s\n", __FUNCTION__, __LINE__, msgRef->sms_data);

+}

+

+int main(int argc, char *argv[])

+{

+    int cmdIdx = 0;

+    int ret    = 0;

+    

+    const char *lynq_libpath_sms = "/lib/liblynq-qser-sms.so";

+    void *dlHandle_sms = dlopen(lynq_libpath_sms, RTLD_NOW);

+    if (dlHandle_sms == NULL) 

+    {

+        printf("dlopen dlHandle_sms failed: %s\n", dlerror());

+        exit(EXIT_FAILURE);

+    }

+

+    print_help();

+    while(1)

+    {

+        printf("\nplease input cmd index(-1 exit): ");

+        scanf("%d", &cmdIdx);

+        if(cmdIdx == -1)

+        {

+            break;

+        }

+

+        switch(cmdIdx)

+        {

+            //"qser_sms_client_init"

+            case 0:

+            {

+                if(flag_init == 1)

+                {

+                   printf("init is already\n"); 

+                   break;

+                }

+                else{

+                    //int token;

+                    printf("input token\n");

+                    //scanf("%d", &token);

+

+                    qser_sms_client_init = (int(*)(sms_client_handle_type  *ph_sms))dlsym(dlHandle_sms,"qser_sms_client_init");

+                    if(NULL != qser_sms_client_init)

+                    {

+                        ret = qser_sms_client_init(&ph_sms);

+                        if(ret == 0)

+                        {

+                            printf("Run qser_sms_client_init\n");

+                             flag_init = 1;

+                        }else{

+                            printf("qser_sim_client_init error\n");

+                        }

+                     }else{

+                            printf("qser_sim_client_init dlsym error\n");

+                     }

+                     break;

+                    }

+                }

+            //"qser_sms_client_deinit"

+            case 1:

+            {

+                 if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    qser_sms_client_deinit = (int (*)(sms_client_handle_type h_sms))dlsym(dlHandle_sms,"qser_sms_client_deinit");

+                    if(NULL != qser_sms_client_deinit)

+                    {

+                        ret = qser_sms_client_deinit(h_sms);

+                        if(ret == 0)

+                        {

+                            printf("sms deinit success");

+                        }else{

+                            printf("sms deinit error, ret = %d\n", ret);

+                        }

+                    }else{

+                        printf("qser_sms_client_deinit dlsym error\n");

+                    }

+                }

+                break;

+            }

+            //"qser_sms_send_sms"

+            case 2:

+            {

+                 if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    char telephony_num[SMS_BUF] = {};

+                    char msg[MSG_BUF] = {};

+                    QSER_sms_info_t  pt_sms_info;

+                    sprintf(telephony_num,"10086");

+                    sprintf(msg,"hello");

+                    strncpy(pt_sms_info.src_addr, telephony_num, SMS_BUF);

+                    strncpy(pt_sms_info.sms_data, msg, MSG_BUF);

+                    pt_sms_info.format = QSER_SMS_8BIT;

+                    printf("[%s,%d]  src_addr=%s, telephony_num = %s\n",__FUNCTION__,__LINE__, pt_sms_info.src_addr, telephony_num);

+                    printf("[%s,%d]  sms_data=%s, msg = %s\n",__FUNCTION__,__LINE__, pt_sms_info.sms_data, msg);

+

+                    qser_sms_send_sms = (int (*)(sms_client_handle_type h_sms, QSER_sms_info_t *pt_sms_info))dlsym(dlHandle_sms,"qser_sms_send_sms");

+                    if(NULL != qser_sms_send_sms)

+                    {

+                        ret = qser_sms_send_sms(h_sms, &pt_sms_info);

+                        if(ret == 0)

+                        {

+                            printf("send sms success");

+                        }else{

+                            printf("send sms error, ret = %d\n", ret);

+                        }

+                    }else{

+                        printf("qser_sms_send_sms dlsym error\n");

+                    }

+                }

+                break;

+            }

+            //"qser_sms_addrxmsghandler"

+            case 3:

+            {

+                 if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+

+                    qser_sms_addrxmsghandler = (int(*)(QSER_SMS_RxMsgHandlerFunc_t handlerPtr, void* contextPtr))dlsym(dlHandle_sms,"qser_sms_addrxmsghandler");

+

+                    if(NULL != qser_sms_addrxmsghandler)

+                    {

+                        ret = qser_sms_addrxmsghandler(qser_sms_handler, NULL);

+                        if(ret == 0)

+                        {

+                            printf("qser_sms_addrxmsghandler success");

+                        }else{

+                            printf("qser_sms_addrxmsghandler error, ret = %d\n", ret);

+                        }

+                    }else{

+                        printf("qser_sms_addrxmsghandler dlsym error\n");

+                    }

+                }

+                break;

+            }

+            //"qser_sms_deletefromstorage"

+            case 4:

+            {

+                 if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{

+                    QSER_sms_storage_info_t  pt_sms_storage;

+                    pt_sms_storage.storage_idx = 1;

+                    qser_sms_deletefromstorage = (int (*)(sms_client_handle_type  h_sms, QSER_sms_storage_info_t  *pt_sms_storage))dlsym(dlHandle_sms,"qser_sms_deletefromstorage");

+                    if(NULL != qser_sms_deletefromstorage)

+                    {

+                        ret = qser_sms_deletefromstorage(h_sms, &pt_sms_storage);

+                        if(ret == 0)

+                        {

+                            printf("ret= %d\n",ret);

+                        }else{

+                            printf("del sms error, ret = %d\n", ret);

+                        }

+                    }else{

+                        printf("qser_sms_deletefromstorage dlsym error\n");

+                    }

+                }

+                break;

+            }

+             //"qser_sms_getsmscenteraddress"

+            case 5:

+            {

+                if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{ 

+                    QSER_sms_service_center_cfg_t get_sca_cfg;

+                    qser_sms_getsmscenteraddress = (int (*)(sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *get_sca_cfg))dlsym(dlHandle_sms,"qser_sms_getsmscenteraddress");

+                    if(NULL != qser_sms_getsmscenteraddress)

+                    {

+                        ret = qser_sms_getsmscenteraddress(h_sms, &get_sca_cfg);

+                        if(ret == 0)

+                        {

+                            printf("get smsc success,service_center_addr = %s\n",get_sca_cfg.service_center_addr);

+                        }else{

+                            printf("get smsc error, ret = %d\n", ret);

+                        }

+                    }else{

+                        printf("qser_sms_getsmscenteraddress dlsym error\n");

+                    }

+                }

+                break;

+            }

+             //"qser_sms_setsmscenteraddress"

+            case 6:

+            {

+                if(flag_init == 0){

+                    printf("must init first\n");

+                }

+                else{ 

+                    QSER_sms_service_center_cfg_t set_sca_cfg;

+                    strncpy(set_sca_cfg.service_center_addr, "+8613800230500", 14);

+                    qser_sms_setsmscenteraddress = (int (*)(sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *set_sca_cfg))dlsym(dlHandle_sms,"qser_sms_setsmscenteraddress");

+                    if(NULL != qser_sms_setsmscenteraddress)

+                    {

+                        ret = qser_sms_setsmscenteraddress(h_sms, &set_sca_cfg);

+                        if(ret == 0)

+                        {

+                            printf("set smsc success");

+                        }else{

+                            printf("set smsc error, ret = %d\n", ret);

+                        }

+                    }else{

+                        printf("qser_sms_setsmscenteraddress dlsym error\n");

+                    }

+                }

+                break;

+            }

+            default:

+                print_help();

+                break;

+        }           

+    }

+    

+   return 0;

+}

diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.h b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.h
new file mode 100755
index 0000000..500d946
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/files/lynq-qser-sms-demo.h
@@ -0,0 +1,168 @@
+#define MIN_MSM_PARAM_NUM 4

+#define MIN_IMS_MSM_PARAM_NUM 6

+#define MIN_WRITMSM_PARAM_NUM 5

+#define MSG_MAX_LEN 1024

+#define TELEPHONNUM_LEN 64

+#define STORAGSMS_MAX_SIZE 128

+#define SMSC_MAX_LEN 22

+#define SMS_NUM_MAX 255

+

+typedef unsigned short uint16_t;

+typedef unsigned int uint32_t;

+typedef uint32_t sms_client_handle_type;

+

+/**  Maximum length of an SMS. */

+#define QSER_SMS_MAX_MT_MSG_LENGTH    1440

+

+/**  Maximum string length. */

+#define QSER_SMS_MAX_ADDR_LENGTH      252

+

+/**  Maximum string length. */

+#define QSER_SMS_MAX_SCA_TYPLENGTH 3

+

+typedef enum   

+{    

+    QSER_SMS_7BIT        = 0,

+    QSER_SMS_8BIT     = 1,

+    QSER_SMS_UCS2            = 2,

+    //<2017/12/28-QCM9XOL00004C001-P01-Vicent.Gao, <[SMS] Segment 1==> CharSet to Alpha implementation.>

+    QSER_SMS_IRA             = 3,

+    //>2017/12/28-QCM9XOL00004C001-P01-Vicent.Gao

+

+}QSER_SMS_T;   

+

+typedef enum   

+{    

+    QSER_SMS_MO               = 0,    ///< SMS mobile terminated message.  

+    QSER_SMS_MT               = 1,    ///< SMS mobile originated message. 

+    QSER_SMS_BROADCAST_MT      = 2     ///< SMS Cell Broadcast message.   

+}QSER_SMS_TYPT; 

+

+typedef enum 

+{

+    QSER_SMS_STORAGTYPNONE      = -1,   /**<  Message no need to store. */

+    QSER_SMS_STORAGTYPUIM       = 0,    /**<  Message store to UIM. */

+    QSER_SMS_STORAGTYPNV        = 1,    /**<  Message store to NV. */

+    QSER_SMS_STORAGTYPDB     = 2,    /**<  Message store to NV. */

+}QSER_SMS_STORAGTYPT;

+

+typedef enum 

+{

+    QSER_SMS_MESSAGMODUNKNOWN   = -1,   /**<  Message type CDMA */

+    QSER_SMS_MESSAGMODCDMA      = 0,    /**<  Message type CDMA */

+    QSER_SMS_MESSAGMODGW        = 1,    /**<  Message type GW. */

+}QSER_SMS_MODTYPT;

+

+typedef struct 

+ {

+    uint8_t total_segments;     /**<     The number of long  short message*/

+    uint8_t seg_number;         /**<     Current number.*/

+	uint8_t referencnumber;   /**< referencnumber.*/

+}QSER_sms_user_data_head_t; 

+

+typedef struct

+{

+    /* If sms is stored, it won't parse, you need read it by yourself */

+    QSER_SMS_STORAGTYPT storage;                          ///specify where stored this msg

+    

+    QSER_SMS_T       format;

+    QSER_SMS_TYPT         type;

+    char                    src_addr[QSER_SMS_MAX_ADDR_LENGTH]; ///Telephone number string.  

+    int                     sms_data_len;

+    char                    sms_data[QSER_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;

+    QSER_sms_user_data_head_t  user_data_head;                    //long sms user data head info.

+    QSER_SMS_MODTYPT    mode;                             ///specify where stored this msg cdma or gw area

+    uint32_t                storage_index;                      ///storage index, -1 means not store

+} QSER_sms_info_t;

+     

+typedef struct

+{

+    QSER_SMS_STORAGTYPT storage;

+    QSER_SMS_MODTYPT    mode;

+    uint32_t                storage_idx;

+} QSER_sms_storage_info_t;

+

+typedef enum 

+{

+    QSER_SMS_UNKNOWN            = -1, 

+    QSER_SMS_DISCARD            = 0x00, /*  Incoming messages for this route are discarded by the WMS service without 

+                                            notifying QMI_WMS clients */

+    QSER_SMS_STORAND_NOTIFY   = 0x01, /*  Incoming messages for this route are stored to the specified device 

+                                            memory, and new message notifications */

+    QSER_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 */

+    QSER_SMS_TRANSFER_AND_ACK   = 0x03, /*  Incoming messages for this route are transferred to the client, and ACK is

+                                            sent to the network */

+}QSER_SMS_RECEPTION_ACTION_TYPT;

+

+#define QSER_WMS_MESSAGLENGTH_MAX 255

+

+typedef enum 

+ {

+    QSER_WMS_MESSAGCDMA            = 0x00,     //- 0x00 -- MESSAGCDMA -- CDMA \n 

+    QSER_WMS_MESSAGGW_PP           = 0x06,     //- 0x06 -- MESSAGGW_PP -- GW_PP

+}QSER_WMS_MESSAGTYPE;

+

+

+typedef struct

+ {

+  QSER_WMS_MESSAGTYPE format;

+  uint32_t raw_messaglen;                             /**< Must be set to # of elements in raw_message */

+  uint8_t raw_message[QSER_WMS_MESSAGLENGTH_MAX];       /**< Raw message data*/

+}QSER_wms_send_raw_message_data_t; 

+

+typedef enum

+{

+  QSER_WMS_TL_CAUSCODADDR_VACANT                        = 0x00, 

+  QSER_WMS_TL_CAUSCODADDR_TRANSLATION_FAILURE           = 0x01, 

+  QSER_WMS_TL_CAUSCODNETWORK_RESOURCSHORTAGE          = 0x02, 

+  QSER_WMS_TL_CAUSCODNETWORK_FAILURE                    = 0x03, 

+  QSER_WMS_TL_CAUSCODINVALID_TELESERVICID             = 0x04, 

+  QSER_WMS_TL_CAUSCODNETWORK_OTHER                      = 0x05, 

+  QSER_WMS_TL_CAUSCODNO_PAGRESPONSE                   = 0x20, 

+  QSER_WMS_TL_CAUSCODDEST_BUSY                          = 0x21, 

+  QSER_WMS_TL_CAUSCODNO_ACK                             = 0x22, 

+  QSER_WMS_TL_CAUSCODDEST_RESOURCSHORTAGE             = 0x23, 

+  QSER_WMS_TL_CAUSCODSMS_DELIVERY_POSTPONED             = 0x24, 

+  QSER_WMS_TL_CAUSCODDEST_OUT_OF_SERV                   = 0x25, 

+  QSER_WMS_TL_CAUSCODDEST_NOT_AT_ADDR                   = 0x26, 

+  QSER_WMS_TL_CAUSCODDEST_OTHER                         = 0x27, 

+  QSER_WMS_TL_CAUSCODRADIO_IF_RESOURCSHORTAGE         = 0x40, 

+  QSER_WMS_TL_CAUSCODRADIO_IF_INCOMPATABILITY           = 0x41, 

+  QSER_WMS_TL_CAUSCODRADIO_IF_OTHER                     = 0x42, 

+  QSER_WMS_TL_CAUSCODENCODING                           = 0x60, 

+  QSER_WMS_TL_CAUSCODSMS_ORIG_DENIED                    = 0x61, 

+  QSER_WMS_TL_CAUSCODSMS_TERM_DENIED                    = 0x62, 

+  QSER_WMS_TL_CAUSCODSUPP_SERV_NOT_SUPP                 = 0x63, 

+  QSER_WMS_TL_CAUSCODSMS_NOT_SUPP                       = 0x64, 

+  QSER_WMS_TL_CAUSCODMISSING_EXPECTED_PARAM             = 0x65, 

+  QSER_WMS_TL_CAUSCODMISSING_MAND_PARAM                 = 0x66, 

+  QSER_WMS_TL_CAUSCODUNRECOGNIZED_PARAM_VAL             = 0x67, 

+  QSER_WMS_TL_CAUSCODUNEXPECTED_PARAM_VAL               = 0x68, 

+  QSER_WMS_TL_CAUSCODUSER_DATA_SIZERR                 = 0x69, 

+  QSER_WMS_TL_CAUSCODGENERAL_OTHER                      = 0x6A, 

+}QSER_WMS_TL_CAUSCODTYPE;

+

+

+

+typedef struct

+ {

+  uint16_t                              messagid;            /*  Message ID */

+  uint8_t                               causcodvalid;      /**< Must be set to true if causcode is being passed */

+  QSER_WMS_TL_CAUSCODTYPE           causcode;  

+}QSER_wms_raw_send_resp_t;

+

+typedef struct 

+ {

+  char service_center_addr[QSER_SMS_MAX_ADDR_LENGTH + 1];         /**<   Address of the service center.*/

+  uint8_t service_center_addr_typvalid;

+  char service_center_addr_type[QSER_SMS_MAX_SCA_TYPLENGTH + 1];    /**<   129 if the SMSC address does not start with a "+" characte;

+                                                                           145 if the SMSC address starts with a "+" character*/

+}QSER_sms_service_center_cfg_t;

+

+typedef QSER_sms_info_t       QSER_SMS_Msg_t; 

+typedef QSER_sms_info_t*      QSER_SMS_MsgRef; 

+typedef void (*QSER_SMS_RxMsgHandlerFunc_t)(QSER_SMS_MsgRef msgRef, void* contextPtr);

+

diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/lynq-qser-sms-demo.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/lynq-qser-sms-demo.bb
new file mode 100755
index 0000000..45430ac
--- /dev/null
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-sms-demo/lynq-qser-sms-demo.bb
@@ -0,0 +1,33 @@
+# Package summary
+SUMMARY = "lynq-qser-sms-demo"
+# License, for example MIT
+LICENSE = "MIT"
+# License checksum file is always required
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+		  
+SRC_URI = "file://lynq-qser-sms-demo.h file://lynq-qser-sms-demo.cpp"
+
+SRC-DIR = "${S}/../lynq-qser-sim-demo"
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+#Parameters passed to do_compile()
+EXTRA_OEMAKE = "'TARGET_PLATFORM = ${TARGET_PLATFORM}'\"
+EXTRA_OEMAKE += "'MOBILETEK_RIL_CFG = ${MOBILETEK_RIL_CFG}'"
+
+LOCAL_C_INCLUDES = "-I."
+
+LOCAL_LIBS = "-L. -ldl -lstdc++"
+
+#INHIBIT_PACKAGE_STRIP = "1"
+S = "${WORKDIR}"
+
+#INHIBIT_PACKAGE_STRIP = "1"
+do_compile () {
+
+	${CXX} -Wall lynq-qser-sms-demo.cpp ${LOCAL_LIBS} ${LOCAL_C_INCLUDES} -o lynq-qser-sms-demo
+}
+
+do_install() {
+	install -d ${D}${bindir}/
+	install -m 0755 ${S}/lynq-qser-sms-demo ${D}${bindir}/
+}