Skip to content

Commit

Permalink
[misc] Update .clang-format style
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba2k2 committed Sep 5, 2024
1 parent 31e1d51 commit 8a8c91e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 2024-07-30
Language: Cpp
BasedOnStyle: LLVM
AlignAfterOpenBracket: BlockIndent
Expand All @@ -6,6 +7,7 @@ AlignConsecutiveAssignments: true
AlignConsecutiveMacros: AcrossComments
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: Empty
AlwaysBreakTemplateDeclarations: Yes
Expand All @@ -21,6 +23,7 @@ IndentCaseLabels: true
IndentWidth: 4
LambdaBodyIndentation: Signature
MaxEmptyLinesToKeep: 1
PenaltyReturnTypeOnItsOwnLine: 1000
# PointerAlignment: Left # TODO enable this and reformat project
QualifierAlignment: Left
ReflowComments: true
Expand Down
15 changes: 12 additions & 3 deletions cores/common/arduino/libraries/api/WiFi/WiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,13 @@ class WiFiClass {
const uint8_t *bssid = NULL,
bool connect = true
);
WiFiStatus
begin(char *ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t *bssid = NULL, bool connect = true);
WiFiStatus begin(
char *ssid,
char *passphrase = NULL,
int32_t channel = 0,
const uint8_t *bssid = NULL,
bool connect = true
);

bool config(
IPAddress localIP,
Expand Down Expand Up @@ -178,7 +183,11 @@ class WiFiClass {

public: /* WiFiAP.cpp */
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 softAPdisconnect(bool wifiOff = false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,22 @@

class IWiFiClientSecure {
public:
virtual int
connect(IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, 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 connect(
IPAddress ip,
uint16_t port,
const char *rootCABuf,
const char *clientCert,
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 void setInsecure() = 0; // Don't validate the chain, just accept whatever is given. VERY INSECURE!
Expand Down
4 changes: 3 additions & 1 deletion cores/common/arduino/libraries/ext/WebServer/WebServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ class WebServer {

bool authenticate(const char *username, const char *password);
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ using namespace mime;
class FunctionRequestHandler : public RequestHandler {
public:
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) {
_uri->initPathArgs(pathArgs);
Expand Down

0 comments on commit 8a8c91e

Please sign in to comment.