RA Flexible Software Package Documentation  Release v6.0.0

 
WiFi Onchip Silex Driver using r_sci_uart (rm_wifi_onchip_silex)

Functions

fsp_err_t rm_wifi_onchip_silex_open (wifi_onchip_silex_cfg_t const *const p_cfg)
 
fsp_err_t rm_wifi_onchip_silex_close ()
 
fsp_err_t rm_wifi_onchip_silex_disconnect ()
 
fsp_err_t rm_wifi_onchip_silex_socket_connected (fsp_err_t *p_status)
 
fsp_err_t rm_wifi_onchip_silex_network_info_get (uint32_t *p_ip_addr, uint32_t *p_subnet_mask, uint32_t *p_gateway)
 
fsp_err_t rm_wifi_onchip_silex_connect (const char *p_ssid, WIFISecurity_t security, const char *p_passphrase)
 
fsp_err_t rm_wifi_onchip_silex_mac_addr_get (uint8_t *p_macaddr)
 
fsp_err_t rm_wifi_onchip_silex_scan (WIFIScanResult_t *p_results, uint32_t maxNetworks)
 
fsp_err_t rm_wifi_onchip_silex_ping (uint8_t *p_ip_addr, uint32_t count, uint32_t interval_ms)
 
fsp_err_t rm_wifi_onchip_silex_ip_addr_get (uint32_t *p_ip_addr)
 
fsp_err_t rm_wifi_onchip_silex_avail_socket_get (uint32_t *p_socket_id)
 
fsp_err_t rm_wifi_onchip_silex_socket_status_get (uint32_t socket_no, uint32_t *p_socket_status)
 
int32_t rm_wifi_onchip_silex_tcp_shutdown (uint32_t socket_no, uint32_t shutdown_channels)
 
fsp_err_t rm_wifi_onchip_silex_socket_create (uint32_t socket_no, uint32_t type, uint32_t ipversion)
 
fsp_err_t rm_wifi_onchip_silex_tcp_connect (uint32_t socket_no, uint32_t ipaddr, uint32_t port)
 
fsp_err_t rm_wifi_onchip_silex_udp_connect (uint32_t socket_no, uint32_t ipaddr, uint32_t port, uint32_t type)
 
int32_t rm_wifi_onchip_silex_send (uint32_t socket_no, const uint8_t *p_data, uint32_t length, uint32_t timeout_ms)
 
int32_t rm_wifi_onchip_silex_recv (uint32_t socket_no, uint8_t *p_data, uint32_t length, uint32_t timeout_ms)
 
fsp_err_t rm_wifi_onchip_silex_socket_disconnect (uint32_t socket_no)
 
fsp_err_t rm_wifi_onchip_silex_dns_query (const char *p_textstring, uint8_t *p_ip_addr)
 
fsp_err_t RM_WIFI_ONCHIP_SILEX_EpochTimeGet (time_t *p_utc_time)
 
fsp_err_t RM_WIFI_ONCHIP_SILEX_LocalTimeGet (uint8_t *p_local_time, uint32_t size_string)
 
fsp_err_t RM_WIFI_ONCHIP_SILEX_SntpEnableSet (wifi_onchip_silex_sntp_enable_t enable)
 
fsp_err_t RM_WIFI_ONCHIP_SILEX_SntpServerIpAddressSet (uint8_t *p_ip_address)
 
fsp_err_t RM_WIFI_ONCHIP_SILEX_SntpTimeZoneSet (int32_t hours, uint32_t minutes, wifi_onchip_silex_sntp_daylight_savings_enable_t daylightSavingsEnable)
 

Detailed Description

Wifi and Socket implementation using the Silex SX-ULPGN WiFi module on RA MCUs.

Overview

This Middleware module supplies an implementation for the FreeRTOS WiFi interface and AzureRTOS NetxDuo WiFi interface using the Silex SX-ULPGN module.

You can find specifics about the WiFi and Secure Socket interface APIs supported by this module at these web sites: Wifi API.

The SX-ULPGN is a low-power, compact IEEE 802.11b/g/n 2.4GHz 1x1 Wireless LAN module equipped with the Qualcomm® QCA4010 Wireless SOC. The module comes readily equipped with radio certification for Japan, North America and Europe. More information about this module can be found at the Silex Web Site

Features

The WiFi Onchip Silex Middleware driver supplies these features:

Configuration

