Skip to content

Commit

Permalink
WiSeConnect 3 SDK release: v3.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
wifi-ci-agent committed Aug 10, 2023
1 parent 0a9db52 commit 38a8f6d
Show file tree
Hide file tree
Showing 1,124 changed files with 16,136 additions and 12,374 deletions.
5 changes: 3 additions & 2 deletions components/console/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "sl_constants.h"
#include "sl_string.h"
#include "sl_utility.h"
#include "sl_net.h"
#include <stdint.h>
#include <stddef.h>
#include <limits.h>
Expand Down Expand Up @@ -168,7 +169,7 @@ sl_status_t console_parse_command(char *command_line,

#ifdef CONSOLE_SUB_COMMAND_SUPPORT // Note: Sub commands not yet supported
if (type == CONSOLE_ARG_SUB_COMMAND) {
command_line = token; // Not sure if this is right
command_line = token; // Not sure if this is right
db = (const console_database_t *)((uint32_t)(*output_command)->argument_list[a + 1]
+ ((*output_command)->argument_list[a + 2] << 8)
+ ((*output_command)->argument_list[a + 3] << 16)
Expand Down Expand Up @@ -312,7 +313,7 @@ sl_status_t console_parse_arg(console_argument_type_t type, char *line, uint32_t
case CONSOLE_ARG_IP_ADDRESS: {
sl_ipv4_address_t *temp_ip = (sl_ipv4_address_t *)line; // Write the converted value back into the line
*arg_result = (uint32_t)temp_ip;
return convert_string_to_sl_ipv4_address(line, temp_ip);
return sl_net_inet_addr(line, (uint32_t *)temp_ip);
} break;

case CONSOLE_ARG_HEX: {
Expand Down
5 changes: 5 additions & 0 deletions components/console_auto_gen/console_auto_gen.slcc
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ source:
- path: src/sl_string.c
include:
- path: inc
requires:
- name: socket_utility
- condition: ["si91x_internal_stack"]
name: iot_sockets

2 changes: 1 addition & 1 deletion components/console_auto_gen/src/console_argument_types.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const value_list_t console_argument_values[] =
[CONSOLE_TYPE( get_option_id )] = (const uint32_t[]){ 4, 2, 3, 5},
[CONSOLE_TYPE( ip_protocol )] = (const uint32_t[]){ IOT_SOCKET_IPPROTO_TCP, IOT_SOCKET_IPPROTO_UDP},
[CONSOLE_TYPE( ipv4_or_ipv6 )] = (const uint32_t[]){ 1, 2},
[CONSOLE_TYPE( net_interface )] = (const uint32_t[]){ SL_NET_DEFAULT_WIFI_AP_INTERFACE, SL_NET_DEFAULT_BLUETOOTH_INTERFACE, SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE, SL_NET_DEFAULT_ETHERNET_INTERFACE, SL_NET_DEFAULT_THREAD_INTERFACE, SL_NET_DEFAULT_ZWAVE_INTERFACE},
[CONSOLE_TYPE( net_interface )] = (const uint32_t[]){ SL_NET_WIFI_AP_INTERFACE, SL_NET_BLUETOOTH_INTERFACE, SL_NET_WIFI_CLIENT_INTERFACE, SL_NET_ETHERNET_INTERFACE, SL_NET_THREAD_INTERFACE, SL_NET_ZWAVE_INTERFACE},
[CONSOLE_TYPE( operating_band )] = (const uint32_t[]){ 0, 1, 2},
[CONSOLE_TYPE( option_name )] = (const uint32_t[]){ 4134, 8, 12306, 4102, 31},
[CONSOLE_TYPE( performance_mode )] = (const uint32_t[]){ HIGH_PERFORMANCE, ASSOCIATED_POWER_SAVE, ASSOCIATED_POWER_SAVE_LOW_LATENCY, STANDBY_POWER_SAVE, STANDBY_POWER_SAVE_WITH_RAM_RETENTION},
Expand Down
7 changes: 4 additions & 3 deletions components/protocol/wifi/si91x/sl_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
#include "sl_si91x_status.h"
#include "sl_si91x_types.h"
#include "sl_si91x_protocol_types.h"
#include "sl_si91x_socket.h"
#include "sl_si91x_driver.h"
#include "sl_rsi_utility.h"
#if defined(SI91X_SOCKET_FEATURE)
#include "sl_si91x_socket_utility.h"
#endif
#include <stdint.h>
#include <string.h>

Expand Down Expand Up @@ -117,7 +119,6 @@ static sl_status_t get_configured_join_request(sl_wifi_interface_t module_interf
join_request->ssid_len = client_configuration->ssid.length;
join_request->security_type = client_configuration->security;
join_request->power_level = convert_dbm_to_si91x_power_level(get_max_tx_power());
join_request->data_rate = SL_WIFI_AUTO_RATE;
convert_uint32_to_bytestream(SI91X_LISTEN_INTERVAL, join_request->listen_interval);
join_request->join_feature_bitmap = SI91X_JOIN_FEAT_BIT_MAP;

Expand Down Expand Up @@ -1393,7 +1394,7 @@ sl_status_t sl_wifi_stop_scan(sl_wifi_interface_t interface)
return SL_STATUS_WIFI_INTERFACE_NOT_UP;
}

// JIRA: https://jira.silabs.com/browse/WIFISDK-211. Once stop_scan() support for foreground scan is available, "bg_enabled" should be removed.
// Once stop_scan() support for foreground scan is available, "bg_enabled" should be removed.
if (bg_enabled == true) {
scan_request.bgscan_enable = SI91X_BG_SCAN_DISABLE;
status = sl_si91x_driver_send_command(RSI_WLAN_REQ_BG_SCAN,
Expand Down
4 changes: 2 additions & 2 deletions components/service/http_client/si91x/sl_http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ sl_status_t sl_http_client_init(const sl_http_client_configuration_t *client_con
}

// Check for network interface
if ((client_configuration->network_interface != SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE)
&& (client_configuration->network_interface != SL_NET_DEFAULT_WIFI_AP_INTERFACE)) {
if ((client_configuration->network_interface != SL_NET_WIFI_CLIENT_INTERFACE)
&& (client_configuration->network_interface != SL_NET_WIFI_AP_INTERFACE)) {
return SL_STATUS_INVALID_MODE;
}

Expand Down
3 changes: 3 additions & 0 deletions components/service/mqtt/si91x/sl_mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ sl_status_t sl_mqtt_client_connect(sl_mqtt_client_t *client,
// credentails.username_length is being used as offset as we store both user_name, password in same array.
memcpy(si91x_init_request.password, &credentials->data[credentials->username_length], credentials->password_length);

si91x_init_request.username_len = credentials->username_length;
si91x_init_request.password_len = credentials->password_length;

si91x_connect_request.is_password_present = 1;
si91x_connect_request.is_username_present = 1;

Expand Down
4 changes: 2 additions & 2 deletions components/service/network_manager/inc/sl_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ sl_status_t sl_net_delete_profile(sl_net_interface_t interface, sl_net_profile_i
/** @} */

/**
* \addtogroup NET_CREDENTIAL_FUNCTIONS Network Credentials
* \addtogroup NET_CREDENTIAL_FUNCTIONS Network Credential
* \ingroup SL_NET_FUNCTIONS
* @{ */

/***************************************************************************/ /**
* @brief
* Set a network credential.
* Set a network credential including client credentials, certificates, and keys.
* @pre
* @ref sl_net_init should be called before this API.
* @param[in] id
Expand Down
38 changes: 19 additions & 19 deletions components/service/network_manager/inc/sl_net_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@

/// Enumeration of network interfaces.
typedef enum {
SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE = (1 << 3), ///< WiFi Client Default Interface
SL_NET_DEFAULT_WIFI_AP_INTERFACE = (2 << 3), ///< WiFi Access Point Default Interface
SL_NET_DEFAULT_ETHERNET_INTERFACE = (3 << 3), ///< Ethernet Default Interface
SL_NET_DEFAULT_THREAD_INTERFACE = (4 << 3), ///< Thread Default Interface
SL_NET_DEFAULT_BLUETOOTH_INTERFACE = (5 << 3), ///< Bluetooth Default Interface
SL_NET_DEFAULT_ZWAVE_INTERFACE = (6 << 3), ///< Zwave Default Interface
SL_NET_WIFI_CLIENT_INTERFACE = (1 << 3), ///< WiFi Client Interface
SL_NET_WIFI_AP_INTERFACE = (2 << 3), ///< WiFi Access Point Interface
SL_NET_ETHERNET_INTERFACE = (3 << 3), ///< Ethernet Interface
SL_NET_THREAD_INTERFACE = (4 << 3), ///< Thread Interface
SL_NET_BLUETOOTH_INTERFACE = (5 << 3), ///< Bluetooth Interface
SL_NET_ZWAVE_INTERFACE = (6 << 3), ///< Z-Wave Interface
} sl_net_interface_t;

/** @} */

/// WiFi Client Default Interface
#define SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE (1 << 3)
/// WiFi Client Interface
#define SL_NET_WIFI_CLIENT_INTERFACE (1 << 3)

/// WiFi Access Point Default Interface
#define SL_NET_DEFAULT_WIFI_AP_INTERFACE (2 << 3)
/// WiFi Access Point Interface
#define SL_NET_WIFI_AP_INTERFACE (2 << 3)

/// Ethernet Default Interface
#define SL_NET_DEFAULT_ETHERNET_INTERFACE (3 << 3)
/// Ethernet Interface
#define SL_NET_ETHERNET_INTERFACE (3 << 3)

/// Thread Default Interface
#define SL_NET_DEFAULT_THREAD_INTERFACE (4 << 3)
/// Thread Interface
#define SL_NET_THREAD_INTERFACE (4 << 3)

/// Bluetooth Default Interface
#define SL_NET_DEFAULT_BLUETOOTH_INTERFACE (5 << 3)
/// Bluetooth Interface
#define SL_NET_BLUETOOTH_INTERFACE (5 << 3)

/// Zwave Default Interface
#define SL_NET_DEFAULT_ZWAVE_INTERFACE (6 << 3)
/// Zwave Interface
#define SL_NET_ZWAVE_INTERFACE (6 << 3)

/** \addtogroup SL_NET_CONSTANTS Constants
* @{ */
Expand Down Expand Up @@ -116,7 +116,7 @@ typedef enum {
SL_NET_WIFI_CLIENT_DISCONNECTED_EVENT, ///< Client Disconnected Event
SL_NET_DNS_RESOLVE_EVENT, ///< DNS Address resolution Event
SL_NET_OTA_FW_UPDATE_EVENT, ///< OTA Firmware Update Event
SL_NET_EVENT_COUNT ///< Mavimum event count
SL_NET_EVENT_COUNT ///< Maximum event count
} sl_net_event_t;

/// SL Network profile ID.
Expand Down
67 changes: 33 additions & 34 deletions components/service/network_manager/src/sl_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#error Need to define NETWORK_INTERFACE_VALID in sl_board_configuration.h
#endif

#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE) \
|| NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_WIFI_AP_INTERFACE)
#if NETWORK_INTERFACE_VALID(SL_NET_WIFI_CLIENT_INTERFACE) || NETWORK_INTERFACE_VALID(SL_NET_WIFI_AP_INTERFACE)
#include "sl_wifi_device.h"
#endif

Expand All @@ -17,29 +16,29 @@ sl_status_t sl_net_init(sl_net_interface_t interface,
sl_net_event_handler_t event_handler)
{
switch (SL_NET_INTERFACE_TYPE(interface)) {
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE)
case SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_WIFI_CLIENT_INTERFACE)
case SL_NET_WIFI_CLIENT_INTERFACE:
if (configuration == NULL) {
configuration = (const void *)&sl_wifi_default_client_configuration;
}
return sl_net_wifi_client_init(interface, configuration, context, event_handler);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_WIFI_AP_INTERFACE)
case SL_NET_DEFAULT_WIFI_AP_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_WIFI_AP_INTERFACE)
case SL_NET_WIFI_AP_INTERFACE:
if (configuration == NULL) {
configuration = (const void *)&sl_wifi_default_ap_configuration;
}
return sl_net_wifi_ap_init(interface, configuration, context, event_handler);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_ETHERNET_INTERFACE)
case SL_NET_DEFAULT_ETHERNET_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_ETHERNET_INTERFACE)
case SL_NET_ETHERNET_INTERFACE:
return sl_net_ethernet_init(interface, configuration, context, event_handler);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_THREAD_INTERFACE)
case SL_NET_DEFAULT_THREAD_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_THREAD_INTERFACE)
case SL_NET_THREAD_INTERFACE:
return sl_net_thread_init(interface, configuration, context, event_handler);
break;
#endif
Expand All @@ -51,23 +50,23 @@ sl_status_t sl_net_init(sl_net_interface_t interface,
sl_status_t sl_net_deinit(sl_net_interface_t interface, void *context)
{
switch (SL_NET_INTERFACE_TYPE(interface)) {
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE)
case SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_WIFI_CLIENT_INTERFACE)
case SL_NET_WIFI_CLIENT_INTERFACE:
return sl_net_wifi_client_deinit(interface, context);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_WIFI_AP_INTERFACE)
case SL_NET_DEFAULT_WIFI_AP_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_WIFI_AP_INTERFACE)
case SL_NET_WIFI_AP_INTERFACE:
return sl_net_wifi_ap_deinit(interface, context);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_ETHERNET_INTERFACE)
case SL_NET_DEFAULT_ETHERNET_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_ETHERNET_INTERFACE)
case SL_NET_ETHERNET_INTERFACE:
return sl_net_ethernet_deinit(interface, context);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_THREAD_INTERFACE)
case SL_NET_DEFAULT_THREAD_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_THREAD_INTERFACE)
case SL_NET_THREAD_INTERFACE:
return sl_net_thread_deinit(interface, context);
break;
#endif
Expand All @@ -79,23 +78,23 @@ sl_status_t sl_net_deinit(sl_net_interface_t interface, void *context)
sl_status_t sl_net_up(sl_net_interface_t interface, sl_net_profile_id_t profile_id)
{
switch (SL_NET_INTERFACE_TYPE(interface)) {
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE)
case SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_WIFI_CLIENT_INTERFACE)
case SL_NET_WIFI_CLIENT_INTERFACE:
return sl_net_wifi_client_up(interface, profile_id);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_WIFI_AP_INTERFACE)
case SL_NET_DEFAULT_WIFI_AP_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_WIFI_AP_INTERFACE)
case SL_NET_WIFI_AP_INTERFACE:
return sl_net_wifi_ap_up(interface, profile_id);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_ETHERNET_INTERFACE)
case SL_NET_DEFAULT_ETHERNET_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_ETHERNET_INTERFACE)
case SL_NET_ETHERNET_INTERFACE:
return sl_net_ethernet_up(interface, profile_id);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_THREAD_INTERFACE)
case SL_NET_DEFAULT_THREAD_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_THREAD_INTERFACE)
case SL_NET_THREAD_INTERFACE:
return sl_net_thread_up(interface, profile_id);
break;
#endif
Expand All @@ -107,23 +106,23 @@ sl_status_t sl_net_up(sl_net_interface_t interface, sl_net_profile_id_t profile_
sl_status_t sl_net_down(sl_net_interface_t interface)
{
switch (SL_NET_INTERFACE_TYPE(interface)) {
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE)
case SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_WIFI_CLIENT_INTERFACE)
case SL_NET_WIFI_CLIENT_INTERFACE:
return sl_net_wifi_client_down(interface);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_WIFI_AP_INTERFACE)
case SL_NET_DEFAULT_WIFI_AP_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_WIFI_AP_INTERFACE)
case SL_NET_WIFI_AP_INTERFACE:
return sl_net_wifi_ap_down(interface);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_ETHERNET_INTERFACE)
case SL_NET_DEFAULT_ETHERNET_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_ETHERNET_INTERFACE)
case SL_NET_ETHERNET_INTERFACE:
return sl_net_ethernet_down(interface);
break;
#endif
#if NETWORK_INTERFACE_VALID(SL_NET_DEFAULT_THREAD_INTERFACE)
case SL_NET_DEFAULT_THREAD_INTERFACE:
#if NETWORK_INTERFACE_VALID(SL_NET_THREAD_INTERFACE)
case SL_NET_THREAD_INTERFACE:
return sl_net_thread_down(interface);
break;
#endif
Expand Down
12 changes: 6 additions & 6 deletions components/service/network_manager/src/sl_net_basic_profiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sl_status_t sl_net_set_profile(sl_net_interface_t interface,

switch (interface) {
#ifdef SL_WIFI_COMPONENT_INCLUDED
case SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE:
case SL_NET_WIFI_CLIENT_INTERFACE:
if (profile_id >= MAX_WIFI_CLIENT_PROFILES) {
return SL_STATUS_INVALID_INDEX;
}
Expand All @@ -32,7 +32,7 @@ sl_status_t sl_net_set_profile(sl_net_interface_t interface,
return SL_STATUS_OK;
break;

case SL_NET_DEFAULT_WIFI_AP_INTERFACE:
case SL_NET_WIFI_AP_INTERFACE:
if (profile_id >= MAX_WIFI_AP_PROFILES) {
return SL_STATUS_INVALID_INDEX;
}
Expand All @@ -53,15 +53,15 @@ sl_status_t sl_net_get_profile(sl_net_interface_t interface, sl_net_profile_id_t

switch (interface) {
#ifdef SL_WIFI_COMPONENT_INCLUDED
case SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE:
case SL_NET_WIFI_CLIENT_INTERFACE:
if (profile_id >= MAX_WIFI_CLIENT_PROFILES) {
return SL_STATUS_INVALID_INDEX;
}
memcpy(profile, &wifi_client_profiles[profile_id], sizeof(sl_net_wifi_client_profile_t));
return SL_STATUS_OK;
break;

case SL_NET_DEFAULT_WIFI_AP_INTERFACE:
case SL_NET_WIFI_AP_INTERFACE:
if (profile_id >= MAX_WIFI_AP_PROFILES) {
return SL_STATUS_INVALID_INDEX;
}
Expand All @@ -83,15 +83,15 @@ sl_status_t sl_net_delete_profile(sl_net_interface_t interface, sl_net_profile_i

switch (interface) {
#ifdef SL_WIFI_COMPONENT_INCLUDED
case SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE:
case SL_NET_WIFI_CLIENT_INTERFACE:
if (profile_id >= MAX_WIFI_CLIENT_PROFILES) {
return SL_STATUS_INVALID_INDEX;
}
memset(&wifi_client_profiles[profile_id], 0, sizeof(sl_net_wifi_client_profile_t));
return SL_STATUS_OK;
break;

case SL_NET_DEFAULT_WIFI_AP_INTERFACE:
case SL_NET_WIFI_AP_INTERFACE:
if (profile_id >= MAX_WIFI_AP_PROFILES) {
return SL_STATUS_INVALID_INDEX;
}
Expand Down
2 changes: 1 addition & 1 deletion components/service/network_manager/src/sl_net_for_lwip.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ sl_status_t sl_net_wifi_client_up(sl_net_interface_t interface, sl_net_profile_i
// Load profile and connect here
sl_net_wifi_client_profile_t profile;

status = sl_net_get_profile(SL_NET_DEFAULT_WIFI_CLIENT_INTERFACE, profile_id, &profile);
status = sl_net_get_profile(SL_NET_WIFI_CLIENT_INTERFACE, profile_id, &profile);
VERIFY_STATUS_AND_RETURN(status);

status = sl_wifi_connect(SL_WIFI_CLIENT_INTERFACE, &profile.config, 5000);
Expand Down
Loading

0 comments on commit 38a8f6d

Please sign in to comment.