Forums - How to set Http port myself with qca4004 API?

5 posts / 0 new
Last post
How to set Http port myself with qca4004 API?
shirly
Join Date: 21 Feb 16
Posts: 1
Posted: Sun, 2016-02-21 19:15

hello everyone!  

as the topic say: i have a problem about settting the http port on qca4004 API.

the api provide method qcom_http_client_method()  to support http. like this

HTTPC_CONNECT_CMD               //connect

HTTPC_GET_CMD                        //http_get

HTTPC_DISCONNECT_CMD         //disconnect

but, the problem I faced is what should I do to use self-defined http-port not the default port 80. 

becasue of the consideration of security , I want to change the default port 80 to other port like 5677...

could anyone answer my question or provide anyother method??  

thanks a lot.

  • Up0
  • Down0
c_rayl
Join Date: 14 Jan 16
Posts: 19
Posted: Fri, 2016-04-08 01:11

Dear Customer,

 

As per you mentioned, change default port 80 -> 5677.

Please modify A_UINT8 *url. (e.g) http://192.168.1.1:5677.

8.3.45 qcom_http_client_method
Definition
Configure HTTP client
Prototype
A_STATUS qcom_http_client_method(
A_UINT32 cmd,
0 = HTTPC_CONNECT_CMD
1 = HTTPC_GET_CMD
2 = HTTPC_POST_CMD
3 = HTTPC_DATA_CMD
4 = HTTPC_DISCONNECT_CMD
5 = HTTPC_CONNECT_SSL_CMD
A_UINT8 *url,
Page name
A_UINT8 *data,
Object name
A_UNIT8 *value
Output of the HTTP client request
)
Return Value
A_OK on success, A_ERROR on failure

Regards,

Ray

  • Up0
  • Down0
Spartak
Join Date: 4 Nov 16
Posts: 1
Posted: Thu, 2018-01-25 08:55

qcom_http_client_method allways return A_ERROR. What can be wrong?

uint8_t localurl[] = "192.168.17.238";

uint8_t data1[128] = "9900";

int32_t error = qcom_http_client_method(HTTPC_CONNECT_CMD, &localurl, &data1, NULL);
  • Up0
  • Down1
svegesna Moderator
Join Date: 7 Jun 17
Posts: 20
Posted: Tue, 2018-01-30 06:05

Hi,

Please provide the QCA4004  DUT logs which you have observed.

Have you tried the below command parameters as well in the qcom_http_client_method() function?
HTTP_GET_CMD
HTTP_POST_CMD
HTTP_DATA_CMD
HTTP_DISCONNECT_CMD

Thanks,

Santhosh

 

 

  • Up0
  • Down0
jbhanu Moderator
Join Date: 6 Feb 17
Posts: 80
Posted: Tue, 2018-01-30 06:44

Hi , 

Have you tried giving  url value as http://192.168.1.1:5677 .

Else can you plaese try below with default sdk shell. Also which sdk version you are using?

Also can you please try with sdk shell defalut command like below

wmiconfig --ip_http_client connect <ipaddress_or_domain> <port_num>

Where:  ipaddress can be IPv4, IPv6, or a domain name for example www.Qualcomm.com 

 port_num is optional. If no port is provided, the client connects to port 80. 

PUT/PATCH/GET/POST requests can be issued in sequence once the connection is established

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.