Build Time Configurations for rm_wifi_onchip_silex

The following build time configurations are defined in fsp_cfg/rm_wifi_onchip_silex_cfg.h:

ConfigurationOptionsDefaultDescription
Parameter Checking
  • Default (BSP)
  • Enabled
  • Disabled
Default (BSP) If selected code for parameter checking is included in the build.
Number of supported socket instancesRefer to the RA Configuration tool for available options.1 Enable number of socket instances
Size of RX buffer for socketManual Entry4096
Size of TX buffer for CMD PortManual Entry1500
Size of RX buffer for CMD PortManual Entry3000
Semaphore maximum timeoutManual Entry10000
Number of retries for AT commandsManual Entry10
Module Reset PortRefer to the RA Configuration tool for available options.06 Specify the module reset pin port for the MCU.
Module Reset PinRefer to the RA Configuration tool for available options.03 Specify the module reset pin for the MCU.
Enable SNTP Client
  • Enabled
  • Disabled
Disabled Should the SNTP client of the module be enabled

Configurations for Networking > WiFi Onchip Silex Driver using UART (rm_wifi_onchip_silex)

ConfigurationOptionsDefaultDescription
SNTP server IPv4 addressMust be a valid IPv4 address0.0.0.0
SNTP Timezone Offset from UTC HoursMust be between 12 and -12 hours0 Value in hours from 12 to -12
SNTP Timezone Offset from UTC MinutesMust be between 0 and 59 minutes0 Value in minutes from 0 to 59
Use Daylight Savings Time
  • Enabled
  • Disabled
Disabled Specify if daytime savings should be used for local time calulation

Note: It is suggested that when using the Silex Module that DTC and FIFO are enabled in the UART configuration to facilitate a more reliable data transfer between module and MCU.

Note: If you wish to use flow control then you must enable flow control in the RA Configuration editor. This can be found in the UART setting. It is advantageous to use flow control all the time since it allows the hardware to gate the flow of data across the serial bus. Without hardware flow control for faster data rate you will most likely see an overflow condition between MCU and the module device.

Note: Higher baud rates are supported in the RA Configuration editor and should be changed in the first UART configuration. There is no need to change the second UART baud rate since it is only used as an AT command channel.

Note: It is a good idea to also enable the FIFO in the UART configuration settings if you plan to use higher baud rates.

Interrupt Configuration

Refer to UART (r_sci_uart). R_SCI_UART_Open() is called by WiFi Onchip Silex Driver using r_sci_uart (rm_wifi_onchip_silex).

Clock Configuration

Refer to UART (r_sci_uart).

Pin Configuration

Refer to UART (r_sci_uart). R_SCI_UART_Open() is called by WiFi Onchip Silex Driver using r_sci_uart (rm_wifi_onchip_silex)

Usage Notes

Limitations

Examples

Basic Example

This is a basic example of minimal use of WiFi Middleware in an application.

void wifi_onchip_basic_example (void)
{
WIFIReturnCode_t wifi_err;
/* Setup Access Point connection parameters */
WIFINetworkParams_t net_params =
{
.ucChannel = 0,
.xPassword.xWPA.cPassphrase = "password",
.ucSSID = "access_point_ssid",
.xPassword.xWPA.ucLength = 8,
.ucSSIDLength = 17,
.xSecurity = eWiFiSecurityWPA2,
};
memset(scan_data, 0, sizeof(WIFIScanResult_t) * MAX_WIFI_SCAN_RESULTS);
memset(g_socket_recv_buffer, 0, sizeof(uint8_t) * SX_WIFI_SOCKET_RX_BUFFER_SIZE);
/* Open connection to the Wifi Module */
wifi_err = WIFI_On();
assert(eWiFiSuccess == wifi_err);
/* Connect to the Access Point */
wifi_err = WIFI_ConnectAP(&net_params);
assert(eWiFiSuccess == wifi_err);
/* Get address assigned by AP */
wifi_err = WIFI_GetIPInfo(&ipInfo);
assert(eWiFiSuccess == wifi_err);
/* Ping an address accessible on the network */
uint8_t ip_address[4] = {216, 58, 194, 174}; // NOLINT
const uint16_t ping_count = 3;
const uint32_t intervalMS = 100;
wifi_err = WIFI_Ping(&ip_address[0], ping_count, intervalMS);
assert(eWiFiSuccess == wifi_err);
/* Scan the local Wifi network for other APs */
wifi_err = WIFI_Scan(&scan_data[0], MAX_WIFI_SCAN_RESULTS);
assert(eWiFiSuccess == wifi_err);
/* Shutdown the WIFI */
}

