[misc] Update .clang-format style
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
# 2024-07-30
|
||||||
Language: Cpp
|
Language: Cpp
|
||||||
BasedOnStyle: LLVM
|
BasedOnStyle: LLVM
|
||||||
AlignAfterOpenBracket: BlockIndent
|
AlignAfterOpenBracket: BlockIndent
|
||||||
@@ -6,6 +7,7 @@ AlignConsecutiveAssignments: true
|
|||||||
AlignConsecutiveMacros: AcrossComments
|
AlignConsecutiveMacros: AcrossComments
|
||||||
AlignTrailingComments: true
|
AlignTrailingComments: true
|
||||||
AllowAllArgumentsOnNextLine: false
|
AllowAllArgumentsOnNextLine: false
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
AllowShortBlocksOnASingleLine: Empty
|
AllowShortBlocksOnASingleLine: Empty
|
||||||
AllowShortFunctionsOnASingleLine: Empty
|
AllowShortFunctionsOnASingleLine: Empty
|
||||||
AlwaysBreakTemplateDeclarations: Yes
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
@@ -21,6 +23,7 @@ IndentCaseLabels: true
|
|||||||
IndentWidth: 4
|
IndentWidth: 4
|
||||||
LambdaBodyIndentation: Signature
|
LambdaBodyIndentation: Signature
|
||||||
MaxEmptyLinesToKeep: 1
|
MaxEmptyLinesToKeep: 1
|
||||||
|
PenaltyReturnTypeOnItsOwnLine: 1000
|
||||||
# PointerAlignment: Left # TODO enable this and reformat project
|
# PointerAlignment: Left # TODO enable this and reformat project
|
||||||
QualifierAlignment: Left
|
QualifierAlignment: Left
|
||||||
ReflowComments: true
|
ReflowComments: true
|
||||||
|
|||||||
@@ -2,8 +2,13 @@
|
|||||||
|
|
||||||
#include "WiFiPrivate.h"
|
#include "WiFiPrivate.h"
|
||||||
|
|
||||||
WiFiStatus
|
WiFiStatus WiFiClass::begin(
|
||||||
WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) {
|
const char *ssid,
|
||||||
|
const char *passphrase,
|
||||||
|
int32_t channel,
|
||||||
|
const uint8_t *bssid,
|
||||||
|
bool connect
|
||||||
|
) {
|
||||||
if (!enableSTA(true))
|
if (!enableSTA(true))
|
||||||
return WL_CONNECT_FAILED;
|
return WL_CONNECT_FAILED;
|
||||||
if (!validate(ssid, passphrase))
|
if (!validate(ssid, passphrase))
|
||||||
|
|||||||
@@ -70,8 +70,12 @@ OSStatus __wrap_bk_flash_erase(bk_partition_t partition, uint32_t off_set, uint3
|
|||||||
return kNoErr;
|
return kNoErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSStatus
|
OSStatus __wrap_bk_flash_write(
|
||||||
__wrap_bk_flash_write(bk_partition_t partition, volatile uint32_t off_set, uint8_t *inBuffer, uint32_t inBufferLength) {
|
bk_partition_t partition,
|
||||||
|
volatile uint32_t off_set,
|
||||||
|
uint8_t *inBuffer,
|
||||||
|
uint32_t inBufferLength
|
||||||
|
) {
|
||||||
UINT32 status;
|
UINT32 status;
|
||||||
DD_HANDLE flash_hdl;
|
DD_HANDLE flash_hdl;
|
||||||
uint32_t start_addr;
|
uint32_t start_addr;
|
||||||
@@ -98,8 +102,12 @@ __wrap_bk_flash_write(bk_partition_t partition, volatile uint32_t off_set, uint8
|
|||||||
return kNoErr;
|
return kNoErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSStatus
|
OSStatus __wrap_bk_flash_read(
|
||||||
__wrap_bk_flash_read(bk_partition_t partition, volatile uint32_t off_set, uint8_t *outBuffer, uint32_t inBufferLength) {
|
bk_partition_t partition,
|
||||||
|
volatile uint32_t off_set,
|
||||||
|
uint8_t *outBuffer,
|
||||||
|
uint32_t inBufferLength
|
||||||
|
) {
|
||||||
UINT32 status;
|
UINT32 status;
|
||||||
uint32_t start_addr;
|
uint32_t start_addr;
|
||||||
DD_HANDLE flash_hdl;
|
DD_HANDLE flash_hdl;
|
||||||
|
|||||||
@@ -97,8 +97,13 @@ class WiFiClass {
|
|||||||
const uint8_t *bssid = NULL,
|
const uint8_t *bssid = NULL,
|
||||||
bool connect = true
|
bool connect = true
|
||||||
);
|
);
|
||||||
WiFiStatus
|
WiFiStatus begin(
|
||||||
begin(char *ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t *bssid = NULL, bool connect = true);
|
char *ssid,
|
||||||
|
char *passphrase = NULL,
|
||||||
|
int32_t channel = 0,
|
||||||
|
const uint8_t *bssid = NULL,
|
||||||
|
bool connect = true
|
||||||
|
);
|
||||||
|
|
||||||
bool config(
|
bool config(
|
||||||
IPAddress localIP,
|
IPAddress localIP,
|
||||||
@@ -178,7 +183,11 @@ class WiFiClass {
|
|||||||
|
|
||||||
public: /* WiFiAP.cpp */
|
public: /* WiFiAP.cpp */
|
||||||
bool softAP(
|
bool softAP(
|
||||||
const char *ssid, const char *passphrase = NULL, int channel = 1, bool ssidHidden = false, int maxClients = 4
|
const char *ssid,
|
||||||
|
const char *passphrase = NULL,
|
||||||
|
int channel = 1,
|
||||||
|
bool ssidHidden = false,
|
||||||
|
int maxClients = 4
|
||||||
);
|
);
|
||||||
bool softAPConfig(IPAddress localIP, IPAddress gateway, IPAddress subnet);
|
bool softAPConfig(IPAddress localIP, IPAddress gateway, IPAddress subnet);
|
||||||
bool softAPdisconnect(bool wifiOff = false);
|
bool softAPdisconnect(bool wifiOff = false);
|
||||||
|
|||||||
@@ -3,7 +3,12 @@
|
|||||||
#include "WiFi.h"
|
#include "WiFi.h"
|
||||||
|
|
||||||
bool WiFiClass::getNetworkInfo(
|
bool WiFiClass::getNetworkInfo(
|
||||||
uint8_t networkItem, String &ssid, WiFiAuthMode &encType, int32_t &rssi, uint8_t *&bssid, int32_t &channel
|
uint8_t networkItem,
|
||||||
|
String &ssid,
|
||||||
|
WiFiAuthMode &encType,
|
||||||
|
int32_t &rssi,
|
||||||
|
uint8_t *&bssid,
|
||||||
|
int32_t &channel
|
||||||
) {
|
) {
|
||||||
ssid = SSID(networkItem);
|
ssid = SSID(networkItem);
|
||||||
encType = encryptionType(networkItem);
|
encType = encryptionType(networkItem);
|
||||||
|
|||||||
@@ -86,13 +86,21 @@ int MbedTLSClient::connect(const char *host, uint16_t port, int32_t timeout) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int MbedTLSClient::connect(
|
int MbedTLSClient::connect(
|
||||||
IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey
|
IPAddress ip,
|
||||||
|
uint16_t port,
|
||||||
|
const char *rootCABuf,
|
||||||
|
const char *clientCert,
|
||||||
|
const char *clientKey
|
||||||
) {
|
) {
|
||||||
return connect(ipToString(ip).c_str(), port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0;
|
return connect(ipToString(ip).c_str(), port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int MbedTLSClient::connect(
|
int MbedTLSClient::connect(
|
||||||
const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey
|
const char *host,
|
||||||
|
uint16_t port,
|
||||||
|
const char *rootCABuf,
|
||||||
|
const char *clientCert,
|
||||||
|
const char *clientKey
|
||||||
) {
|
) {
|
||||||
return connect(host, port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0;
|
return connect(host, port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,12 +26,22 @@
|
|||||||
|
|
||||||
class IWiFiClientSecure {
|
class IWiFiClientSecure {
|
||||||
public:
|
public:
|
||||||
virtual int
|
virtual int connect(
|
||||||
connect(IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey) = 0;
|
IPAddress ip,
|
||||||
virtual int
|
uint16_t port,
|
||||||
connect(const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey) = 0;
|
const char *rootCABuf,
|
||||||
virtual int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk) = 0;
|
const char *clientCert,
|
||||||
virtual int connect(const char *host, uint16_t port, const char *pskIdent, const char *psk) = 0;
|
const char *clientKey
|
||||||
|
) = 0;
|
||||||
|
virtual int connect(
|
||||||
|
const char *host,
|
||||||
|
uint16_t port,
|
||||||
|
const char *rootCABuf,
|
||||||
|
const char *clientCert,
|
||||||
|
const char *clientKey
|
||||||
|
) = 0;
|
||||||
|
virtual int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk) = 0;
|
||||||
|
virtual int connect(const char *host, uint16_t port, const char *pskIdent, const char *psk) = 0;
|
||||||
|
|
||||||
virtual int lastError(char *buf, const size_t size) = 0;
|
virtual int lastError(char *buf, const size_t size) = 0;
|
||||||
virtual void setInsecure() = 0; // Don't validate the chain, just accept whatever is given. VERY INSECURE!
|
virtual void setInsecure() = 0; // Don't validate the chain, just accept whatever is given. VERY INSECURE!
|
||||||
|
|||||||
@@ -166,8 +166,11 @@ static bool enableMDNS(struct netif *netif) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK
|
#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK
|
||||||
static void
|
static void mdns_netif_ext_status_callback(
|
||||||
mdns_netif_ext_status_callback(struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) {
|
struct netif *netif,
|
||||||
|
netif_nsc_reason_t reason,
|
||||||
|
const netif_ext_callback_args_t *args
|
||||||
|
) {
|
||||||
if (reason & LWIP_NSC_NETIF_REMOVED) {
|
if (reason & LWIP_NSC_NETIF_REMOVED) {
|
||||||
LT_DM(MDNS, "Netif removed, stopping mDNS on netif %u", netif->num);
|
LT_DM(MDNS, "Netif removed, stopping mDNS on netif %u", netif->num);
|
||||||
mdns_resp_remove_netif(netif);
|
mdns_resp_remove_netif(netif);
|
||||||
|
|||||||
@@ -321,7 +321,12 @@ bool HTTPClient::begin(String host, uint16_t port, String uri, const char *CAcer
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool HTTPClient::begin(
|
bool HTTPClient::begin(
|
||||||
String host, uint16_t port, String uri, const char *CAcert, const char *cli_cert, const char *cli_key
|
String host,
|
||||||
|
uint16_t port,
|
||||||
|
String uri,
|
||||||
|
const char *CAcert,
|
||||||
|
const char *cli_cert,
|
||||||
|
const char *cli_key
|
||||||
) {
|
) {
|
||||||
if (_client && !_tcpDeprecated) {
|
if (_client && !_tcpDeprecated) {
|
||||||
log_d("mix up of new and deprecated api");
|
log_d("mix up of new and deprecated api");
|
||||||
|
|||||||
@@ -81,7 +81,9 @@ class WebServer {
|
|||||||
|
|
||||||
bool authenticate(const char *username, const char *password);
|
bool authenticate(const char *username, const char *password);
|
||||||
void requestAuthentication(
|
void requestAuthentication(
|
||||||
HTTPAuthMethod mode = BASIC_AUTH, const char *realm = NULL, const String &authFailMsg = String("")
|
HTTPAuthMethod mode = BASIC_AUTH,
|
||||||
|
const char *realm = NULL,
|
||||||
|
const String &authFailMsg = String("")
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef std::function<void(void)> THandlerFunction;
|
typedef std::function<void(void)> THandlerFunction;
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ using namespace mime;
|
|||||||
class FunctionRequestHandler : public RequestHandler {
|
class FunctionRequestHandler : public RequestHandler {
|
||||||
public:
|
public:
|
||||||
FunctionRequestHandler(
|
FunctionRequestHandler(
|
||||||
WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn, const Uri &uri, HTTPMethod method
|
WebServer::THandlerFunction fn,
|
||||||
|
WebServer::THandlerFunction ufn,
|
||||||
|
const Uri &uri,
|
||||||
|
HTTPMethod method
|
||||||
)
|
)
|
||||||
: _fn(fn), _ufn(ufn), _uri(uri.clone()), _method(method) {
|
: _fn(fn), _ufn(ufn), _uri(uri.clone()), _method(method) {
|
||||||
_uri->initPathArgs(pathArgs);
|
_uri->initPathArgs(pathArgs);
|
||||||
|
|||||||
@@ -2,8 +2,13 @@
|
|||||||
|
|
||||||
#include "WiFiPrivate.h"
|
#include "WiFiPrivate.h"
|
||||||
|
|
||||||
WiFiStatus
|
WiFiStatus WiFiClass::begin(
|
||||||
WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) {
|
const char *ssid,
|
||||||
|
const char *passphrase,
|
||||||
|
int32_t channel,
|
||||||
|
const uint8_t *bssid,
|
||||||
|
bool connect
|
||||||
|
) {
|
||||||
if (!enableSTA(true))
|
if (!enableSTA(true))
|
||||||
return WL_CONNECT_FAILED;
|
return WL_CONNECT_FAILED;
|
||||||
if (!validate(ssid, passphrase))
|
if (!validate(ssid, passphrase))
|
||||||
|
|||||||
Reference in New Issue
Block a user