Other Parts Discussed in Thread: CC3235SF, CC3200
Hi Simplelink experts,
Can we use httpcli.c and httpcli.h which was given for CC3200 to CC3235SF. Because we have been migrating our code from CC3200 to CC3235SF. Our each and every functionality worked recently I faced issues in HTTP Server but that also I have been able to solve now when I use this function it is giving as -102
long device_provision_http_API_request()
{
unsigned long HostIP;
HTTPCli_Struct cli;
int32_t lRet;
memcpy((uint8_t *)&stFirmware.url_path,(uint8_t *)&stMqttConfig.Provision_url,strlen(stMqttConfig.Provision_url));
parse_hostname();
//DBG_MSG("gethostbyname before\r\n");
lRetVal = sl_NetAppDnsGetHostByName((signed char *)stFirmware.host_name,strlen((const char *)stFirmware.host_name), &HostIP, SL_AF_INET);
//lRetVal = sl_NetAppDnsGetHostByName((signed char *)"www.google.com",strlen((const char *)"www.google.com"), &HostIP, SL_AF_INET);
if(lRetVal < 0)
{
DBG_MSG("Failed to resolve host address\r\n");
return -1;
}
size_t ulLength = sprintf(debug_data, "%d\r\n",
HostIP);
uart1_send_fifo((uint8_t *)debug_data, ulLength);
DBG_MSG("gethostbyname ip resolved\r\n");
SlSockAddrIn_t addr;
addr.sin_family = SL_AF_INET;
addr.sin_port = sl_Htons(HOST_PORT);
addr.sin_addr.s_addr = sl_Htons(HostIP);
HTTPCli_construct(&cli);
lRetVal = HTTPCli_connect(&cli, (SlSockAddr_t *)&addr,HTTPCli_TYPE_TLS, NULL);
if (lRetVal < 0)
{
HTTPCli_disconnect(&cli);
HTTPCli_destruct(&cli);
return -1;
}
lRet = HTTPPostMethod(&cli);
HTTPCli_disconnect(&cli);
HTTPCli_destruct(&cli);
if(lRet != 0)
{
//HTTPCli_disconnect(&cli);
//HTTPCli_destruct(&cli);
if(lRet == -2)
{
DBG_MSG("Failed to post\r\n");
}
return -1;
}
return 1;
}
Can anyone point out that can we use the older API for HTTP Client? Please it is very urgent.
Thanks and Regards
Manish