SNTP example

An example of using Simple Network Time Protocol (SNTP) on WiFi in an application.

#define RM_WIFI_ONCHIP_SILEX_TEMP_BUFFER_SIZE (64)
/*
* Example of the use of SNTP with Wifi. Example gets the epoch time and local
* system time strings. It is also demonstrated how the user will need to disconnect
* from the access point to make changes to the SNTP configuration during runtime.
*
* Function assumes that the SNTP has been enabled and configured with proper
* SNTP server address. For brevity error checking has not been implemented.
*
*/
void wifi_onchip_sntp_example (void)
{
/* Setup Access Point connection parameters */
WIFINetworkParams_t net_params =
{
.ucSSID = "access_point_ssid",
.ucSSIDLength = 17,
.xPassword.xWPA.cPassphrase = "password",
.xPassword.xWPA.ucLength = 8,
.ucChannel = 0,
.xSecurity = eWiFiSecurityWPA2
};
uint8_t local_time[RM_WIFI_ONCHIP_SILEX_TEMP_BUFFER_SIZE];
time_t current_sys_time = 0;
// SNTP IP address
uint8_t ip_address_sntp_server_valid[4] = {216, 239, 35, 0}; // NOLINT : Static IP address
memset(local_time, 0, sizeof(local_time));
/* Open connection to the Wifi Module */
/* Connect to the Access Point */
WIFI_ConnectAP(&net_params);
/* Get the Epoch time in seconds since Jan 1, 1970 UTC */
/* Get the local time string */
RM_WIFI_ONCHIP_SILEX_LocalTimeGet((uint8_t *) local_time, sizeof(local_time));
/* Disconnect from the access point to make changes to the SNTP configuration */
/* Change the IP address of the server */
RM_WIFI_ONCHIP_SILEX_SntpServerIpAddressSet((uint8_t *) ip_address_sntp_server_valid);
/* Change the timezone to PST with daylight saving enabled */
RM_WIFI_ONCHIP_SILEX_SntpTimeZoneSet(-7, 0, WIFI_ONCHIP_SILEX_SNTP_DAYLIGHT_SAVINGS_ENABLE);
/* Connect back to the access point */
WIFI_ConnectAP(&net_params);
/* Get the Epoch time in seconds since Jan 1, 1970 UTC */
/* Get the local time string in format [DayOfWeek Month DayOfMonth Year Hour:Minute:Second] */
RM_WIFI_ONCHIP_SILEX_LocalTimeGet((uint8_t *) local_time, sizeof(local_time));
/* Disconnect from the Access Point and shutdown the WIFI module*/
}

Data Structures

struct  wifi_onchip_silex_cfg_t
 
struct  ulpgn_socket_t
 
struct  wifi_onchip_silex_instance_ctrl_t
 

Enumerations

enum  sx_ulpgn_socket_status_t
 
enum  sx_ulpgn_socket_rw
 
enum  wifi_onchip_silex_sntp_enable_t
 
enum  wifi_onchip_silex_sntp_daylight_savings_enable_t
 

Data Structure Documentation

◆ wifi_onchip_silex_cfg_t

struct wifi_onchip_silex_cfg_t

User configuration structure, used in open function

Data Fields
const uint32_t num_uarts Number of UART interfaces to use.
const uint32_t num_sockets Number of sockets to initialize.
const bsp_io_port_pin_t reset_pin Reset pin used for module.
const uart_instance_t * uart_instances[WIFI_ONCHIP_SILEX_CFG_MAX_NUMBER_UART_PORTS] SCI UART instances.
const
wifi_onchip_silex_sntp_enable_t
sntp_enabled Enable/Disable the SNTP Client.
const uint8_t * sntp_server_ip The SNTP server IP address string.
const int32_t sntp_timezone_offset_from_utc_hours Timezone offset from UTC in (+/-) hours.
const uint32_t sntp_timezone_offset_from_utc_minutes Timezone offset from UTC in minutes.
const
wifi_onchip_silex_sntp_daylight_savings_enable_t
sntp_timezone_use_daylight_savings Enable/Disable use of daylight saving time.
void * p_context User defined context passed into callback function.
void const * p_extend Pointer to extended configuration by instance of interface.

