Realign pointer star
This commit is contained in:
parent
69c22cf2e3
commit
21ddf79ca9
|
@ -189,11 +189,11 @@ sp_paren_brace = ignore # ignore/add/remove/force/not_defined
|
||||||
sp_brace_brace = ignore # ignore/add/remove/force/not_defined
|
sp_brace_brace = ignore # ignore/add/remove/force/not_defined
|
||||||
|
|
||||||
# Add or remove space before pointer star '*'.
|
# Add or remove space before pointer star '*'.
|
||||||
sp_before_ptr_star = ignore # ignore/add/remove/force/not_defined
|
sp_before_ptr_star = remove # ignore/add/remove/force/not_defined
|
||||||
|
|
||||||
# Add or remove space before pointer star '*' that isn't followed by a
|
# Add or remove space before pointer star '*' that isn't followed by a
|
||||||
# variable name. If set to ignore, sp_before_ptr_star is used instead.
|
# variable name. If set to ignore, sp_before_ptr_star is used instead.
|
||||||
sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force/not_defined
|
sp_before_unnamed_ptr_star = add # ignore/add/remove/force/not_defined
|
||||||
|
|
||||||
# Add or remove space between pointer stars '*', as in 'int ***a;'.
|
# Add or remove space between pointer stars '*', as in 'int ***a;'.
|
||||||
sp_between_ptr_star = ignore # ignore/add/remove/force/not_defined
|
sp_between_ptr_star = ignore # ignore/add/remove/force/not_defined
|
||||||
|
@ -201,7 +201,7 @@ sp_between_ptr_star = ignore # ignore/add/remove/force/not_defined
|
||||||
# Add or remove space after pointer star '*', if followed by a word.
|
# Add or remove space after pointer star '*', if followed by a word.
|
||||||
#
|
#
|
||||||
# Overrides sp_type_func.
|
# Overrides sp_type_func.
|
||||||
sp_after_ptr_star = ignore # ignore/add/remove/force/not_defined
|
sp_after_ptr_star = add # ignore/add/remove/force/not_defined
|
||||||
|
|
||||||
# Add or remove space after pointer caret '^', if followed by a word.
|
# Add or remove space after pointer caret '^', if followed by a word.
|
||||||
sp_after_ptr_block_caret = ignore # ignore/add/remove/force/not_defined
|
sp_after_ptr_block_caret = ignore # ignore/add/remove/force/not_defined
|
||||||
|
|
|
@ -13,7 +13,7 @@ class MFRC522CardReader : public CardReader {
|
||||||
private:
|
private:
|
||||||
MFRC522* iReader;
|
MFRC522* iReader;
|
||||||
public:
|
public:
|
||||||
explicit MFRC522CardReader(MFRC522 *reader);
|
explicit MFRC522CardReader(MFRC522* reader);
|
||||||
bool isNewCardPresent() override;
|
bool isNewCardPresent() override;
|
||||||
String getCardUid() override;
|
String getCardUid() override;
|
||||||
};
|
};
|
||||||
|
@ -22,7 +22,7 @@ class RDM6300CardReader : public CardReader {
|
||||||
private:
|
private:
|
||||||
Rdm6300* iReader;
|
Rdm6300* iReader;
|
||||||
public:
|
public:
|
||||||
explicit RDM6300CardReader(Rdm6300 *reader);
|
explicit RDM6300CardReader(Rdm6300* reader);
|
||||||
bool isNewCardPresent() override;
|
bool isNewCardPresent() override;
|
||||||
String getCardUid() override;
|
String getCardUid() override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <HTTPClient.h>
|
#include <HTTPClient.h>
|
||||||
|
|
||||||
unsigned long cooldownSecondsRemaining(unsigned long timeout, unsigned long timer);
|
unsigned long cooldownSecondsRemaining(unsigned long timeout, unsigned long timer);
|
||||||
String byteArrayAsHexString(byte *buffer, byte bufferSize);
|
String byteArrayAsHexString(byte* buffer, byte bufferSize);
|
||||||
String cardLink(WiFiClient* wifi, HTTPClient* http, const String& apiUrl, const String& cardId);
|
String cardLink(WiFiClient* wifi, HTTPClient* http, const String& apiUrl, const String& cardId);
|
||||||
String cardBalance(WiFiClient* wifi, HTTPClient* http, const String& apiUrl, const String& cardId);
|
String cardBalance(WiFiClient* wifi, HTTPClient* http, const String& apiUrl, const String& cardId);
|
||||||
String cardTransaction(WiFiClient* wifi, HTTPClient* http, const String& apiUrl, const String& cardId, const String& amount);
|
String cardTransaction(WiFiClient* wifi, HTTPClient* http, const String& apiUrl, const String& cardId, const String& amount);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "cardReader.h"
|
#include "cardReader.h"
|
||||||
|
|
||||||
MFRC522CardReader::MFRC522CardReader(MFRC522 *reader) {
|
MFRC522CardReader::MFRC522CardReader(MFRC522* reader) {
|
||||||
iReader = reader;
|
iReader = reader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ String MFRC522CardReader::getCardUid() {
|
||||||
return byteArrayAsHexString(iReader->uid.uidByte, iReader->uid.size);
|
return byteArrayAsHexString(iReader->uid.uidByte, iReader->uid.size);
|
||||||
}
|
}
|
||||||
|
|
||||||
RDM6300CardReader::RDM6300CardReader(Rdm6300 *reader) {
|
RDM6300CardReader::RDM6300CardReader(Rdm6300* reader) {
|
||||||
iReader = reader;
|
iReader = reader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
|
|
||||||
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);
|
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);
|
||||||
MFRC522 mfrc522(PIN_HSPI_SS, PIN_HSPI_RST);
|
MFRC522 mfrc522(PIN_HSPI_SS, PIN_HSPI_RST);
|
||||||
WiFiClient *wifi = new WiFiClientFixed();
|
WiFiClient* wifi = new WiFiClientFixed();
|
||||||
HTTPClient *http = new HTTPClient();
|
HTTPClient* http = new HTTPClient();
|
||||||
Rdm6300 rdm6300;
|
Rdm6300 rdm6300;
|
||||||
|
|
||||||
auto mfrc522reader = MFRC522CardReader(&mfrc522);
|
auto mfrc522reader = MFRC522CardReader(&mfrc522);
|
||||||
|
@ -135,7 +135,7 @@ void loop() {
|
||||||
updateOLED(u8g2, state);
|
updateOLED(u8g2, state);
|
||||||
break;
|
break;
|
||||||
case STATE_TRANSACT_CARDSCAN:
|
case STATE_TRANSACT_CARDSCAN:
|
||||||
for (CardReader *reader : readers) {
|
for (CardReader* reader : readers) {
|
||||||
if (reader->isNewCardPresent()) {
|
if (reader->isNewCardPresent()) {
|
||||||
scannedCardId = reader->getCardUid();
|
scannedCardId = reader->getCardUid();
|
||||||
lastStatusText = "Card #" + scannedCardId;
|
lastStatusText = "Card #" + scannedCardId;
|
||||||
|
@ -165,7 +165,7 @@ void loop() {
|
||||||
timer = millis();
|
timer = millis();
|
||||||
return;
|
return;
|
||||||
case STATE_LINK_CARDSCAN:
|
case STATE_LINK_CARDSCAN:
|
||||||
for (CardReader *reader : readers) {
|
for (CardReader* reader : readers) {
|
||||||
if (reader->isNewCardPresent()) {
|
if (reader->isNewCardPresent()) {
|
||||||
scannedCardId = reader->getCardUid();
|
scannedCardId = reader->getCardUid();
|
||||||
lastStatusText = "Card #" + scannedCardId;
|
lastStatusText = "Card #" + scannedCardId;
|
||||||
|
@ -197,7 +197,7 @@ void loop() {
|
||||||
timer = millis();
|
timer = millis();
|
||||||
return;
|
return;
|
||||||
case STATE_BALANCE_CARDSCAN:
|
case STATE_BALANCE_CARDSCAN:
|
||||||
for (CardReader *reader : readers) {
|
for (CardReader* reader : readers) {
|
||||||
if (reader->isNewCardPresent()) {
|
if (reader->isNewCardPresent()) {
|
||||||
scannedCardId = reader->getCardUid();
|
scannedCardId = reader->getCardUid();
|
||||||
lastStatusText = "Card #" + scannedCardId;
|
lastStatusText = "Card #" + scannedCardId;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <WiFiClient.h>
|
#include <WiFiClient.h>
|
||||||
#include <HTTPClient.h>
|
#include <HTTPClient.h>
|
||||||
|
|
||||||
String byteArrayAsHexString(byte *buffer, byte bufferSize) {
|
String byteArrayAsHexString(byte* buffer, byte bufferSize) {
|
||||||
String s = "";
|
String s = "";
|
||||||
for (byte i = 0; i < bufferSize; i++) {
|
for (byte i = 0; i < bufferSize; i++) {
|
||||||
s += (buffer[i] < 0x10 ? "0" : "");
|
s += (buffer[i] < 0x10 ? "0" : "");
|
||||||
|
@ -45,7 +45,7 @@ String splitString(const String& data, char separator, int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String cardLink(WiFiClient *wifi, HTTPClient *http, const String& apiUrl, const String& cardId) {
|
String cardLink(WiFiClient* wifi, HTTPClient* http, const String& apiUrl, const String& cardId) {
|
||||||
String finalRequestUrl = apiUrl + "/api/card/" + cardId + "/link";
|
String finalRequestUrl = apiUrl + "/api/card/" + cardId + "/link";
|
||||||
http->begin(*wifi, finalRequestUrl.c_str());
|
http->begin(*wifi, finalRequestUrl.c_str());
|
||||||
http->addHeader("Content-Type", "application/json");
|
http->addHeader("Content-Type", "application/json");
|
||||||
|
@ -84,7 +84,7 @@ String cardLink(WiFiClient *wifi, HTTPClient *http, const String& apiUrl, const
|
||||||
return String("E:Internal Error ") + httpResponseCode;
|
return String("E:Internal Error ") + httpResponseCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
String cardBalance(WiFiClient *wifi, HTTPClient *http, const String& apiUrl, const String& cardId) {
|
String cardBalance(WiFiClient* wifi, HTTPClient* http, const String& apiUrl, const String& cardId) {
|
||||||
String finalRequestUrl = apiUrl + "/api/card/" + cardId + "/balance";
|
String finalRequestUrl = apiUrl + "/api/card/" + cardId + "/balance";
|
||||||
http->begin(*wifi, finalRequestUrl.c_str());
|
http->begin(*wifi, finalRequestUrl.c_str());
|
||||||
http->addHeader("Content-Type", "application/json");
|
http->addHeader("Content-Type", "application/json");
|
||||||
|
@ -121,7 +121,7 @@ String cardBalance(WiFiClient *wifi, HTTPClient *http, const String& apiUrl, con
|
||||||
return String("E:Internal Error ") + httpResponseCode;
|
return String("E:Internal Error ") + httpResponseCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
String cardTransaction(WiFiClient *wifi, HTTPClient *http, const String& apiUrl, const String& cardId, const String& amount) {
|
String cardTransaction(WiFiClient* wifi, HTTPClient* http, const String& apiUrl, const String& cardId, const String& amount) {
|
||||||
String idempotencyKey = getIdempotencyKey();
|
String idempotencyKey = getIdempotencyKey();
|
||||||
String finalRequestUrl = apiUrl + "/api/card/" + cardId + "/transaction/" + idempotencyKey + "?amount=" + amount;
|
String finalRequestUrl = apiUrl + "/api/card/" + cardId + "/transaction/" + idempotencyKey + "?amount=" + amount;
|
||||||
http->begin(*wifi, finalRequestUrl.c_str());
|
http->begin(*wifi, finalRequestUrl.c_str());
|
||||||
|
|
|
@ -10,7 +10,7 @@ void WiFiClientFixed::flush() {
|
||||||
if (!a) {
|
if (!a) {
|
||||||
return;//nothing to flush
|
return;//nothing to flush
|
||||||
}
|
}
|
||||||
auto *buf = (uint8_t *) malloc(WIFI_CLIENT_FLUSH_BUFFER_SIZE);
|
auto* buf = (uint8_t *) malloc(WIFI_CLIENT_FLUSH_BUFFER_SIZE);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
return;//memory error
|
return;//memory error
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue