RAFW Flexible Software Package Documentation  Release v2.0.1

 
RM_AWS_LWIP_SOCK_WRAP_W Interface

Functions

fsp_err_t app_dpm_get_sleep_flag (UINT8 *p_flag)
 Retrieves the flag indicating whether the API to enter or exit DPM. More...
 
fsp_err_t app_dpm_set_sleep_flag (UINT8 _flag)
 Sets the flag indicating whether the system should enter or exit DPM. More...
 
fsp_err_t app_dpm_info_get (char *_name, app_dpm_info_rtm **rtm_info)
 Get if exist or allocate if not exist the RTM resource for Server apps. More...
 
fsp_err_t app_dpm_get_client_socket_port (UINT32 *p_port)
 Get the saved client' binding port from app_dpm_info_rtm struct. More...
 
fsp_err_t app_dpm_set_send_pub_flag (UINT8 _flag)
 Set the flag whether device publish to server or not. More...
 
fsp_err_t app_dpm_get_send_pub_flag (UINT8 *p_flag)
 Get the flag whether device publish to server or not. More...
 
fsp_err_t app_dpm_set_wait_job_next_flag (UINT8 _flag)
 Set the flag whether device need to wait the flag for next job or not. More...
 
fsp_err_t app_dpm_get_wait_job_next_flag (UINT8 *p_flag)
 Get the flag whether device need to wait the flag for next job or not. More...
 
fsp_err_t app_get_peer_ip_str (char **p_ipStr)
 Get the IP string of server to connect. More...
 
fsp_err_t app_get_random_local_port (UINT32 *p_port)
 Retrieves a randomly generated local port number for socket binding. More...
 
fsp_err_t app_get_count_of_reconnection (UINT32 *p_count)
 Get the number of reconnection attempts on DPM wakeup mode. More...
 
fsp_err_t app_socket_set_port_n_filter (UINT32 _defLocalPort)
 Register a binded local port for DPM mode and set port filter for DPM wakeup. More...
 
fsp_err_t app_set_persistent_session (UINT8 _value)
 Set the flag depending on whether the persistent session exists or not. More...
 
fsp_err_t app_is_persistent_session (UINT8 *p_value)
 Retrieves the flag indicating whether a persistent session is enabled. More...
 
fsp_err_t app_is_reconnected (UINT8 *p_value)
 Get the flag whether reconnection happened or not. More...
 
fsp_err_t app_set_reconnect_flag (UINT8 _value)
 Set the reconnection flag to the input paramter. More...
 
fsp_err_t app_dpm_get_recv_timeout_flag (UINT8 *p_value)
 Get the receive timeout flag. More...
 
fsp_err_t app_dpm_set_recv_timeout_flag (UINT8 _value)
 Set the receive timeout flag to the input paramter. More...
 
fsp_err_t app_dpm_get_unknown_uc_flag (UINT8 *p_value)
 Get the unknown UC flag. More...
 
fsp_err_t app_dpm_set_unknown_uc_flag (UINT8 _value)
 Set the unknown UC flag to the input paramter. More...
 
fsp_err_t app_set_ka_value (UINT16 _kaVal)
 Set the keepalive time interval for connection peer to the input parmeter by seconds. More...
 
fsp_err_t app_get_ka_value (UINT16 *p_kaVal)
 Get the keepalive time interval for communication with peer. More...
 
fsp_err_t app_dpm_set_rcv_ready (void)
 Notify the DPM module that the receiver is ready after DPM wakeup. More...
 
fsp_err_t persistant_read_callback_set (persistant_storage_read_cb_t cb)
 set read callback function to get server IP Address from nvram More...
 
fsp_err_t persistant_write_callback_set (persistant_storage_write_cb_t cb)
 set write callback function to set server IP Address to nvram More...
 
fsp_err_t awsiot_app_print_elapse_time_ms (const char *fmt,...)
 Check passed time. More...
 

Detailed Description

Interface for accessing AWS_LWIP_SOCK_WRAP_W Storage.

Summary

This section defines the API for the AWS_LWIP_SOCK_WRAP_W ( Networking) Module. The AWS_LWIP_SOCK_WRAP_W Module provides interface to control, access, write to lwIP .

Data Structures

struct  app_dpm_info_rtm
 data used to save persistent information on RTM for platform More...
 
struct  InternalRTM
 internal used RTM structure More...
 
struct  dpmAppThreadInfo
 structure for DPM App thread More...
 

Enumerations

enum  APPSleepMode
 Sleep mode enum. More...
 
enum  APPTimerMode
 The mode types of KA or RTC wakeup timer. More...
 

Data Structure Documentation

◆ app_dpm_info_rtm

struct app_dpm_info_rtm

data used to save persistent information on RTM for platform

Data Fields
INT32 tid doorlock close user timer id
INT32 interval doorlock close user timer timeout(sec) default 10sec.
INT32 bindPort tcp client bind port number
INT32 deltaDir delta direction
INT32 FOTAStat FOTA status.
UINT8 FOTAUrl[256] Server S3 url for FOTA.
char ServrIp[16] server ip string of the server

◆ InternalRTM

struct InternalRTM

internal used RTM structure

Data Fields
INT32 tid timer id
INT32 interval timer timeout (by seconds)
UINT8 mode timer purpose - 0: normal, 1~9: abnormal

◆ dpmAppThreadInfo

struct dpmAppThreadInfo

structure for DPM App thread

Enumeration Type Documentation

◆ APPSleepMode

Sleep mode enum.

Enumeration structure for Sleep mode

Enumerator
SLEEP_MODE_2 

PMGR_LLD_STATE2 or PMGR_LLD_STATE3.

SLEEP_MODE_3 

PMGR_LLD_DPM: DPM mode.

◆ APPTimerMode

The mode types of KA or RTC wakeup timer.

Enumeration structure for wakeup timer mode

Function Documentation

◆ app_dpm_get_sleep_flag()

fsp_err_t app_dpm_get_sleep_flag ( UINT8 *  p_flag)

Retrieves the flag indicating whether the API to enter or exit DPM.

Parameters
[out]p_flagPointer to a variable where the current DPM flag value will be stored.
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_dpm_set_sleep_flag()

fsp_err_t app_dpm_set_sleep_flag ( UINT8  _flag)

Sets the flag indicating whether the system should enter or exit DPM.

Parameters
[in]_flaggo DPM (1) or exit DPM (0)
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.
  • FSP_ERR_INVALID_ARGUMENT: Invalid flag value.

◆ app_dpm_info_get()

fsp_err_t app_dpm_info_get ( char *  _name,
app_dpm_info_rtm **  rtm_info 
)

Get if exist or allocate if not exist the RTM resource for Server apps.

Parameters
[in,out]rtm_infoPointer to store the address of the retrieved or newly allocated RTM resource
[in]_nameif null passed, _name will be assigned as predefined name
Returns
NULL if failure, an app_dpm_info_rtm pointer if success

◆ app_dpm_get_client_socket_port()

fsp_err_t app_dpm_get_client_socket_port ( UINT32 *  p_port)

Get the saved client' binding port from app_dpm_info_rtm struct.

Parameters
[out]p_portPointer to a variable where the retrieved client binding port number will be stored.
Returns
The saved client' binding port if DPM mode or NX_SUCCESS if not DPM mode

◆ app_dpm_set_send_pub_flag()

fsp_err_t app_dpm_set_send_pub_flag ( UINT8  _flag)

Set the flag whether device publish to server or not.

Parameters
[in]_flag1(increase) or 0(decrease)
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_dpm_get_send_pub_flag()

fsp_err_t app_dpm_get_send_pub_flag ( UINT8 *  p_flag)

Get the flag whether device publish to server or not.

Parameters
[out]p_flagPointer to a variable where the publish flag will be stored.
  • 0: Device has not published to the server.
  • 1: Device has published to the server.
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_dpm_set_wait_job_next_flag()

fsp_err_t app_dpm_set_wait_job_next_flag ( UINT8  _flag)

Set the flag whether device need to wait the flag for next job or not.

Parameters
[in]_flag1 or 0
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_dpm_get_wait_job_next_flag()

fsp_err_t app_dpm_get_wait_job_next_flag ( UINT8 *  p_flag)

Get the flag whether device need to wait the flag for next job or not.

Parameters
[out]p_flagPointer to a variable where the wait flag will be stored.
  • 0: Device does not need to wait for the next job.
  • 1: Device needs to wait for the next job.
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_get_peer_ip_str()

fsp_err_t app_get_peer_ip_str ( char **  p_ipStr)

Get the IP string of server to connect.

Parameters
[out]p_ipStrPointer to a variable that will receive the address of the server IP string.
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful

◆ app_get_random_local_port()

fsp_err_t app_get_random_local_port ( UINT32 *  p_port)

Retrieves a randomly generated local port number for socket binding.

Parameters
[out]p_portPointer to a variable where the generated local port number will be stored.
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_get_count_of_reconnection()