◆ ulpgn_socket_t

struct ulpgn_socket_t

Silex ULPGN Wifi internal socket instance structure

Data Fields
StreamBufferHandle_t socket_byteq_hdl Socket stream buffer handle.
StaticStreamBuffer_t socket_byteq_struct Structure to hold stream buffer info.
uint8_t socket_recv_buff[WIFI_ONCHIP_SILEX_CFG_MAX_SOCKET_RX_SIZE] Socket receive buffer used by byte queue.
uint32_t socket_status Current socket status.
uint32_t socket_recv_error_count Socket receive error count.
uint32_t socket_create_flag Flag to determine in socket has been created.
uint32_t socket_read_write_flag flag to determine if read and/or write channels are active.

◆ wifi_onchip_silex_instance_ctrl_t

struct wifi_onchip_silex_instance_ctrl_t

WIFI_ONCHIP_SILEX private control block. DO NOT MODIFY.

Data Fields
uint32_t open Flag to indicate if wifi instance has been initialized.
wifi_onchip_silex_cfg_t const * p_wifi_onchip_silex_cfg Pointer to initial configurations.
bsp_io_port_pin_t reset_pin Wifi module reset pin.
uint32_t num_uarts number of UARTS currently used for communication with module
uint32_t tx_data_size Size of the data to send.
uint32_t num_creatable_sockets Number of simultaneous sockets supported.
uint32_t curr_cmd_port Current UART instance index for AT commands.
uint32_t curr_data_port Current UART instance index for data.
uint8_t cmd_rx_queue_buf[WIFI_ONCHIP_SILEX_CFG_CMD_RX_BUF_SIZE] Command port receive buffer used by byte queue // FreeRTOS.
StreamBufferHandle_t socket_byteq_hdl Socket stream buffer handle.
StaticStreamBuffer_t socket_byteq_struct Structure to hold stream buffer info.
volatile uint32_t curr_socket_index Currently active socket instance.
uint8_t cmd_tx_buff[WIFI_ONCHIP_SILEX_CFG_CMD_TX_BUF_SIZE] Command send buffer.
uint8_t cmd_rx_buff[WIFI_ONCHIP_SILEX_CFG_CMD_RX_BUF_SIZE] Command receive buffer.
uint32_t at_cmd_mode Current command mode.
uint8_t curr_ipaddr[4] Current IP address of module.
uint8_t curr_subnetmask[4] Current Subnet Mask of module.
uint8_t curr_gateway[4] Current GAteway of module.
SemaphoreHandle_t tx_sem Transmit binary semaphore handle.
SemaphoreHandle_t rx_sem Receive binary semaphore handle.
uint8_t last_data[WIFI_ONCHIP_SILEX_RETURN_TEXT_LENGTH] Tailing buffer used for command parser.
uart_instance_t * uart_instance_objects[WIFI_ONCHIP_SILEX_CFG_MAX_NUMBER_UART_PORTS] UART instance objects.
SemaphoreHandle_t uart_tei_sem[WIFI_ONCHIP_SILEX_CFG_MAX_NUMBER_UART_PORTS] UART transmission end binary semaphore.
ulpgn_socket_t sockets[WIFI_ONCHIP_SILEX_CFG_NUM_CREATEABLE_SOCKETS] Internal socket instances.

Enumeration Type Documentation

◆ sx_ulpgn_socket_status_t

Silex ULPGN Wifi socket status types

◆ sx_ulpgn_socket_rw

Silex socket shutdown channels

◆ wifi_onchip_silex_sntp_enable_t

Silex WiFi module enable/disable for SNTP

◆ wifi_onchip_silex_sntp_daylight_savings_enable_t

Silex WiFi module enable/disable for SNTP

Function Documentation

◆ rm_wifi_onchip_silex_open()

fsp_err_t rm_wifi_onchip_silex_open ( wifi_onchip_silex_cfg_t const *const  p_cfg)

Opens and configures the WIFI_ONCHIP_SILEX Middleware module.

Parameters
[in]p_cfgPointer to pin configuration structure.
Return values
FSP_SUCCESSWIFI_ONCHIP_SILEX successfully configured.
FSP_ERR_ASSERTIONThe parameter p_cfg or p_instance_ctrl is NULL.
FSP_ERR_OUT_OF_MEMORYThere is no more heap memory available.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ALREADY_OPENModule is already open. This module can only be opened once.

