WL865E4-P  36.07.001
M2MB FWUP Plugin HTTP Client

This section describes the M2MB APIs for FWUP Plugin for HTTP Client. More...

#define M2MB_FWUP_HTTPC_DEFAULT_MAX_BODY_LEN   2048
 
#define M2MB_FWUP_HTTPC_DEFAULT_MAX_HEADER_LEN   350
 
typedef struct M2M_FWUP_HTTP_CLIENT M2M_FWUP_HTTP_CLIENT_T
 HTTP client structure for FWUP. More...
 
M2MB_HTTPC_CTX_Tm2m_fwup_http_client_init (INT8 *SrvAddr, UINT32 SrvPort, UINT32 Timeout, UINT32 sslEnableFlag, M2MB_FWUP_USER_CB_T user_cb, INT8 *username, INT8 *password)
 FWUP module initialization for HTTP Client mode. More...
 
VOID m2m_fwup_http_client_deinit (M2MB_HTTPC_CTX_T *pFWUPHTTPcCtx)
 FWUP module de-initialization for HTTP Client mode. More...
 

Detailed Description

This section describes the M2MB APIs for FWUP Plugin for HTTP Client.

Macro Definition Documentation

◆ M2MB_FWUP_HTTPC_DEFAULT_MAX_BODY_LEN

#define M2MB_FWUP_HTTPC_DEFAULT_MAX_BODY_LEN   2048

Maximum body size supported for HTTPc

Definition at line 52 of file m2mb_fwup_plugin_httpclient.h.

◆ M2MB_FWUP_HTTPC_DEFAULT_MAX_HEADER_LEN

#define M2MB_FWUP_HTTPC_DEFAULT_MAX_HEADER_LEN   350

Maximum header size supported for HTTPc

Definition at line 53 of file m2mb_fwup_plugin_httpclient.h.

Typedef Documentation

◆ M2M_FWUP_HTTP_CLIENT_T

HTTP client structure for FWUP.

Structure for storing HTTP client related information for FWUP operations.

Function Documentation

◆ m2m_fwup_http_client_deinit()

VOID m2m_fwup_http_client_deinit ( M2MB_HTTPC_CTX_T pFWUPHTTPcCtx)

FWUP module de-initialization for HTTP Client mode.

This API de-initializes FWUP module for HTTP Client mode.

Parameters
[in]pFWUPHTTPcCtxPointer to HTTPc Context returned by m2m_fwup_http_clinet_init.
Returns

m2m_fwup_http_clinet_deinit( M2MB_HTTPC_CTX_T *pFWUPHTTPcCtx );

VOID m2m_fwup_httpc_resp_cb( UINT32 response_code )
{
resp_code = response_code;
if(M2MB_FWUP_OK_E == resp_code)
{
//Give success indication to host
}
else
{
//Give failure indicatino to host
}
}
int main()
{
...
pCtx = m2m_fwup_http_clinet_init( "192.168.20.3", 80, 10000, 0, m2m_fwup_httpc_resp_cb,
NULL, NULL );
if( pCtx == NULL )
{
return M2MB_ERROR;
}
...
m2m_fwup_http_clinet_deinit(pCtx);
return M2MB_OK;
}

◆ m2m_fwup_http_client_init()

M2MB_HTTPC_CTX_T* m2m_fwup_http_client_init ( INT8 SrvAddr,
UINT32  SrvPort,
UINT32  Timeout,
UINT32  sslEnableFlag,
M2MB_FWUP_USER_CB_T  user_cb,
INT8 username,
INT8 password 
)

FWUP module initialization for HTTP Client mode.

This API initializes FWUP module for HTTP Client mode.

Parameters
[in]SrvAddrAddress of HTTP server.
[in]SrvPortPort number of HTTP server.
[in]TimeoutTimeout in milliseconds.
[in]sslEnableFlagFlag to enable/disable SSL.
[in]user_cbUser callback to capture FWUP operational status.
[in]usernameUsername for HTTP server with authentication.
[in]passwordPassword for HTTP server with authentication.
Returns
Returns pointer to HTTPc context (M2MB_HTTPC_CTX_T) on success, NULL on failure.

m2m_fwup_http_clinet_init( INT8 *SrvAddr, UINT32 SrvPort, UINT32 Timeout, UINT32 sslEnableFlag, M2MB_FWUP_USER_CB_T user_cb, INT8 *username, INT8 *password );

VOID m2m_fwup_httpc_resp_cb( UINT32 response_code )
{
resp_code = response_code;
if(M2MB_FWUP_OK_E == resp_code)
{
//Give success indication to host
}
else
{
//Give failure indicatino to host
}
}
int main()
{
...
pCtx = m2m_fwup_http_clinet_init( "192.168.20.3", 80, 10000, 0, m2m_fwup_httpc_resp_cb,
NULL, NULL );
if( pCtx == NULL )
{
return M2MB_ERROR;
}
return M2MB_OK;
}