diff --git a/AfRApay.MateCard/.uncrustify.cfg b/AfRApay.MateCard/.uncrustify.cfg index c69257c..d7f027f 100644 --- a/AfRApay.MateCard/.uncrustify.cfg +++ b/AfRApay.MateCard/.uncrustify.cfg @@ -189,11 +189,11 @@ sp_paren_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 '*'. -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 # 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;'. 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. # # 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. sp_after_ptr_block_caret = ignore # ignore/add/remove/force/not_defined diff --git a/AfRApay.MateCard/include/cardReader.h b/AfRApay.MateCard/include/cardReader.h index 0445080..2016b1c 100644 --- a/AfRApay.MateCard/include/cardReader.h +++ b/AfRApay.MateCard/include/cardReader.h @@ -13,7 +13,7 @@ class MFRC522CardReader : public CardReader { private: MFRC522* iReader; public: - explicit MFRC522CardReader(MFRC522 *reader); + explicit MFRC522CardReader(MFRC522* reader); bool isNewCardPresent() override; String getCardUid() override; }; @@ -22,7 +22,7 @@ class RDM6300CardReader : public CardReader { private: Rdm6300* iReader; public: - explicit RDM6300CardReader(Rdm6300 *reader); + explicit RDM6300CardReader(Rdm6300* reader); bool isNewCardPresent() override; String getCardUid() override; }; diff --git a/AfRApay.MateCard/include/utils.h b/AfRApay.MateCard/include/utils.h index e6c121d..6250846 100644 --- a/AfRApay.MateCard/include/utils.h +++ b/AfRApay.MateCard/include/utils.h @@ -3,7 +3,7 @@ #include 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 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); diff --git a/AfRApay.MateCard/src/cardReader.cpp b/AfRApay.MateCard/src/cardReader.cpp index 2808a37..cc5e255 100644 --- a/AfRApay.MateCard/src/cardReader.cpp +++ b/AfRApay.MateCard/src/cardReader.cpp @@ -4,7 +4,7 @@ #include "utils.h" #include "cardReader.h" -MFRC522CardReader::MFRC522CardReader(MFRC522 *reader) { +MFRC522CardReader::MFRC522CardReader(MFRC522* reader) { iReader = reader; } @@ -16,7 +16,7 @@ String MFRC522CardReader::getCardUid() { return byteArrayAsHexString(iReader->uid.uidByte, iReader->uid.size); } -RDM6300CardReader::RDM6300CardReader(Rdm6300 *reader) { +RDM6300CardReader::RDM6300CardReader(Rdm6300* reader) { iReader = reader; } diff --git a/AfRApay.MateCard/src/main.cpp b/AfRApay.MateCard/src/main.cpp index cb30cc6..94d189b 100644 --- a/AfRApay.MateCard/src/main.cpp +++ b/AfRApay.MateCard/src/main.cpp @@ -20,8 +20,8 @@ U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE); MFRC522 mfrc522(PIN_HSPI_SS, PIN_HSPI_RST); -WiFiClient *wifi = new WiFiClientFixed(); -HTTPClient *http = new HTTPClient(); +WiFiClient* wifi = new WiFiClientFixed(); +HTTPClient* http = new HTTPClient(); Rdm6300 rdm6300; auto mfrc522reader = MFRC522CardReader(&mfrc522); @@ -135,7 +135,7 @@ void loop() { updateOLED(u8g2, state); break; case STATE_TRANSACT_CARDSCAN: - for (CardReader *reader : readers) { + for (CardReader* reader : readers) { if (reader->isNewCardPresent()) { scannedCardId = reader->getCardUid(); lastStatusText = "Card #" + scannedCardId; @@ -165,7 +165,7 @@ void loop() { timer = millis(); return; case STATE_LINK_CARDSCAN: - for (CardReader *reader : readers) { + for (CardReader* reader : readers) { if (reader->isNewCardPresent()) { scannedCardId = reader->getCardUid(); lastStatusText = "Card #" + scannedCardId; @@ -197,7 +197,7 @@ void loop() { timer = millis(); return; case STATE_BALANCE_CARDSCAN: - for (CardReader *reader : readers) { + for (CardReader* reader : readers) { if (reader->isNewCardPresent()) { scannedCardId = reader->getCardUid(); lastStatusText = "Card #" + scannedCardId; diff --git a/AfRApay.MateCard/src/utils.cpp b/AfRApay.MateCard/src/utils.cpp index 8ba29eb..409c582 100644 --- a/AfRApay.MateCard/src/utils.cpp +++ b/AfRApay.MateCard/src/utils.cpp @@ -3,7 +3,7 @@ #include #include -String byteArrayAsHexString(byte *buffer, byte bufferSize) { +String byteArrayAsHexString(byte* buffer, byte bufferSize) { String s = ""; for (byte i = 0; i < bufferSize; i++) { 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"; http->begin(*wifi, finalRequestUrl.c_str()); 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; } -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"; http->begin(*wifi, finalRequestUrl.c_str()); 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; } -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 finalRequestUrl = apiUrl + "/api/card/" + cardId + "/transaction/" + idempotencyKey + "?amount=" + amount; http->begin(*wifi, finalRequestUrl.c_str()); diff --git a/AfRApay.MateCard/src/wifiFix.cpp b/AfRApay.MateCard/src/wifiFix.cpp index e4403f1..3b95fe2 100644 --- a/AfRApay.MateCard/src/wifiFix.cpp +++ b/AfRApay.MateCard/src/wifiFix.cpp @@ -10,7 +10,7 @@ void WiFiClientFixed::flush() { if (!a) { 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) { return;//memory error }