◆ rm_wifi_onchip_silex_close()

fsp_err_t rm_wifi_onchip_silex_close ( )

Disables WIFI_ONCHIP_SILEX.

Return values
FSP_SUCCESSWIFI_ONCHIP_SILEX closed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_NOT_OPENModule is not open.

◆ rm_wifi_onchip_silex_disconnect()

fsp_err_t rm_wifi_onchip_silex_disconnect ( )

Disconnects from connected AP.

Return values
FSP_SUCCESSWIFI_ONCHIP_SILEX disconnected successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_NOT_OPENModule is not open.

◆ rm_wifi_onchip_silex_socket_connected()

fsp_err_t rm_wifi_onchip_silex_socket_connected ( fsp_err_t p_status)

Check if a specific socket instance is connected.

Parameters
[out]p_statusPointer to integer holding the socket connection status.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_ASSERTIONThe parameter p_status is NULL.
FSP_ERR_NOT_OPENThe instance has not been opened.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.

◆ rm_wifi_onchip_silex_network_info_get()

fsp_err_t rm_wifi_onchip_silex_network_info_get ( uint32_t *  p_ip_addr,
uint32_t *  p_subnet_mask,
uint32_t *  p_gateway 
)

Return the network information for the connection to the access point.

Parameters
[out]p_ip_addrPointer to integer holding the IP address.
[out]p_subnet_maskPointer to integer holding the subnet mask.
[out]p_gatewayPointer to integer holding the gateway.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_ASSERTIONA parameter pointer is NULL.
FSP_ERR_NOT_OPENThe instance has not been opened.
FSP_ERR_WIFI_AP_NOT_CONNECTEDNo connection to access point has happened.

◆ rm_wifi_onchip_silex_connect()

fsp_err_t rm_wifi_onchip_silex_connect ( const char *  p_ssid,
WIFISecurity_t  security,
const char *  p_passphrase 
)

Connects to the specified Wifi Access Point.

Parameters
[in]p_ssidPointer to SSID of Wifi Access Point.
[in]securitySecurity type to use for connection.
[in]p_passphrasePointer to the passphrase to use for connection.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ASSERTIONThe parameter p_ssid or p_passphrase is NULL.
FSP_ERR_NOT_OPENThe instance has not been opened.
FSP_ERR_INVALID_ARGUMENTNo commas are accepted in the SSID or Passphrase.

◆ rm_wifi_onchip_silex_mac_addr_get()

fsp_err_t rm_wifi_onchip_silex_mac_addr_get ( uint8_t *  p_macaddr)

Get MAC address.

Parameters
[out]p_macaddrPointer array to hold mac address.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ASSERTIONThe parameter p_macaddr is NULL.
FSP_ERR_NOT_OPENThe instance has not been opened.

◆ rm_wifi_onchip_silex_scan()

fsp_err_t rm_wifi_onchip_silex_scan ( WIFIScanResult_t p_results,
uint32_t  maxNetworks 
)

Get the information about local Wifi Access Points.

Parameters
[out]p_resultsPointer to a structure array holding scanned Access Points.
[in]maxNetworksSize of the structure array for holding APs.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ASSERTIONThe parameter p_results or p_instance_ctrl is NULL.
FSP_ERR_NOT_OPENThe instance has not been opened.

◆ rm_wifi_onchip_silex_ping()

fsp_err_t rm_wifi_onchip_silex_ping ( uint8_t *  p_ip_addr,
uint32_t  count,
uint32_t  interval_ms 
)

Ping an IP address on the network.

Parameters
[in]p_ip_addrPointer to IP address array.
[in]countNumber of pings to attempt.
[in]interval_msInterval between ping attempts.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ASSERTIONThe parameter p_ip_addr is NULL.
FSP_ERR_NOT_OPENThe instance has not been opened.

◆ rm_wifi_onchip_silex_ip_addr_get()

fsp_err_t rm_wifi_onchip_silex_ip_addr_get ( uint32_t *  p_ip_addr)

Get the assigned module IP address.

Parameters
[out]p_ip_addrPointer an array to hold the IP address.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ASSERTIONThe parameter p_ip_addr is NULL.
FSP_ERR_NOT_OPENThe instance has not been opened.

◆ rm_wifi_onchip_silex_avail_socket_get()

fsp_err_t rm_wifi_onchip_silex_avail_socket_get ( uint32_t *  p_socket_id)

Get the next available socket ID.

Parameters
[out]p_socket_idPointer to an integer to hold the socket ID.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_ASSERTIONThe parameter p_socket_id is NULL.
FSP_ERR_NOT_OPENThe instance has not been opened.
FSP_ERR_WIFI_FAILEDError occurred in the execution of this function

◆ rm_wifi_onchip_silex_socket_status_get()

fsp_err_t rm_wifi_onchip_silex_socket_status_get ( uint32_t  socket_no,
uint32_t *  p_socket_status 
)

Get the socket status.

Parameters
[in]socket_noSocket ID number.
[out]p_socket_statusPointer to an integer to hold the socket status
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_ASSERTIONThe parameter p_instance_ctrl or p_socket_status is NULL. The value of socket_no is greater than/equal num_creatable_sockets.
FSP_ERR_NOT_OPENThe instance has not been opened.

◆ rm_wifi_onchip_silex_tcp_shutdown()

int32_t rm_wifi_onchip_silex_tcp_shutdown ( uint32_t  socket_no,
uint32_t  shutdown_channels 
)

Shutdown portion of a socket

Parameters
[in]socket_noSocket ID number.
[in]shutdown_channelsSpecify if read or write channel is shutdown for socket
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_ASSERTIONThe parameter p_instance_ctrl is NULL. The value of socket_no is greater than/equal num_creatable_sockets.
FSP_ERR_NOT_OPENThe instance has not been opened.

◆ rm_wifi_onchip_silex_socket_create()

fsp_err_t rm_wifi_onchip_silex_socket_create ( uint32_t  socket_no,
uint32_t  type,
uint32_t  ipversion 
)

Create a new socket instance.

Parameters
[in]socket_noSocket ID number.
[in]typeSocket type.
[in]ipversionSocket IP type.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ASSERTIONThe p_instance_ctrl is NULL.
FSP_ERR_NOT_OPENThe instance has not been opened.

◆ rm_wifi_onchip_silex_tcp_connect()

fsp_err_t rm_wifi_onchip_silex_tcp_connect ( uint32_t  socket_no,
uint32_t  ipaddr,
uint32_t  port 
)

Connect to a specific IP and Port using socket.

Parameters
[in]socket_noSocket ID number.
[in]ipaddrIP address for socket connection.
[in]portPort number for socket connection.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_NOT_OPENThe instance has not been opened.

◆ rm_wifi_onchip_silex_udp_connect()

fsp_err_t rm_wifi_onchip_silex_udp_connect ( uint32_t  socket_no,
uint32_t  ipaddr,
uint32_t  port,
uint32_t  type 
)

Connect to a specific IP and Port using UDP socket.

Parameters
[in]socket_noSocket ID number.
[in]ipaddrIP address for socket connection. 0 if type is server.
[in]portPort number for socket connection.
[in]typeType of UDP connection. Can be client or server.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_NOT_OPENThe instance has not been opened.

◆ rm_wifi_onchip_silex_send()

int32_t rm_wifi_onchip_silex_send ( uint32_t  socket_no,
const uint8_t *  p_data,
uint32_t  length,
uint32_t  timeout_ms 
)

Send data over TCP to a server.

Parameters
[in]socket_noSocket ID number.
[in]p_dataPointer to data to send.
[in]lengthLength of data to send.
[in]timeout_msTimeout to wait for transmit end event
Return values
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ASSERTIONThe p_instance_ctrl or parameter p_data is NULL.
FSP_ERR_NOT_OPENThe instance has not been opened.

◆ rm_wifi_onchip_silex_recv()

int32_t rm_wifi_onchip_silex_recv ( uint32_t  socket_no,
uint8_t *  p_data,
uint32_t  length,
uint32_t  timeout_ms 
)

Receive data over TCP from a server.

Parameters
[in]socket_noSocket ID number.
[out]p_dataPointer to data received from socket.
[in]lengthLength of data array used for receive.
[in]timeout_msTimeout to wait for data to be received from socket.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_NOT_OPENThe instance has not been opened.
FSP_ERR_ASSERTIONThe p_instance_ctrl or parameter p_data is NULL.

◆ rm_wifi_onchip_silex_socket_disconnect()

fsp_err_t rm_wifi_onchip_silex_socket_disconnect ( uint32_t  socket_no)

Disconnect a specific socket connection.

