Revert "optimise functions"

This reverts commit 57eb6b9a3b.
This commit is contained in:
Rotzbua
2018-10-04 12:52:00 +02:00
parent 5172bc4cbe
commit eb1fa49d47
2 changed files with 7 additions and 7 deletions

View File

@@ -11,7 +11,7 @@
*
* Of course with non-bricked devices, you're free to select them before calling this function.
*/
bool MFRC522Hack::MIFARE_OpenUidBackdoor(const bool logErrors) const {
bool MFRC522Hack::MIFARE_OpenUidBackdoor(bool logErrors) {
// Magic sequence:
// > 50 00 57 CD (HALT + CRC)
// > 40 (7 bits only)
@@ -83,7 +83,7 @@ bool MFRC522Hack::MIFARE_OpenUidBackdoor(const bool logErrors) const {
* It assumes a default KEY A of 0xFFFFFFFFFFFF.
* Make sure to have selected the card before this function is called.
*/
bool MFRC522Hack::MIFARE_SetUid(const byte *newUid, const byte uidSize, const bool logErrors) const {
bool MFRC522Hack::MIFARE_SetUid(byte *newUid, byte uidSize, bool logErrors) {
// UID + BCC byte can not be larger than 16 together
if (!newUid || !uidSize || uidSize > 15) {
@@ -184,7 +184,7 @@ bool MFRC522Hack::MIFARE_SetUid(const byte *newUid, const byte uidSize, const bo
/**
* Resets entire sector 0 to zeroes, so the card can be read again by readers.
*/
bool MFRC522Hack::MIFARE_UnbrickUidSector(const bool logErrors) const {
bool MFRC522Hack::MIFARE_UnbrickUidSector(bool logErrors) {
MIFARE_OpenUidBackdoor(logErrors);
byte block0_buffer[] = {0x01, 0x02, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

View File

@@ -9,13 +9,13 @@ class MFRC522Hack {
private:
MFRC522 *const _device;
public:
MFRC522Hack(MFRC522 *const device) : _device(device) {};
MFRC522Hack(MFRC522 *device) : _device(device) {};
bool MIFARE_OpenUidBackdoor(const bool logErrors) const;
bool MIFARE_OpenUidBackdoor(bool logErrors);
bool MIFARE_SetUid(const byte *newUid, const byte uidSize, const bool logErrors) const;
bool MIFARE_SetUid(byte *newUid, byte uidSize, bool logErrors);
bool MIFARE_UnbrickUidSector(const bool logErrors) const;
bool MIFARE_UnbrickUidSector(bool logErrors);
};