# Unknown error in "atServerIntegrationTest" due to specific API loading

**URL:** <https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129>\
**Category:** Uncategorized\
**Created:** [September 30, 2022, 1:43am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129 "2022-09-30T01:43:32Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![takuyakobayashi](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@takuyakobayashi](https://mangoh.discourse.group/u/takuyakobayashi)\
**Post date:** [September 30, 2022, 1:43am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/1 "2022-09-30T01:43:33Z")

</div>

Hi, I am testing legato applications in GL7605.  
I try to install “[atServerIntegrationTest](https://github.com/legatoproject/legato-af/tree/master/apps/test/atServices/atServerIntegrationTest)” in legato-af and overwrite a new command.  
I could get the unedited sample atServerIntegrationTest with reference to [https://mangoh.discourse.group/t/at-cmds-for-mirage-talon-from-mangoh-red-board-at-port/4803/15](https://mangoh.discourse.group/t/at-cmds-for-mirage-talon-from-mangoh-red-board-at-port/4803/15) .  
I want to add an AT command and need the API with SIM information.  
However, when I overwrote .adef and .cdef to add the API “le\_sim.api”, a command is not working properly.  
I would like you to investigate the cause of the problem.

More details are described below.

- PC environment: Ubuntu 20.04.4 LTS 64 bit/ 5.15.0-46-generic
- Product: GL7605 w/ WP7605 version SWI9X07Y\_02.28.03.05 (from AT+GMR)
- leaf version: 2.4.0 / swi-wp76\_4.0.3
- legato version: 19.02.0\_4cb954265427b8c2c668a010ff5be274\_modified
- Settings:

```auto
＞AT!ENTERCND=“A710”
＞AT!USBCOMP=1,1,8014D

```

- Error command:

```auto
$ ssh root@192.168.2.2
# app runProc atServerIntegrationTest --exe=atServerTest -- tty /dev/ttyHS0

```

If normal, during the execution of this command, UART will receive AT command input.  
However, when I add the le\_sim.api description, the command exits immediately after execution.  
I tried with other APIs (e.g. le\_antenna.api) and it works correctly.

- Overwitten content:

1. Component.cdef

```auto
api{
 atServices/le_atServer.api
 (my directory)/legato-af/interfaces/modemServices/le_mcc.api *
 (my directory)/legato-af/interfaces/modemServices/le_sim.api
}

```

\*The sample code could not read le\_mcc.api, so it is rewritten.

1. atServerIntegrationTest.adef

```auto
bindings{
 atServerTest.atServerTestComp.le_atServer -> atService.le_atServer
 atServerTest.atServerTestComp.le_mcc -> atService.le_mcc
 atServerTest.atServerTestComp.le_sim -> atService.le_sim
}

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [September 30, 2022, 2:03am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/2 "2022-09-30T02:03:51Z")

</div>

you want to use UART or USB?

I saw you are configuring AT!USBCOMP but at the same time you are using /dev/ttyHS0

---

<div class="post-metadata">

**Author:** ![takuyakobayashi](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@takuyakobayashi](https://mangoh.discourse.group/u/takuyakobayashi)\
**Post date:** [September 30, 2022, 2:13am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/3 "2022-09-30T02:13:20Z")

</div>

Thanks for your reply.  
I have UART set up to recognize custom AT commands.  
I am following [https://mangoh.discourse.group/t/at-cmds-for-mirage-talon-from-mangoh-red-board-at-port/4803/15](https://mangoh.discourse.group/t/at-cmds-for-mirage-talon-from-mangoh-red-board-at-port/4803/15).  
In this forum, /dev/ttyHS0 which is equivalent to UART can receive AT commands while app runProc is running on USB.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [September 30, 2022, 2:48am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/4 "2022-09-30T02:48:47Z")

</div>

it should be:

```auto

api:
{
        atServices/le_atServer.api
        le_mcc.api
        le_sim.api
}

bindings:
{
    atServerTest.atServerTestComp.le_atServer -> atService.le_atServer
    atServerTest.atServerTestComp.le_mcc -> modemService.le_mcc
    atServerTest.atServerTestComp.le_sim -> modemService.le_sim
}

```

If .api cannot be found during compilation, you can see here:

> **[FX30S - Build Error - Couldn't find file 'le\_avc.api'](https://forum.legato.io/t/fx30s-build-error-couldnt-find-file-le-avc-api/5878/9)**
>
> Does your .sdef file in vscode show the airvantage directory: // Interfaces are searched for in the following directories. Each directory/sub-directory needs to // be identified here for the system to find and use .api files. interfaceSearch: { ...

---

<div class="post-metadata">

**Author:** ![takuyakobayashi](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@takuyakobayashi](https://mangoh.discourse.group/u/takuyakobayashi)\
**Post date:** [October 4, 2022, 5:17am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/5 "2022-10-04T05:17:49Z")

</div>

Thank you for your response, I solved the problem by changing the options in mkapp as follows.

```auto
mkapp -t wp76xx atServerIntegrationTest.adef -i ${LEGATO_ROOT}/interfaces/modemServices

```

I have another problem while writing the program, so let me ask you about it.  
I am first trying to create an AT command, AT&P, with the equivalent functionality of AT+CNUM.  
I use the le\_sim\_GetSubscriberPhoneNumber() function to get the SIM phone number, but the AT command port is frozen when I enter AT&P.  
If the program is written incorrectly, please tell us how to write it correctly.

I write below in atServerTest.c.  
I would like to display  
“ID=_PhoneNumber_  
OK”  
No compilation errors have occurred.

```auto
void automaticTest_AtNumberHandler
(
    le_atServer_CmdRef_t commandRef,
    le_atServer_Type_t type,
    uint32_t parametersNumber,
    void* contextPtr
)
{

    int NumberLength = 11;
    char Number[LE_ATDEFS_RESPONSE_MAX_BYTES]; //phone number container
    char rsp1[LE_ATDEFS_RESPONSE_MAX_BYTES]; // display char
   memset(Number, 0, LE_ATDEFS_RESPONSE_MAX_BYTES); // All zero initialize 
   memset(rsp1, 0, LE_ATDEFS_RESPONSE_MAX_BYTES); // All zero initialize
    snprintf(rsp1, LE_ATDEFS_RESPONSE_MAX_BYTES, "ID="); // initial string

    PrepareHandler(commandRef, type, parametersNumber, contextPtr);
    LE_ASSERT(le_sim_GetSubscriberPhoneNumber(LE_SIM_EMBEDDED, Number, NumberLength) == LE_OK);
    snprintf(rsp1+strlen(rsp1), NumberLength, "%s", Number); // marge phone number
    LE_ASSERT(le_atServer_SendIntermediateResponse(commandRef, rsp1) == LE_OK); // display ID=Num

    LE_ASSERT(le_atServer_SendFinalResultCode(commandRef, LE_ATSERVER_OK, "", 0) == LE_OK); // OK

    return;
}

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [October 4, 2022, 5:35am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/6 "2022-10-04T05:35:42Z")

</div>

does it work for AT+KHTTPCFG if you are using the code here?

> [@AT cmds for Mirage Talon from MangoH Red board AT port](https://mangoh.discourse.group/t/at-cmds-for-mirage-talon-from-mangoh-red-board-at-port/4803/17):
>
> You can use my attached application as reference. Steps: enter the following AT commands in AT command port: AT!ENTERCND=“A710” AT!USBCOMP=1,1,8014D at!RESET compile and download the application in console type the following: app runProc atServerIntegrationTest --exe=atServerTest – tty /dev/ttyGS1 in the new raw data port (check in device manager), type ATE1, you should see the following response: E TYPE: PARA E PARAM 0: 1 OK at+bridge=“OPEN” +BRIDGE TYPE: PARA +BRID…

If it works, you can modify the code of +KHTTPCFG

---

<div class="post-metadata">

**Author:** ![takuyakobayashi](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@takuyakobayashi](https://mangoh.discourse.group/u/takuyakobayashi)\
**Post date:** [October 4, 2022, 7:22am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/7 "2022-10-04T07:22:02Z")

</div>

I did not use it.  
I download it from the URL and run AT+KHTTPCFG.  
However, when I try to run the AT&P (I added), “app runProc …” is terminated.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [October 4, 2022, 8:09am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/8 "2022-10-04T08:09:28Z")

</div>

have you tried to debug it?  
which line is making the error?

If you put your code with le\_sim\_GetSubscriberPhoneNumber() function to Prepare\_http\_Handler() and trigger AT+KHTTPCFG, will it crash?

---

<div class="post-metadata">

**Author:** ![takuyakobayashi](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@takuyakobayashi](https://mangoh.discourse.group/u/takuyakobayashi)\
**Post date:** [October 5, 2022, 2:24am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/9 "2022-10-05T02:24:59Z")

</div>

mkapp is running fine and not getting any error messages.  
The AT+KHTTPCFG settings are also working fine, but still app runProc is terminated as soon as AT&P is executed.

Is there anything else I should rewrite besides Prepare\_http\_Handler()?

```auto
void automaticTest_AtNumberHandler
(
    le_atServer_CmdRef_t commandRef,
    le_atServer_Type_t type,
    uint32_t parametersNumber,
    void* contextPtr
)
{

    int NumberLength = 11;
    char Number[LE_ATDEFS_RESPONSE_MAX_BYTES]; //phone number container
    char rsp1[LE_ATDEFS_RESPONSE_MAX_BYTES]; // disply char
    memset(rsp1, 0, LE_ATDEFS_RESPONSE_MAX_BYTES); // All zero initialize
    snprintf(rsp1, LE_ATDEFS_RESPONSE_MAX_BYTES, "ID="); // initial string

    Prepare_http_Handler(commandRef, type, parametersNumber, contextPtr);
    LE_ASSERT(le_sim_GetSubscriberPhoneNumber(LE_SIM_EMBEDDED, Number, NumberLength) == LE_OK);
    snprintf(rsp1+strlen(rsp1), NumberLength, "%s", Number); // marge phone number
    LE_ASSERT(le_atServer_SendIntermediateResponse(commandRef, rsp1) == LE_OK); // display ID=Num

    LE_ASSERT(le_atServer_SendFinalResultCode(commandRef, LE_ATSERVER_OK, "", 0) == LE_OK); // OK

    return;
}

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [October 5, 2022, 2:44am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/10 "2022-10-05T02:44:57Z")

</div>

If you put your code with le\_sim\_GetSubscriberPhoneNumber() function to Prepare\_http\_Handler() and trigger AT+KHTTPCFG, will it crash?

This can isolate if your code has problem.  
If no problem is found, that means your code on AT&P has problem

Or you can delete your code with le\_sim\_GetSubscriberPhoneNumber() function in automaticTest\_AtNumberHandler() and see if the AT&P still trigger the crash.

---

<div class="post-metadata">

**Author:** ![takuyakobayashi](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@takuyakobayashi](https://mangoh.discourse.group/u/takuyakobayashi)\
**Post date:** [October 5, 2022, 7:03am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/11 "2022-10-05T07:03:15Z")

</div>

I isolated the problem and AT&P without le\_sim\_GetSubscriberPhoneNumber() is running fine.  
This is no different than before running AT+KHTTPCFG.

In summary, I guess the use of le\_sim\_GetSubscriberPhoneNumber() is preventing the app runProc from running.  
I tried to create an AT command using le\_sim\_GetIMSI(), and app runProc terminated in the same way.  
I think le\_sim.api affects app runProc or there is a problem with the function loading way.  
Is there any bug inthe function loading way in my program?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [October 5, 2022, 7:15am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/12 "2022-10-05T07:15:56Z")

</div>

For le\_sim\_GetSubscriberPhoneNumber(), you can run this component and see if there is problem:

> **[legato-af/apps/test/modemServices/sim/simUnitTest at master ·...](https://github.com/legatoproject/legato-af/tree/master/apps/test/modemServices/sim/simUnitTest)**
>
> master/apps/test/modemServices/sim/simUnitTest

Also you can refer to the CM tool which uses the same API le\_sim\_GetSubscriberPhoneNumber():

> <https://github.com/legatoproject/legato-af/blob/master/apps/tools/cm/cm_sim.c>

For le\_sim\_GetIMSI(), you can refer to this modemdemo sample application:

> <https://github.com/legatoproject/legato-af/blob/master/apps/sample/modemDemo/demoComponent/demo.c>

---

<div class="post-metadata">

**Author:** ![takuyakobayashi](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@takuyakobayashi](https://mangoh.discourse.group/u/takuyakobayashi)\
**Post date:** [October 21, 2022, 7:44am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/13 "2022-10-21T07:44:13Z")

</div>

Thanks for sharing many links.  
After trying various settings, I noticed that the argument used for le\_sim\_GetSubscriberPhoneNumber() was set incorrectly with the information of the SIM being used.  
By modifying as follows, the phone number was successfully output.

```auto
static le_sim_Id_t SimId = LE_SIM_EXTERNAL_SLOT_1;
LE_ASSERT(le_sim_GetSubscriberPhoneNumber(SimId, Number, sizeof(Number)) == LE_OK);

```

However, “app runProc” still crushes after executing “AT&P” command, and I cannot figure out why.  
After adding the description about AT+KHTTPCFG, the following error statement appears at the time of crash.

```auto
$ ssh root@192.168.2.2
root@swi-mdm9x28-wp:~# app start atServerIntegrationTest
root@swi-mdm9x28-wp:~# app runProc atServerIntegrationTest --exe=atServerTest -- tty /dev/ttyHS0
PROCESS: 2213 ,TID 2213
SIGNAL: 11, ADDR (nil), AT (nil) SI_CODE 0x00000001
ILLEGAL ADDRESS (nil)
LEGATO VERSION
19.02.0_4cb954265427b8c2c668a010ff5be274_modified

PROCESS COMMAND LINE
atServerTest@0 tty /dev/ttyHS0 
PROCESS MAP
7f555000-7f556000 r-xp 00000000 ed:01 85315 /legato/apps/ad152a34190881e1112013e3aeb7de70/read-only/bin/atServerTest
7f566000-7f567000 r--p 00001000 ed:01 85315 /legato/apps/ad152a34190881e1112013e3aeb7de70/read-only/bin/atServerTest
7f567000-7f568000 rw-p 00002000 ed:01 85315 /legato/apps/ad152a34190881e1112013e3aeb7de70/read-only/bin/atServerTest
7f568000-7f5ae000 rw-p 00000000 00:00 0 [heap]
b6c5b000-b6d87000 r-xp 00000000 fe:00 835 /lib/libc-2.27.so

[…]

ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]
BACKTRACE
PC at 00000000
LR at 00000000 [0xbe9c0634]
r0 00000000 r1 00000001 r2 b6ed68c0 r3 00000000 r4 00000000 r5 7f56a5a8
r6 00000000 r7 be9c0a30 r8 00000003 r9 b6ed6000 r10 7f567000 cpsr 60070010
fp 00000000 ip 00000000 sp be9c09a8 lr 00000000 pc 00000000
STACK be9c09a8, FRAME 00000000
be9c0928: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[...]
Abort while dumping the stack
DONE
root@swi-mdm9x28-wp:~#

```

Do you know why it crashes?  
Also, in the “atServerIntegrationTest”, are there any other APIs other than the ones quoted in the test file that are guaranteed to work?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [October 21, 2022, 8:14am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/14 "2022-10-21T08:14:18Z")

</div>

Didn’t you can run the program by AT+KHTTPCFG?  
If so, you can compare the routine of AT+KHTTPCFG and that of AT&P and figure out which line is making the crash, right?

For other command to try:

```auto

 AT+KHTTPCFG=0,"123.123.123.123",80,1 , you should see the following response:
*****
+KHTTPCFG PARAM 0: 0
+KHTTPCFG PARAM 1: 123.123.123.123
+KHTTPCFG PARAM 2: 80
+KHTTPCFG PARAM 3: 1

OK
*****

AT+KHTTPGET=0,"/index.php" , you should see the following response:
*****
+KHTTPGET PARAM 0: 0
+KHTTPGET PARAM 1: /index.php
CONNECT
HTTP/1.1 200 OK
Date: Fri, 17 Jan 2020 09:38:13 GMT
Server: Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.26
X-Powered-By: PHP/5.6.26
Content-Length: 4
Content-Type: text/html; charset=UTF-8

test

OK
*****

type AT+KHTTPCLOSE=0 , you should see the following response:
*****
+KHTTPCLOSE PARAM 0: 0

OK

*****

```

---

<div class="post-metadata">

**Author:** ![takuyakobayashi](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@takuyakobayashi](https://mangoh.discourse.group/u/takuyakobayashi)\
**Post date:** [October 27, 2022, 9:51am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/15 "2022-10-27T09:51:59Z")

</div>

Sorry, I tried the operation you suggested but it did not succeed.  
I will share the file I am editing.  
Would you please test the operation in the same environment?  
Please replace the folder with the sample on Git “/legato-af/apps/test/atServices/atServerIntegrationTest/” and run it. (I deleted CMakeLists.txt by mistake, please add it.)

Below are the details of the operations I perform.

1. Connect GL7605 with a miniSIM(in EXTERNAL\_SLOT\_1) to Ubunutu PC via USB (/dev/ttyUSB0,1,2)
2. Set as follows

```auto
$ screen /dev/ttyUSB2
> AT!MAPUART=17,1
> AT!ENTERCND="A710"
> AT!USBCOMP=1,1,8014D
> AT!RESET

```

1. Connect via SSH and run app runProc

```auto
$ ssh root@192.168.2.2
# app start atServerIntegrationTest
# app runProc atServerIntegrationTest --exe=atServerTest -- tty /dev/ttyHS0
(wait)

```

1. Connect GL7605 to PC via UART and access /dev/ttyUSB3 from another terminal
2. Set as follows

```auto
> ATE1
> AT+BRIDGE="OPEN"
> AT+BRIDGE="ADD"
> AT+KHTTPCFG=0,“116.66.221.43”,80,1

```

1. Input AT&P

```auto
> AT&P
ID= ***********
OK

```

1. app runProc crashes and you can’t input AT commands

[atServerIntegrationTest.zip](https://mangoh.discourse.group/uploads/short-url/wPr6SSYAZ7AbGBj0VW47u3fKctZ.zip) (12.5 KB)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [October 27, 2022, 10:07am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/16 "2022-10-27T10:07:49Z")

</div>

Your memset() has set wrong size for Number, that is why you see segmentation fault.  
You should use this in your code:

```auto
static void automaticTest_AtNumberHandler
(
    le_atServer_CmdRef_t commandRef,
    le_atServer_Type_t type,
    uint32_t parametersNumber,
    void* contextPtr
)
{

#if 0
    char Number[LE_MDMDEFS_PHONE_NUM_MAX_BYTES]; //phone number container
    char rsp1[LE_ATDEFS_RESPONSE_MAX_BYTES]; // display char
    memset(Number, 0, LE_ATDEFS_RESPONSE_MAX_BYTES); // All zero initialize
    memset(rsp1, 0, LE_ATDEFS_RESPONSE_MAX_BYTES); // All zero initialize
    snprintf(rsp1, LE_ATDEFS_RESPONSE_MAX_BYTES, "ID="); // initial string
    static le_sim_Id_t SimId = LE_SIM_EXTERNAL_SLOT_1; // Container of Sim State

    // PrepareHandler(commandRef, type, parametersNumber, contextPtr);
    //Prepare_http_Handler(commandRef, type, parametersNumber, contextPtr);
    le_sim_GetSubscriberPhoneNumber(SimId, Number, sizeof(Number));

    snprintf(rsp1+strlen(rsp1), sizeof(Number), "%s", Number); // marge phone number
    LE_ASSERT(le_atServer_SendIntermediateResponse(commandRef, rsp1) == LE_OK); // display ID=Num

    // LE_ASSERT(le_atServer_SendFinalResultCode(commandRef, LE_ATSERVER_OK, "", 0) == LE_OK); // OK
    LE_ASSERT(le_atServer_SendFinalResponse(commandRef, LE_ATSERVER_OK, false, "") == LE_OK);
#else

    char Number[LE_MDMDEFS_PHONE_NUM_MAX_BYTES]; //phone number container
        char rsp1[LE_ATDEFS_RESPONSE_MAX_BYTES]; // display char
        memset(Number, 0, LE_MDMDEFS_PHONE_NUM_MAX_BYTES); // All zero initialize
        memset(rsp1, 0, LE_ATDEFS_RESPONSE_MAX_BYTES); // All zero initialize
        snprintf(rsp1, LE_ATDEFS_RESPONSE_MAX_BYTES, "ID="); // initial string
        static le_sim_Id_t SimId = LE_SIM_EXTERNAL_SLOT_1; // Container of Sim State

        // PrepareHandler(commandRef, type, parametersNumber, contextPtr);
        //Prepare_http_Handler(commandRef, type, parametersNumber, contextPtr);
        le_sim_GetSubscriberPhoneNumber(SimId, Number, sizeof(Number));

        snprintf(rsp1+strlen(rsp1), sizeof(Number), "%s", Number); // marge phone number
       LE_ASSERT(le_atServer_SendIntermediateResponse(commandRef, rsp1) == LE_OK); // display ID=Num

    PrepareHandler(commandRef, type, parametersNumber, contextPtr);
        // Send Final response
        LE_ASSERT(le_atServer_SendFinalResponse(commandRef, LE_ATSERVER_OK, false, "") == LE_OK);

#endif
    return;
}

```

---

<div class="post-metadata">

**Author:** ![takuyakobayashi](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@takuyakobayashi](https://mangoh.discourse.group/u/takuyakobayashi)\
**Post date:** [November 1, 2022, 6:53am UTC](https://mangoh.discourse.group/t/unknown-error-in-atserverintegrationtest-due-to-specific-api-loading/10129/17 "2022-11-01T06:53:51Z")

</div>

Thank you for your debugging.  
I had forgotten to change the memset() argument when I changed Number array.  
AT&P now runs and exits successfully.
