Skip to content

Commit 75740e3

Browse files
committed
fmt
1 parent 929919c commit 75740e3

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
all: fmt
22

33
fmt:
4-
clang-format -i src/*.h -style="{BasedOnStyle: Google, ColumnLimit: 120}"
4+
clang-format -i src/*.h src/*.cpp -style="{BasedOnStyle: Google, ColumnLimit: 120}"
55

66
update:
77
rm -rf ./lwmqtt

src/MQTTClient.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ inline int32_t lwmqtt_arduino_timer_get(void *ref) {
1616
return (int32_t)t->end - (int32_t)millis();
1717
}
1818

19-
inline lwmqtt_err_t lwmqtt_arduino_network_read(void *ref, uint8_t *buffer, size_t len, size_t *read, uint32_t timeout) {
19+
inline lwmqtt_err_t lwmqtt_arduino_network_read(void *ref, uint8_t *buffer, size_t len, size_t *read,
20+
uint32_t timeout) {
2021
// cast network reference
2122
auto n = (lwmqtt_arduino_network_t *)ref;
2223

@@ -32,7 +33,8 @@ inline lwmqtt_err_t lwmqtt_arduino_network_read(void *ref, uint8_t *buffer, size
3233
return LWMQTT_SUCCESS;
3334
}
3435

35-
inline lwmqtt_err_t lwmqtt_arduino_network_write(void *ref, uint8_t *buffer, size_t len, size_t *sent, uint32_t /*timeout*/) {
36+
inline lwmqtt_err_t lwmqtt_arduino_network_write(void *ref, uint8_t *buffer, size_t len, size_t *sent,
37+
uint32_t /*timeout*/) {
3638
// cast network reference
3739
auto n = (lwmqtt_arduino_network_t *)ref;
3840

@@ -242,7 +244,7 @@ bool MQTTClient::connect(const char clientId[], const char username[], const cha
242244
this->network.client = this->netClient;
243245

244246
// connect to host
245-
if(!skip) {
247+
if (!skip) {
246248
int ret = this->netClient->connect(this->hostname, (uint16_t)this->port);
247249
if (ret <= 0) {
248250
return false;

src/MQTTClient.h

100755100644
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ class MQTTClient {
7575
void setOptions(int keepAlive, bool cleanSession, int timeout);
7676

7777
bool connect(const char clientId[], bool skip = false) { return this->connect(clientId, nullptr, nullptr, skip); }
78-
bool connect(const char clientId[], const char username[], bool skip = false) { return this->connect(clientId, username, nullptr, skip); }
78+
bool connect(const char clientId[], const char username[], bool skip = false) {
79+
return this->connect(clientId, username, nullptr, skip);
80+
}
7981
bool connect(const char clientId[], const char username[], const char password[], bool skip = false);
8082

8183
bool publish(const String &topic) { return this->publish(topic.c_str(), ""); }
@@ -115,8 +117,7 @@ class MQTTClient {
115117

116118
bool disconnect();
117119

118-
private:
119-
120+
private:
120121
void close();
121122
};
122123

0 commit comments

Comments
 (0)