Hi all,
Firstly, I’m a newbie with Embedded Wireless module. Please forgive me if I ask a stupid question.
I’m using SL8082 for my application with a eUICC SIM from a telco provider.
I establish the connection bw SL8082 with my server via HTTP protocol by using WIP Library and Security Library.
After booting up, I used APN1 to connect with server. The application can post/receive data to/from HTTP server. But when I change to APN2(I also re-establish PPP data connection). Application can’t post data to HTTP server anymore (At beginning, I thought it related to SSL session. After that, I try to close and re-establish SSL session again, but It still does not work). Just incase I perform a reset. The APN2 can post/receive data to/from HTTP server.
Note:
- APN1 and APN2 were got roaming from telco provider successfully.
- When booting up application with APN1, I didn’t perform any communication with HTTP server, then changed to APN2, the application can post/receive data to/from HTTP server with APN2. Then I changed to APN1, it didn’t work again.
This is my code:
void HTTPSSM_SendInternalHttpsPost(int https_id)
{
memset(sizeString, 0, sizeof(sizeString));
snprintf(sizeString, sizeof(sizeString), "%lu", Https[idx].last_post_size);
adl_wdPut2Sleep(ADL_TMR_S_TO_TICK(1000)); /* WD sleeps in order to avoid a reset */
if (Https[idx].SSLsession != NULL)
{
#ifdef SSL
#ifdef HANDLE_SSLSESSION
Https[idx].session_channel = wip_HTTPClientCreateOpts(
NULL, // no handler
NULL, // no context
WIP_COPT_HTTP_HEADER,
"User-Agent",
"WIPHTTP/1.0",
WIP_COPT_HTTP_DATA_ENCOD, FALSE,
WIP_COPT_HTTPS_SESSION_ID, Https[idx].SSLsession,
WIP_COPT_FINALIZER, finalizerCntr,
WIP_COPT_END);
#endif
#endif
}
else if (Https[idx].SSLsession == NULL || Https[idx].session_channel == NULL)
{
Https[idx].session_channel = wip_HTTPClientCreateOpts(
NULL, // no handler
NULL, // no context
WIP_COPT_HTTP_HEADER,
"User-Agent",
"WIPHTTP/1.0",
WIP_COPT_HTTP_DATA_ENCOD, FALSE,
WIP_COPT_FINALIZER, finalizerCntr,
WIP_COPT_END);
}
if (Https[idx].session_channel == NULL)
{
ERR("cannot create http session channel");
ErrCode = ACP_ERR_NO_SESSION;
}
// HTTP POST command
// ---------------------------
Https[idx].data_channel = wip_getFileOpts(Https[idx].session_channel,
(ascii *) Https[idx].server_addr,
httpssm_ClientDataHandler,
&Https[idx],
WIP_COPT_HTTP_METHOD,
WIP_HTTP_METHOD_POST,
WIP_COPT_HTTP_HEADER,
"User-Agent",
"WIPHTTP/1.0",
WIP_COPT_HTTP_HEADER,
"Accept",
"*/*",
WIP_COPT_HTTP_HEADER,
"Content-Type",
"application/octet-stream",
WIP_COPT_HTTP_HEADER,
"Content-Length",
sizeString,
WIP_COPT_FINALIZER, finalizerData,
WIP_COPT_END);
if (Https[idx].data_channel == NULL)
{
ERR("cannot create http data channel. session is: 0x%x", Https[idx].session_channel);
HTTPSSM_notify(Https[idx].id, ACPSVC_HTTPS_CEV_ERR_EVENT); /* trigger a retry */
}
}
Although data channel was created, but I didn’t receive any event WIP_CEV_OPEN, WIP_CEV_WRITE with the APN2.
Do you have any idea for this issue?
Thank you for your help,
Tai.