Parameters
[in]socket_noSocket ID to disconnect
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_NOT_OPENThe instance has not been opened.
FSP_ERR_INVALID_ARGUMENTBad parameter value was passed into function.

◆ rm_wifi_onchip_silex_dns_query()

fsp_err_t rm_wifi_onchip_silex_dns_query ( const char *  p_textstring,
uint8_t *  p_ip_addr 
)

Initiate a DNS lookup for a given URL.

Parameters
[in]p_textstringPointer to array holding URL to query from DNS.
[out]p_ip_addrPointer to IP address returned from look up.
Return values
FSP_SUCCESSFunction completed successfully.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_ASSERTIONThe p_instance_ctrl, p_textstring, p_ip_addr is NULL.
FSP_ERR_NOT_OPENThe instance has not been opened.
FSP_ERR_INVALID_ARGUMENTThe URL passed in is to long.

◆ RM_WIFI_ONCHIP_SILEX_EpochTimeGet()

fsp_err_t RM_WIFI_ONCHIP_SILEX_EpochTimeGet ( time_t *  p_utc_time)

This will retrieve time info from an NTP server at the address entered via an during configuration. If the server isn’t set or the client isn’t enabled, then it will return an error. The date/time is retrieved as the number of seconds since 00:00:00 UTC January 1, 1970

Parameters
[out]p_utc_timeReturns the epoch time in seconds.
Return values
FSP_SUCCESSSuccessfully retrieved the system time from module.
FSP_ERR_ASSERTIONThe parameter utc_time or p_instance_ctrl is NULL.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_NOT_OPENModule is not open.

Get the current system time as the number of seconds since epoch 1970-01-01 00:00:00 UTC

◆ RM_WIFI_ONCHIP_SILEX_LocalTimeGet()

fsp_err_t RM_WIFI_ONCHIP_SILEX_LocalTimeGet ( uint8_t *  p_local_time,
uint32_t  size_string 
)

Get the current local time based on current timezone in a string . Exp: Wed Oct 15 1975 07:06:00

Parameters
[out]p_local_timeReturns local time in string format.
[in]size_stringSize of p_local_time string buffer.The size of this string needs to be at least 25 bytes
Return values
FSP_SUCCESSSuccessfully returned the local time string.
FSP_ERR_ASSERTIONThe parameter local_time or p_instance_ctrl is NULL.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_INVALID_SIZEString size value passed in exceeds maximum.

Get the current local time based on current timezone in a string format

◆ RM_WIFI_ONCHIP_SILEX_SntpEnableSet()

fsp_err_t RM_WIFI_ONCHIP_SILEX_SntpEnableSet ( wifi_onchip_silex_sntp_enable_t  enable)

Set the SNTP Client to Enable or Disable

Parameters
[in]enableCan be set to enable/disable for SNTP support.
Return values
FSP_SUCCESSSuccessfully set the value.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_NOT_OPENModule is not open.

Enable or Disable the SNTP Client Service

◆ RM_WIFI_ONCHIP_SILEX_SntpServerIpAddressSet()

fsp_err_t RM_WIFI_ONCHIP_SILEX_SntpServerIpAddressSet ( uint8_t *  p_ip_address)

Set the SNTP Client Server IP Address

Parameters
[in]p_ip_addressPointer to IP address of SNTP server in byte array format.
Return values
FSP_SUCCESSSuccessfully set the value.
FSP_ERR_ASSERTIONThe parameter p_ip_address or p_instance_ctrl is NULL.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_NOT_OPENModule is not open.

Update the SNTP Server IP Address

◆ RM_WIFI_ONCHIP_SILEX_SntpTimeZoneSet()

fsp_err_t RM_WIFI_ONCHIP_SILEX_SntpTimeZoneSet ( int32_t  hours,
uint32_t  minutes,
wifi_onchip_silex_sntp_daylight_savings_enable_t  daylightSavingsEnable 
)

Set the SNTP Client Timezone

Parameters
[in]hoursNumber of hours (+/-) used for timezone offset from GMT.
[in]minutesNumber of minutes used for timezone offset from GMT.
[in]daylightSavingsEnableEnable/Disable daylight saving in the timezone calculation.
Return values
FSP_SUCCESSSuccessfully set the value.
FSP_ERR_WIFI_FAILEDError occurred with command to Wifi module.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_INVALID_ARGUMENTParameter passed into function was invalid.

Update the SNTP Timezone