Skip to content

Commit

Permalink
Resolved review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bhmanda-silabs committed Sep 6, 2024
1 parent ebbe1ad commit 5871092
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
8 changes: 5 additions & 3 deletions examples/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ declare_args() {

# Sanity check
assert(chip_enable_wifi)

silabs_plat_si91x_dir = "${chip_root}/src/platform/silabs"
silabs_plat_si91x_wifi_dir = "${chip_root}/src/platform/silabs/SiWx917/wifi"
silabs_plat_si91x_common_wifi_dir = "${chip_root}/src/platform/silabs/wifi"

import("${silabs_common_plat_dir}/args.gni")
config("chip_examples_project_config") {
include_dirs = [ "project_include" ]
Expand Down Expand Up @@ -181,8 +183,8 @@ source_set("siwx917-common") {
include_dirs = [
".",
"SiWx917/",
"${silabs_plat_si91x_wifi_dir}/wifi",
"${silabs_plat_si91x_wifi_dir}/SiWx917/wifi",
"${silabs_plat_si91x_dir}/wifi",
"${silabs_plat_si91x_wifi_dir}",
]

sources = [
Expand Down
12 changes: 11 additions & 1 deletion examples/platform/silabs/efr32/wf200/host_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,9 +1197,19 @@ bool wfx_hw_ready(void)
******************************************************************************/
void wfx_dhcp_got_ipv4(uint32_t ip)
{
/* Acquire the new IP address
/*
* Acquire the new IP address
*/
uint8_t ip4_addr[4];

ip4_addr[0] = (ip) &HEX_VALUE_FF;
ip4_addr[1] = (ip >> 8) & HEX_VALUE_FF;
ip4_addr[2] = (ip >> 16) & HEX_VALUE_FF;
ip4_addr[3] = (ip >> 24) & HEX_VALUE_FF;

ChipLogDetail(DeviceLayer, "DHCP IP=%d.%d.%d.%d", ip4_addr[0], ip4_addr[1], ip4_addr[2], ip4_addr[3]);
sta_ip = ip;

wfx_ip_changed_notify(IP_STATUS_SUCCESS);
}
#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
Expand Down
5 changes: 1 addition & 4 deletions src/platform/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,9 @@ static_library("efr32") {
"wifi/wifi_config.h",
]

if (chip_enable_wifi_ipv4) {
sources += [ "${silabs_platform_dir}/wifi/dhcp_client.cpp" ]
}

if (use_wf200 || use_rs9116 || use_SiWx917) {
sources += [
"${silabs_platform_dir}/wifi/dhcp_client.cpp",
"wifi/ethernetif.cpp",
"wifi/ethernetif.h",
"wifi/lwip_netif.cpp",
Expand Down
6 changes: 1 addition & 5 deletions src/platform/silabs/wifi/dhcp_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "em_gpio.h"
#include "em_ldma.h"
#include "em_usart.h"
#endif
#endif // !(SLI_SI91X_MCU_INTERFACE)

#include "dhcp_client.h"
#include "lwip/dhcp.h"
Expand Down Expand Up @@ -109,10 +109,6 @@ uint8_t dhcpclient_poll(void * arg)
if (dhcp_supplied_address(netif))
{
dhcp_state = DHCP_ADDRESS_ASSIGNED;

uint64_t addr = netif->ip_addr.u_addr.ip4.addr;
ChipLogProgress(DeviceLayer, "DHCP IP: %lld.%lld.%lld.%lld", NETIF_IPV4_ADDRESS(addr, 0), NETIF_IPV4_ADDRESS(addr, 1),
NETIF_IPV4_ADDRESS(addr, 2), NETIF_IPV4_ADDRESS(addr, 3));
}
else
{
Expand Down

0 comments on commit 5871092

Please sign in to comment.