Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cossid committed Nov 19, 2023
1 parent 902ce76 commit ba55155
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions cores/beken-72xx/arduino/libraries/WiFi/WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
WiFiClass::WiFiClass() {
data = (WiFiData *)calloc(1, sizeof(WiFiData));

DATA->scanSem = xSemaphoreCreateBinary();
STA_CFG.dhcp_mode = DHCP_CLIENT;
DATA->scanSem = xSemaphoreCreateBinary();
STA_CFG.dhcp_mode = DHCP_CLIENT;
STA_ADV_CFG.dhcp_mode = DHCP_CLIENT;
}

Expand Down
4 changes: 2 additions & 2 deletions cores/beken-72xx/arduino/libraries/WiFi/WiFiPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ typedef struct {
#define pDATA ((WiFiData *)pWiFi->data)
#define cDATA ((WiFiData *)cls->data)

#define STA_CFG (DATA->configSta)
#define STA_ADV_CFG (DATA->configStaAdv)
#define STA_CFG (DATA->configSta)
#define STA_ADV_CFG (DATA->configStaAdv)
#define AP_CFG (DATA->configAp)
#define IP_STATUS (DATA->statusIp)
#define LINK_STATUS (DATA->statusLink)
Expand Down
24 changes: 12 additions & 12 deletions cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, cons
strcpy(STA_ADV_CFG.key, passphrase);
STA_ADV_CFG.key_len = strlen(passphrase);
} else {
STA_ADV_CFG.key[0] = '\0';
STA_ADV_CFG.key[0] = '\0';
STA_ADV_CFG.key_len = 0;
}
STA_ADV_CFG.ap_info.channel = channel;
STA_ADV_CFG.ap_info.channel = channel;
STA_ADV_CFG.wifi_retry_interval = 100;
} else {
strcpy(STA_CFG.wifi_ssid, ssid);
Expand All @@ -34,7 +34,7 @@ WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, cons
STA_CFG.wifi_key[0] = '\0';
}
STA_CFG.wifi_retry_interval = 100;
STA_CFG.wifi_mode = BK_STATION;
STA_CFG.wifi_mode = BK_STATION;
}

if (reconnect(bssid))
Expand All @@ -44,7 +44,7 @@ WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, cons
}

bool WiFiClass::config(IPAddress localIP, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2) {
STA_CFG.dhcp_mode = localIP ? DHCP_DISABLE : DHCP_CLIENT;
STA_CFG.dhcp_mode = localIP ? DHCP_DISABLE : DHCP_CLIENT;
STA_ADV_CFG.dhcp_mode = localIP ? DHCP_DISABLE : DHCP_CLIENT;
if (localIP) {
sprintf(STA_CFG.local_ip_addr, IP_FMT, localIP[0], localIP[1], localIP[2], localIP[3]);
Expand All @@ -57,17 +57,17 @@ bool WiFiClass::config(IPAddress localIP, IPAddress gateway, IPAddress subnet, I
sprintf(STA_CFG.dns_server_ip_addr, IP_FMT, dns1[0], dns1[1], dns1[2], dns1[3]);
sprintf(STA_ADV_CFG.dns_server_ip_addr, IP_FMT, dns1[0], dns1[1], dns1[2], dns1[3]);
} else {
STA_CFG.dns_server_ip_addr[0] = '\0';
STA_CFG.dns_server_ip_addr[0] = '\0';
STA_ADV_CFG.dns_server_ip_addr[0] = '\0';
}
} else {
STA_CFG.local_ip_addr[0] = '\0';
STA_CFG.net_mask[0] = '\0';
STA_CFG.gateway_ip_addr[0] = '\0';
STA_CFG.dns_server_ip_addr[0] = '\0';
STA_ADV_CFG.local_ip_addr[0] = '\0';
STA_ADV_CFG.net_mask[0] = '\0';
STA_ADV_CFG.gateway_ip_addr[0] = '\0';
STA_CFG.local_ip_addr[0] = '\0';
STA_CFG.net_mask[0] = '\0';
STA_CFG.gateway_ip_addr[0] = '\0';
STA_CFG.dns_server_ip_addr[0] = '\0';
STA_ADV_CFG.local_ip_addr[0] = '\0';
STA_ADV_CFG.net_mask[0] = '\0';
STA_ADV_CFG.gateway_ip_addr[0] = '\0';
STA_ADV_CFG.dns_server_ip_addr[0] = '\0';
}

Expand Down

0 comments on commit ba55155

Please sign in to comment.