fsp_err_t app_get_count_of_reconnection ( UINT32 *  p_count)

Get the number of reconnection attempts on DPM wakeup mode.

Parameters
[out]p_countPointer to a variable where the reconnection attempt count will be stored.
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_socket_set_port_n_filter()

fsp_err_t app_socket_set_port_n_filter ( UINT32  _defLocalPort)

Register a binded local port for DPM mode and set port filter for DPM wakeup.

Parameters
[in]_defLocalPortport number for registration
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_set_persistent_session()

fsp_err_t app_set_persistent_session ( UINT8  _value)

Set the flag depending on whether the persistent session exists or not.

Parameters
[in]_value1 or 0
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_is_persistent_session()

fsp_err_t app_is_persistent_session ( UINT8 *  p_value)

Retrieves the flag indicating whether a persistent session is enabled.

Parameters
[out]p_valuePointer to a variable where the persistent session flag will be stored.
  • 0: Persistent session disabled.
  • 1: Persistent session enabled.
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_is_reconnected()

fsp_err_t app_is_reconnected ( UINT8 *  p_value)

Get the flag whether reconnection happened or not.

Parameters
[out]p_valuePointer to a variable where the reconnection flag will be stored.
  • 0: No reconnection has occurred.
  • 1: Reconnection has occurred.
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_set_reconnect_flag()

fsp_err_t app_set_reconnect_flag ( UINT8  _value)

Set the reconnection flag to the input paramter.

Parameters
[in]_valuetrue or false
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.
  • FSP_ERR_INVALID_ARGUMENT: _value is not 0 or 1.

◆ app_dpm_get_recv_timeout_flag()

fsp_err_t app_dpm_get_recv_timeout_flag ( UINT8 *  p_value)

Get the receive timeout flag.

Returns
DPM_RCV_NO_CONNECT, DPM_RCV_OK_CONNECT, or DPM_RCV_OK_SLEEP

◆ app_dpm_set_recv_timeout_flag()

fsp_err_t app_dpm_set_recv_timeout_flag ( UINT8  _value)

Set the receive timeout flag to the input paramter.

Parameters
[in]_valueReceive timeout flag value. Possible values:
  • DPM_RCV_NO_CONNECT: No connection received.
  • DPM_RCV_OK_CONNECT: Connection received successfully.
  • DPM_RCV_OK_SLEEP: Connection received, then system entered sleep.
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.
  • FSP_ERR_INVALID_ARGUMENT: _value is not a valid flag.

◆ app_dpm_get_unknown_uc_flag()

fsp_err_t app_dpm_get_unknown_uc_flag ( UINT8 *  p_value)

Get the unknown UC flag.

Parameters
[out]p_valuePointer to a variable where the unknown UC flag will be stored.
  • 0: No unknown UC detected.
  • 1: Unknown UC detected.
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_dpm_set_unknown_uc_flag()

fsp_err_t app_dpm_set_unknown_uc_flag ( UINT8  _value)

Set the unknown UC flag to the input paramter.

Parameters
[in]_value1 or 0
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_set_ka_value()

fsp_err_t app_set_ka_value ( UINT16  _kaVal)

Set the keepalive time interval for connection peer to the input parmeter by seconds.

Parameters
[in]_kaValkeepalive time interval by seconds
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_get_ka_value()

fsp_err_t app_get_ka_value ( UINT16 *  p_kaVal)

Get the keepalive time interval for communication with peer.

Parameters
[out]p_kaValPointer to a UINT16 variable where the keepalive interval (in seconds) will be stored.
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ app_dpm_set_rcv_ready()

fsp_err_t app_dpm_set_rcv_ready ( void  )

Notify the DPM module that the receiver is ready after DPM wakeup.

Return values
FSP_SUCCESSNotification sent successfully.
FSP_ERR_FAILUREFailed to notify the DPM module.

◆ persistant_read_callback_set()

fsp_err_t persistant_read_callback_set ( persistant_storage_read_cb_t  cb)

set read callback function to get server IP Address from nvram

Parameters
[in]cbcallback function
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ persistant_write_callback_set()

fsp_err_t persistant_write_callback_set ( persistant_storage_write_cb_t  cb)

set write callback function to set server IP Address to nvram

Parameters
[in]cbcallback function
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.

◆ awsiot_app_print_elapse_time_ms()

fsp_err_t awsiot_app_print_elapse_time_ms ( const char *  fmt,
  ... 
)

Check passed time.

Parameters
[in]fmtformatted string for debug
Returns
fsp_err_t Function execution status.
  • FSP_SUCCESS: Operation successful.