[Silbas] Remove AppConfig header from Silabs Platform (#33348)
* remove app config header from the platform
* replace SILABS_LOG with ChipLogProgress
* Fix log
diff --git a/src/platform/silabs/DiagnosticDataProviderImpl.cpp b/src/platform/silabs/DiagnosticDataProviderImpl.cpp
index 0266820..1dc4083 100644
--- a/src/platform/silabs/DiagnosticDataProviderImpl.cpp
+++ b/src/platform/silabs/DiagnosticDataProviderImpl.cpp
@@ -28,7 +28,6 @@
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
#include <platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h>
#endif
-#include "AppConfig.h"
#include "FreeRTOS.h"
#include "heap_4_silabs.h"
#include <inet/InetInterface.h>
diff --git a/src/platform/silabs/PlatformManagerImpl.cpp b/src/platform/silabs/PlatformManagerImpl.cpp
index 669c930..7692ba9 100644
--- a/src/platform/silabs/PlatformManagerImpl.cpp
+++ b/src/platform/silabs/PlatformManagerImpl.cpp
@@ -39,8 +39,6 @@
#include <lwip/tcpip.h>
#endif // CHIP_SYSTEM_CONFIG_USE_LWIP
-#include "AppConfig.h"
-
using namespace chip::DeviceLayer::Internal;
namespace chip {
diff --git a/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp b/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp
index 9356586..2ffc45d 100644
--- a/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp
+++ b/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp
@@ -26,10 +26,11 @@
#include "wfx_host_events.h"
#include "wifi_config.h"
-#include "AppConfig.h"
#include "FreeRTOS.h"
#include "event_groups.h"
+#include <lib/support/logging/CHIPLogging.h>
+
#define MAX_DHCP_TRIES (4)
#define NETIF_IPV4_ADDRESS(X, Y) (((X) >> (8 * Y)) & 0xFF)
@@ -62,7 +63,7 @@
if (link_up)
{
dhcp_state = DHCP_START;
- SILABS_LOG("DHCP: Starting");
+ ChipLogProgress(DeviceLayer, "DHCP: Starting");
}
else
{
@@ -88,7 +89,7 @@
switch (dhcp_state)
{
case DHCP_START:
- SILABS_LOG("DHCP: Wait addr");
+ ChipLogProgress(DeviceLayer, "DHCP: Wait addr");
ip_addr_set_zero_ip4(&netif->ip_addr);
ip_addr_set_zero_ip4(&netif->netmask);
ip_addr_set_zero_ip4(&netif->gw);
@@ -102,8 +103,8 @@
dhcp_state = DHCP_ADDRESS_ASSIGNED;
uint64_t addr = netif->ip_addr.u_addr.ip4.addr;
- SILABS_LOG("DHCP IP: %d.%d.%d.%d", NETIF_IPV4_ADDRESS(addr, 0), NETIF_IPV4_ADDRESS(addr, 1),
- NETIF_IPV4_ADDRESS(addr, 2), NETIF_IPV4_ADDRESS(addr, 3));
+ ChipLogProgress(DeviceLayer, "DHCP IP: %d.%d.%d.%d", NETIF_IPV4_ADDRESS(addr, 0), NETIF_IPV4_ADDRESS(addr, 1),
+ NETIF_IPV4_ADDRESS(addr, 2), NETIF_IPV4_ADDRESS(addr, 3));
}
else
{
@@ -114,7 +115,7 @@
{
dhcp_state = DHCP_TIMEOUT;
- SILABS_LOG("*ERR*DHCP: Failed");
+ ChipLogProgress(DeviceLayer, "*ERR*DHCP: Failed");
/* Stop DHCP */
dhcp_stop(netif);
@@ -130,7 +131,7 @@
case DHCP_LINK_DOWN:
/* Stop DHCP */
- SILABS_LOG("*ERR*DHCP Link down");
+ ChipLogProgress(DeviceLayer, "*ERR*DHCP Link down");
dhcp_stop(netif);
dhcp_state = DHCP_OFF;
break;
diff --git a/src/platform/silabs/SiWx917/wifi/ethernetif.cpp b/src/platform/silabs/SiWx917/wifi/ethernetif.cpp
index 0cc0061..8570fc4 100644
--- a/src/platform/silabs/SiWx917/wifi/ethernetif.cpp
+++ b/src/platform/silabs/SiWx917/wifi/ethernetif.cpp
@@ -45,6 +45,8 @@
#include "netif/etharp.h"
#include "silabs_utils.h"
+#include <lib/support/logging/CHIPLogging.h>
+
StaticSemaphore_t xEthernetIfSemaBuffer;
/*****************************************************************************
@@ -130,13 +132,14 @@
(memcmp(netif->hwaddr, dst_mac, netif->hwaddr_len) != 0))
{
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("%s: DROP, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", __func__,
+ ChipLogProgress(DeviceLayer, "%s: DROP, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x",
+ __func__,
- dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5],
+ dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5],
- src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5],
+ src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5],
- b[12], b[13]);
+ b[12], b[13]);
#endif
return;
}
@@ -152,14 +155,15 @@
bufferoffset += q->len;
}
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("%s: ACCEPT %d, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", __func__,
- bufferoffset,
+ ChipLogProgress(DeviceLayer,
+ "%s: ACCEPT %d, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", __func__,
+ bufferoffset,
- dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5],
+ dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5],
- src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5],
+ src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5],
- b[12], b[13]);
+ b[12], b[13]);
#endif
if (netif->input(p, netif) != ERR_OK)
@@ -199,7 +203,7 @@
uint16_t datalength = 0;
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("LWIP : low_level_output");
+ ChipLogProgress(DeviceLayer, "LWIP : low_level_output");
#endif
if (xSemaphoreTake(ethout_sem, portMAX_DELAY) != pdTRUE)
{
@@ -221,24 +225,24 @@
VERIFY_STATUS_AND_RETURN(status);
if (packet == NULL)
{
- SILABS_LOG("EN-RSI:No buf");
+ ChipLogProgress(DeviceLayer, "EN-RSI:No buf");
xSemaphoreGive(ethout_sem);
return SL_STATUS_ALLOCATION_FAILED;
}
memset(packet->desc, 0, sizeof(packet->desc));
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("EN-RSI: Output");
+ ChipLogProgress(DeviceLayer, "EN-RSI: Output");
#endif
if ((netif->flags & (NETIF_FLAG_LINK_UP | NETIF_FLAG_UP)) != (NETIF_FLAG_LINK_UP | NETIF_FLAG_UP))
{
- SILABS_LOG("EN-RSI:NOT UP");
+ ChipLogProgress(DeviceLayer, "EN-RSI:NOT UP");
xSemaphoreGive(ethout_sem);
return ERR_IF;
}
#ifdef WIFI_DEBUG_ENABLED
uint8_t * b = (uint8_t *) p->payload;
- SILABS_LOG("EN-RSI: Out [%02x:%02x:%02x:%02x:%02x:%02x][%02x:%02x:%02x:%02x:%02x:%02x]type=%02x%02x", b[0], b[1], b[2], b[3],
- b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13]);
+ ChipLogProgress(DeviceLayer, "EN-RSI: Out [%02x:%02x:%02x:%02x:%02x:%02x][%02x:%02x:%02x:%02x:%02x:%02x]type=%02x%02x", b[0],
+ b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13]);
#endif
/* Generate the packet */
for (q = p, datalength = 0; q != NULL; q = q->next)
@@ -252,13 +256,13 @@
wfx_rsi_pkt_add_data(packet, (uint8_t *) (p->payload), LWIP_FRAME_ALIGNMENT - datalength, datalength);
}
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("EN-RSI: Sending %d", framelength);
+ ChipLogProgress(DeviceLayer, "EN-RSI: Sending %d", framelength);
#endif
packet->length = framelength & 0xFFF;
packet->command = RSI_SEND_RAW_DATA;
if (sl_si91x_driver_send_data_packet(SI91X_WLAN_CMD_QUEUE, buffer, 1000))
{
- SILABS_LOG("*ERR*EN-RSI:Send fail");
+ ChipLogProgress(DeviceLayer, "*ERR*EN-RSI:Send fail");
xSemaphoreGive(ethout_sem);
return ERR_IF;
}
diff --git a/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp b/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp
index a2610ef..d4bcbe4 100644
--- a/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp
+++ b/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp
@@ -22,7 +22,6 @@
#include "wfx_host_events.h"
#include "wifi_config.h"
-#include "AppConfig.h"
#include "dhcp_client.h"
#include "ethernetif.h"
diff --git a/src/platform/silabs/SiWx917/wifi/wfx_notify.cpp b/src/platform/silabs/SiWx917/wifi/wfx_notify.cpp
index 60ee45d..ded8e83 100644
--- a/src/platform/silabs/SiWx917/wifi/wfx_notify.cpp
+++ b/src/platform/silabs/SiWx917/wifi/wfx_notify.cpp
@@ -19,8 +19,6 @@
#include <stdlib.h>
#include <string.h>
-#include "AppConfig.h"
-
#include "FreeRTOS.h"
#include "event_groups.h"
#include "silabs_utils.h"
@@ -49,6 +47,8 @@
using namespace ::chip;
using namespace ::chip::DeviceLayer;
+#include <lib/support/logging/CHIPLogging.h>
+
extern uint32_t retryInterval;
/*
* Notifications to the upper-layer
@@ -67,8 +67,6 @@
sl_wfx_startup_ind_t evt;
sl_wfx_mac_address_t mac;
- SILABS_LOG("%s: started.", __func__);
-
memset(&evt, 0, sizeof(evt));
evt.header.id = SL_WFX_STARTUP_IND_ID;
evt.header.length = sizeof evt;
@@ -92,15 +90,13 @@
{
sl_wfx_connect_ind_t evt;
- SILABS_LOG("%s: started.", __func__);
-
if (status != SUCCESS_STATUS)
{
- SILABS_LOG("%s: error: failed status: %d.", __func__, status);
+ ChipLogProgress(DeviceLayer, "%s: error: failed status: %ld.", __func__, status);
return;
}
- SILABS_LOG("%s: connected.", __func__);
+ ChipLogProgress(DeviceLayer, "%s: connected.", __func__);
memset(&evt, 0, sizeof(evt));
evt.header.id = SL_WFX_CONNECT_IND_ID;
@@ -125,8 +121,6 @@
{
sl_wfx_disconnect_ind_t evt;
- SILABS_LOG("%s: started.", __func__);
-
memset(&evt, 0, sizeof(evt));
evt.header.id = SL_WFX_DISCONNECT_IND_ID;
evt.header.length = sizeof evt;
@@ -145,8 +139,6 @@
{
sl_wfx_generic_message_t eventData;
- SILABS_LOG("%s: started.", __func__);
-
memset(&eventData, 0, sizeof(eventData));
eventData.header.id = got_ip ? IP_EVENT_GOT_IP6 : IP_EVENT_STA_LOST_IP;
eventData.header.length = sizeof(eventData.header);
@@ -174,8 +166,6 @@
{
sl_wfx_generic_message_t eventData;
- SILABS_LOG("%s: started.", __func__);
-
memset(&eventData, 0, sizeof(eventData));
eventData.header.id = got_ip ? IP_EVENT_STA_GOT_IP : IP_EVENT_STA_LOST_IP;
eventData.header.length = sizeof(eventData.header);
@@ -208,7 +198,8 @@
*/
if (retryJoin < MAX_JOIN_RETRIES_COUNT)
{
- SILABS_LOG("wfx_retry_interval_handler : Next attempt after %d Seconds", CONVERT_MS_TO_SEC(WLAN_RETRY_TIMER_MS));
+ ChipLogProgress(DeviceLayer, "wfx_retry_interval_handler : Next attempt after %d Seconds",
+ CONVERT_MS_TO_SEC(WLAN_RETRY_TIMER_MS));
#if SL_ICD_ENABLED
// TODO: cleanup the retry logic MATTER-1921
if (!chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen())
@@ -220,7 +211,7 @@
}
else
{
- SILABS_LOG("Connect failed after max %d tries", retryJoin);
+ ChipLogProgress(DeviceLayer, "Connect failed after max %d tries", retryJoin);
}
}
else
@@ -234,7 +225,8 @@
{
retryInterval = WLAN_MAX_RETRY_TIMER_MS;
}
- SILABS_LOG("wfx_retry_interval_handler : Next attempt after %d Seconds", CONVERT_MS_TO_SEC(retryInterval));
+ ChipLogProgress(DeviceLayer, "wfx_retry_interval_handler : Next attempt after %ld Seconds",
+ CONVERT_MS_TO_SEC(retryInterval));
#if SL_ICD_ENABLED
wfx_rsi_power_save(RSI_SLEEP_MODE_8, STANDBY_POWER_SAVE_WITH_RAM_RETENTION);
#endif // SL_ICD_ENABLED
diff --git a/src/platform/silabs/efr32/wifi/dhcp_client.cpp b/src/platform/silabs/efr32/wifi/dhcp_client.cpp
index 15c6785..c2a46d6 100644
--- a/src/platform/silabs/efr32/wifi/dhcp_client.cpp
+++ b/src/platform/silabs/efr32/wifi/dhcp_client.cpp
@@ -32,10 +32,11 @@
#include "wfx_host_events.h"
#include "wifi_config.h"
-#include "AppConfig.h"
#include "FreeRTOS.h"
#include "event_groups.h"
+#include <lib/support/logging/CHIPLogging.h>
+
#define MAX_DHCP_TRIES 4
#define NETIF_IPV4_ADDRESS(X, Y) (((X) >> (8 * Y)) & 0xFF)
@@ -68,7 +69,7 @@
if (link_up)
{
dhcp_state = DHCP_START;
- SILABS_LOG("DHCP: Starting");
+ ChipLogProgress(DeviceLayer, "DHCP: Starting");
}
else
{
@@ -94,7 +95,7 @@
switch (dhcp_state)
{
case DHCP_START:
- SILABS_LOG("DHCP: Wait addr");
+ ChipLogProgress(DeviceLayer, "DHCP: Wait addr");
ip_addr_set_zero_ip4(&netif->ip_addr);
ip_addr_set_zero_ip4(&netif->netmask);
ip_addr_set_zero_ip4(&netif->gw);
@@ -108,8 +109,8 @@
dhcp_state = DHCP_ADDRESS_ASSIGNED;
uint64_t addr = netif->ip_addr.u_addr.ip4.addr;
- SILABS_LOG("DHCP IP: %d.%d.%d.%d", NETIF_IPV4_ADDRESS(addr, 0), NETIF_IPV4_ADDRESS(addr, 1),
- NETIF_IPV4_ADDRESS(addr, 2), NETIF_IPV4_ADDRESS(addr, 3));
+ ChipLogProgress(DeviceLayer, "DHCP IP: %d.%d.%d.%d", NETIF_IPV4_ADDRESS(addr, 0), NETIF_IPV4_ADDRESS(addr, 1),
+ NETIF_IPV4_ADDRESS(addr, 2), NETIF_IPV4_ADDRESS(addr, 3));
}
else
{
@@ -120,7 +121,7 @@
{
dhcp_state = DHCP_TIMEOUT;
- SILABS_LOG("*ERR*DHCP: Failed");
+ ChipLogProgress(DeviceLayer, "*ERR*DHCP: Failed");
/* Stop DHCP */
dhcp_stop(netif);
@@ -136,7 +137,7 @@
case DHCP_LINK_DOWN:
/* Stop DHCP */
- SILABS_LOG("*ERR*DHCP Link down");
+ ChipLogProgress(DeviceLayer, "*ERR*DHCP Link down");
dhcp_stop(netif);
dhcp_state = DHCP_OFF;
break;
diff --git a/src/platform/silabs/efr32/wifi/ethernetif.cpp b/src/platform/silabs/efr32/wifi/ethernetif.cpp
index 32d7ee1..d07c14f 100644
--- a/src/platform/silabs/efr32/wifi/ethernetif.cpp
+++ b/src/platform/silabs/efr32/wifi/ethernetif.cpp
@@ -60,12 +60,7 @@
#include "lwip/timeouts.h"
#include "netif/etharp.h"
-#ifndef SILABS_LOG
-extern "C" {
-void silabsLog(const char * aFormat, ...);
-#define SILABS_LOG(...) silabsLog(__VA_ARGS__);
-}
-#endif
+#include <lib/support/logging/CHIPLogging.h>
StaticSemaphore_t xEthernetIfSemaBuffer;
@@ -152,13 +147,14 @@
(memcmp(netif->hwaddr, dst_mac, netif->hwaddr_len) != 0))
{
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("%s: DROP, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", __func__,
+ ChipLogProgress(DeviceLayer, "%s: DROP, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x",
+ __func__,
- dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5],
+ dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5],
- src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5],
+ src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5],
- b[12], b[13]);
+ b[12], b[13]);
#endif
return;
}
@@ -174,27 +170,28 @@
bufferoffset += q->len;
}
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("%s: ACCEPT %d, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", __func__,
- bufferoffset,
+ ChipLogProgress(DeviceLayer,
+ "%s: ACCEPT %ld, [%02x:%02x:%02x:%02x:%02x:%02x]<-[%02x:%02x:%02x:%02x:%02x:%02x] type=%02x%02x", __func__,
+ bufferoffset,
- dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5],
+ dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5],
- src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5],
+ src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5],
- b[12], b[13]);
+ b[12], b[13]);
#endif
if (netif->input(p, netif) != ERR_OK)
{
gOverrunCount++;
- SILABS_LOG("overrun count entering when fail to alloc value %d", gOverrunCount);
+ ChipLogProgress(DeviceLayer, "overrun count entering when fail to alloc value %ld", gOverrunCount);
pbuf_free(p);
}
}
else
{
gOverrunCount++;
- SILABS_LOG("overrun count entering when fail to alloc value %d", gOverrunCount);
+ ChipLogProgress(DeviceLayer, "overrun count entering when fail to alloc value %ld", gOverrunCount);
}
}
@@ -241,9 +238,9 @@
// 12 is size of other data in buffer struct, user shouldn't have to care about this?
if (sl_wfx_host_allocate_buffer((void **) &tx_buffer, SL_WFX_TX_FRAME_BUFFER, asize) != SL_STATUS_OK)
{
- SILABS_LOG("*ERR*EN-Out: No mem frame len=%d", framelength);
+ ChipLogProgress(DeviceLayer, "*ERR*EN-Out: No mem frame len=%ld", framelength);
gOverrunCount++;
- SILABS_LOG("overrun count exiting when faied to alloc value %d", gOverrunCount);
+ ChipLogProgress(DeviceLayer, "overrun count exiting when faied to alloc value %ld", gOverrunCount);
return ERR_MEM;
}
buffer = tx_buffer->body.packet_data;
@@ -265,7 +262,7 @@
result = SL_STATUS_FAIL;
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("WF200: Out %d", (int) framelength);
+ ChipLogProgress(DeviceLayer, "WF200: Out %d", (int) framelength);
#endif
/* send the generated frame over Wifi network */
@@ -277,7 +274,7 @@
if (result != SL_STATUS_OK)
{
- SILABS_LOG("*ERR*Send enet %d", (int) framelength);
+ ChipLogProgress(DeviceLayer, "*ERR*Send enet %d", (int) framelength);
return ERR_IF;
}
return ERR_OK;
@@ -312,7 +309,7 @@
buffer = (uint8_t *) &(rx_buffer->body.frame[rx_buffer->body.frame_padding]);
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("WF200: In %d", (int) len);
+ ChipLogProgress(DeviceLayer, "WF200: In %d", (int) len);
#endif
low_level_input(netif, buffer, len);
@@ -320,14 +317,14 @@
else
{
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("WF200: NO-INTF");
+ ChipLogProgress(DeviceLayer, "WF200: NO-INTF");
#endif
}
}
else
{
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("WF200: Invalid frame IN");
+ ChipLogProgress(DeviceLayer, "WF200: Invalid frame IN");
#endif
}
}
@@ -360,7 +357,7 @@
uint16_t framelength = 0;
uint16_t datalength = 0;
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("LWIP : low_level_output");
+ ChipLogProgress(DeviceLayer, "LWIP : low_level_output");
#endif
if (xSemaphoreTake(ethout_sem, portMAX_DELAY) != pdTRUE)
{
@@ -376,11 +373,11 @@
framelength = LWIP_FRAME_ALIGNMENT;
}
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("EN-RSI: Output");
+ ChipLogProgress(DeviceLayer, "EN-RSI: Output");
#endif
if ((netif->flags & (NETIF_FLAG_LINK_UP | NETIF_FLAG_UP)) != (NETIF_FLAG_LINK_UP | NETIF_FLAG_UP))
{
- SILABS_LOG("EN-RSI:NOT UP");
+ ChipLogProgress(DeviceLayer, "EN-RSI:NOT UP");
xSemaphoreGive(ethout_sem);
return ERR_IF;
}
@@ -395,7 +392,7 @@
if (!packet)
#endif // SLI_SI91X_MCU_INTERFACE
{
- SILABS_LOG("EN-RSI:No buf");
+ ChipLogProgress(DeviceLayer, "EN-RSI:No buf");
xSemaphoreGive(ethout_sem);
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
return SL_STATUS_ALLOCATION_FAILED;
@@ -407,8 +404,8 @@
#endif // SLI_SI91X_MCU_INTERFACE
#ifdef WIFI_DEBUG_ENABLED
uint8_t * b = (uint8_t *) p->payload;
- SILABS_LOG("EN-RSI: Out [%02x:%02x:%02x:%02x:%02x:%02x][%02x:%02x:%02x:%02x:%02x:%02x]type=%02x%02x", b[0], b[1], b[2], b[3],
- b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13]);
+ ChipLogProgress(DeviceLayer, "EN-RSI: Out [%02x:%02x:%02x:%02x:%02x:%02x][%02x:%02x:%02x:%02x:%02x:%02x]type=%02x%02x", b[0],
+ b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13]);
#endif
/* Generate the packet */
for (q = p, datalength = 0; q != NULL; q = q->next)
@@ -422,7 +419,7 @@
wfx_rsi_pkt_add_data(packet, (uint8_t *) (p->payload), LWIP_FRAME_ALIGNMENT - datalength, datalength);
}
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("EN-RSI: Sending %d", framelength);
+ ChipLogProgress(DeviceLayer, "EN-RSI: Sending %d", framelength);
#endif
/* forward the generated packet to RSI to
@@ -439,13 +436,13 @@
if (wfx_rsi_send_data(packet, datalength))
#endif
{
- SILABS_LOG("*ERR*EN-RSI:Send fail");
+ ChipLogProgress(DeviceLayer, "*ERR*EN-RSI:Send fail");
xSemaphoreGive(ethout_sem);
return ERR_IF;
}
#ifdef WIFI_DEBUG_ENABLED
- SILABS_LOG("EN-RSI:Xmit %d", framelength);
+ ChipLogProgress(DeviceLayer, "EN-RSI:Xmit %d", framelength);
#endif
xSemaphoreGive(ethout_sem);
diff --git a/src/platform/silabs/efr32/wifi/lwip_netif.cpp b/src/platform/silabs/efr32/wifi/lwip_netif.cpp
index ac91ad7..3a0d104 100644
--- a/src/platform/silabs/efr32/wifi/lwip_netif.cpp
+++ b/src/platform/silabs/efr32/wifi/lwip_netif.cpp
@@ -28,7 +28,6 @@
#include "wfx_host_events.h"
#include "wifi_config.h"
-#include "AppConfig.h"
#include "dhcp_client.h"
#include "ethernetif.h"
@@ -36,6 +35,7 @@
#include "event_groups.h"
#include "task.h"
+#include <lib/support/logging/CHIPLogging.h>
#include <platform/CHIPDeviceLayer.h>
using namespace ::chip;
using namespace ::chip::DeviceLayer;
diff --git a/src/platform/silabs/efr32/wifi/wfx_notify.cpp b/src/platform/silabs/efr32/wifi/wfx_notify.cpp
index f888a1a..fd18310 100644
--- a/src/platform/silabs/efr32/wifi/wfx_notify.cpp
+++ b/src/platform/silabs/efr32/wifi/wfx_notify.cpp
@@ -26,8 +26,6 @@
#include "em_usart.h"
#include "gpiointerrupt.h"
-#include "AppConfig.h"
-
#include "FreeRTOS.h"
#include "event_groups.h"
#include "task.h"
@@ -38,10 +36,10 @@
#include "wfx_rsi.h"
#endif
-#include <platform/CHIPDeviceLayer.h>
-// #include <app/server/Mdns.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
+#include <lib/support/logging/CHIPLogging.h>
+#include <platform/CHIPDeviceLayer.h>
using namespace ::chip;
using namespace ::chip::DeviceLayer;
@@ -65,8 +63,6 @@
sl_wfx_startup_ind_t evt;
sl_wfx_mac_address_t mac;
- SILABS_LOG("%s: started.", __func__);
-
memset(&evt, 0, sizeof(evt));
evt.header.id = SL_WFX_STARTUP_IND_ID;
evt.header.length = sizeof evt;
@@ -90,15 +86,13 @@
{
sl_wfx_connect_ind_t evt;
- SILABS_LOG("%s: started.", __func__);
-
if (status != SUCCESS_STATUS)
{
- SILABS_LOG("%s: error: failed status: %d.", __func__, status);
+ ChipLogProgress(DeviceLayer, "%s: error: failed status: %ld.", __func__, status);
return;
}
- SILABS_LOG("%s: connected.", __func__);
+ ChipLogProgress(DeviceLayer, "%s: connected.", __func__);
memset(&evt, 0, sizeof(evt));
evt.header.id = SL_WFX_CONNECT_IND_ID;
@@ -123,8 +117,6 @@
{
sl_wfx_disconnect_ind_t evt;
- SILABS_LOG("%s: started.", __func__);
-
memset(&evt, 0, sizeof(evt));
evt.header.id = SL_WFX_DISCONNECT_IND_ID;
evt.header.length = sizeof evt;
@@ -143,8 +135,6 @@
{
sl_wfx_generic_message_t eventData;
- SILABS_LOG("%s: started.", __func__);
-
memset(&eventData, 0, sizeof(eventData));
eventData.header.id = got_ip ? IP_EVENT_GOT_IP6 : IP_EVENT_STA_LOST_IP;
eventData.header.length = sizeof(eventData.header);
@@ -172,8 +162,6 @@
{
sl_wfx_generic_message_t eventData;
- SILABS_LOG("%s: started.", __func__);
-
memset(&eventData, 0, sizeof(eventData));
eventData.header.id = got_ip ? IP_EVENT_STA_GOT_IP : IP_EVENT_STA_LOST_IP;
eventData.header.length = sizeof(eventData.header);
@@ -206,12 +194,12 @@
*/
if (retryJoin < MAX_JOIN_RETRIES_COUNT)
{
- SILABS_LOG("%s: Next attempt after %d Seconds", __func__, CONVERT_MS_TO_SEC(WLAN_RETRY_TIMER_MS));
+ ChipLogProgress(DeviceLayer, "%s: Next attempt after %d Seconds", __func__, CONVERT_MS_TO_SEC(WLAN_RETRY_TIMER_MS));
vTaskDelay(pdMS_TO_TICKS(WLAN_RETRY_TIMER_MS));
}
else
{
- SILABS_LOG("Connect failed after max %d tries", retryJoin);
+ ChipLogProgress(DeviceLayer, "Connect failed after max %d tries", retryJoin);
}
}
else
@@ -225,7 +213,7 @@
{
retryInterval = WLAN_MAX_RETRY_TIMER_MS;
}
- SILABS_LOG("%s: Next attempt after %d Seconds", __func__, CONVERT_MS_TO_SEC(retryInterval));
+ ChipLogProgress(DeviceLayer, "%s: Next attempt after %ld Seconds", __func__, CONVERT_MS_TO_SEC(retryInterval));
vTaskDelay(pdMS_TO_TICKS(retryInterval));
retryInterval += retryInterval;
}
diff --git a/src/platform/silabs/rs911x/wfx_sl_ble_init.c b/src/platform/silabs/rs911x/wfx_sl_ble_init.c
index 7e7c165..23bc666 100644
--- a/src/platform/silabs/rs911x/wfx_sl_ble_init.c
+++ b/src/platform/silabs/rs911x/wfx_sl_ble_init.c
@@ -160,7 +160,6 @@
*/
void rsi_ble_on_read_req_event(uint16_t event_id, rsi_ble_read_req_t * rsi_ble_read_req)
{
- SILABS_LOG("%s: starting", __func__);
event_msg.event_id = event_id;
memcpy(&event_msg.rsi_ble_read_req, rsi_ble_read_req, sizeof(rsi_ble_read_req_t));
rsi_ble_app_set_event(RSI_BLE_EVENT_GATT_RD);