From 8016aa7c98327ce6fa0ed69e1a3d2850313888f4 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Sat, 5 Dec 2015 22:32:57 +0100 Subject: [PATCH] typechange: byte -> PICC_Type --- MFRC522.cpp | 10 +++++----- MFRC522.h | 6 +++--- examples/ChangeUID/ChangeUID.ino | 2 +- .../MifareClassicValueBlock.ino | 2 +- examples/ReadAndWrite/ReadAndWrite.ino | 2 +- examples/ReadUidMultiReader/ReadUidMultiReader.ino | 2 +- examples/rfid_default_keys/rfid_default_keys.ino | 2 +- .../rfid_write_personal_data.ino | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/MFRC522.cpp b/MFRC522.cpp index e7c91a2..63d13b8 100644 --- a/MFRC522.cpp +++ b/MFRC522.cpp @@ -1214,7 +1214,7 @@ MFRC522::PICC_Type MFRC522::PICC_GetType(byte sak ///< The SAK byte returned fr * * @return const __FlashStringHelper * */ -const __FlashStringHelper *MFRC522::PICC_GetTypeName(byte piccType ///< One of the PICC_Type enums. +const __FlashStringHelper *MFRC522::PICC_GetTypeName(PICC_Type piccType ///< One of the PICC_Type enums. ) { switch (piccType) { case PICC_TYPE_ISO_14443_4: return F("PICC compliant with ISO/IEC 14443-4"); @@ -1252,7 +1252,7 @@ void MFRC522::PICC_DumpToSerial(Uid *uid ///< Pointer to Uid struct returned fro Serial.println(); // PICC type - byte piccType = PICC_GetType(uid->sak); + PICC_Type piccType = PICC_GetType(uid->sak); Serial.print(F("PICC type: ")); Serial.println(PICC_GetTypeName(piccType)); @@ -1293,9 +1293,9 @@ void MFRC522::PICC_DumpToSerial(Uid *uid ///< Pointer to Uid struct returned fro * Dumps memory contents of a MIFARE Classic PICC. * On success the PICC is halted after dumping the data. */ -void MFRC522::PICC_DumpMifareClassicToSerial( Uid *uid, ///< Pointer to Uid struct returned from a successful PICC_Select(). - byte piccType, ///< One of the PICC_Type enums. - MIFARE_Key *key ///< Key A used for all sectors. +void MFRC522::PICC_DumpMifareClassicToSerial( Uid *uid, ///< Pointer to Uid struct returned from a successful PICC_Select(). + PICC_Type piccType, ///< One of the PICC_Type enums. + MIFARE_Key *key ///< Key A used for all sectors. ) { byte no_of_sectors = 0; switch (piccType) { diff --git a/MFRC522.h b/MFRC522.h index bbe1963..081c19e 100644 --- a/MFRC522.h +++ b/MFRC522.h @@ -380,12 +380,12 @@ public: // old function used too much memory, now name moved to flash; if you need char, copy from flash to memory //const char *GetStatusCodeName(byte code); const __FlashStringHelper *GetStatusCodeName(MFRC522::StatusCode code); - MFRC522::PICC_Type PICC_GetType(byte sak); + PICC_Type PICC_GetType(byte sak); // old function used too much memory, now name moved to flash; if you need char, copy from flash to memory //const char *PICC_GetTypeName(byte type); - const __FlashStringHelper *PICC_GetTypeName(byte type); + const __FlashStringHelper *PICC_GetTypeName(PICC_Type type); void PICC_DumpToSerial(Uid *uid); - void PICC_DumpMifareClassicToSerial(Uid *uid, byte piccType, MIFARE_Key *key); + void PICC_DumpMifareClassicToSerial(Uid *uid, PICC_Type piccType, MIFARE_Key *key); void PICC_DumpMifareClassicSectorToSerial(Uid *uid, MIFARE_Key *key, byte sector); void PICC_DumpMifareUltralightToSerial(); void MIFARE_SetAccessBits(byte *accessBitBuffer, byte g0, byte g1, byte g2, byte g3); diff --git a/examples/ChangeUID/ChangeUID.ino b/examples/ChangeUID/ChangeUID.ino index 556ec7e..c04ee87 100644 --- a/examples/ChangeUID/ChangeUID.ino +++ b/examples/ChangeUID/ChangeUID.ino @@ -91,7 +91,7 @@ void loop() { Serial.println(); // Dump PICC type -// byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); +// MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); // Serial.print(F("PICC type: ")); // Serial.print(mfrc522.PICC_GetTypeName(piccType)); // Serial.print(F(" (SAK ")); diff --git a/examples/MifareClassicValueBlock/MifareClassicValueBlock.ino b/examples/MifareClassicValueBlock/MifareClassicValueBlock.ino index 53b6e51..6d18cb5 100644 --- a/examples/MifareClassicValueBlock/MifareClassicValueBlock.ino +++ b/examples/MifareClassicValueBlock/MifareClassicValueBlock.ino @@ -78,7 +78,7 @@ void loop() { dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size); Serial.println(); Serial.print(F("PICC type: ")); - byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); + MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); Serial.println(mfrc522.PICC_GetTypeName(piccType)); // Check for compatibility diff --git a/examples/ReadAndWrite/ReadAndWrite.ino b/examples/ReadAndWrite/ReadAndWrite.ino index 5d9e896..a8eefa5 100644 --- a/examples/ReadAndWrite/ReadAndWrite.ino +++ b/examples/ReadAndWrite/ReadAndWrite.ino @@ -77,7 +77,7 @@ void loop() { dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size); Serial.println(); Serial.print(F("PICC type: ")); - byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); + MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); Serial.println(mfrc522.PICC_GetTypeName(piccType)); // Check for compatibility diff --git a/examples/ReadUidMultiReader/ReadUidMultiReader.ino b/examples/ReadUidMultiReader/ReadUidMultiReader.ino index 1c40be1..e81d657 100644 --- a/examples/ReadUidMultiReader/ReadUidMultiReader.ino +++ b/examples/ReadUidMultiReader/ReadUidMultiReader.ino @@ -72,7 +72,7 @@ void loop() { dump_byte_array(mfrc522[reader].uid.uidByte, mfrc522[reader].uid.size); Serial.println(); Serial.print(F("PICC type: ")); - byte piccType = mfrc522[reader].PICC_GetType(mfrc522[reader].uid.sak); + MFRC522::PICC_Type piccType = mfrc522[reader].PICC_GetType(mfrc522[reader].uid.sak); Serial.println(mfrc522[reader].PICC_GetTypeName(piccType)); // Halt PICC diff --git a/examples/rfid_default_keys/rfid_default_keys.ino b/examples/rfid_default_keys/rfid_default_keys.ino index 32fb6c5..f8a221c 100644 --- a/examples/rfid_default_keys/rfid_default_keys.ino +++ b/examples/rfid_default_keys/rfid_default_keys.ino @@ -132,7 +132,7 @@ void loop() { dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size); Serial.println(); Serial.print(F("PICC type: ")); - byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); + MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); Serial.println(mfrc522.PICC_GetTypeName(piccType)); // Try the known default keys diff --git a/examples/rfid_write_personal_data/rfid_write_personal_data.ino b/examples/rfid_write_personal_data/rfid_write_personal_data.ino index ffbec07..aea8310 100644 --- a/examples/rfid_write_personal_data/rfid_write_personal_data.ino +++ b/examples/rfid_write_personal_data/rfid_write_personal_data.ino @@ -53,7 +53,7 @@ void loop() { Serial.print(mfrc522.uid.uidByte[i], HEX); } Serial.print(F(" PICC type: ")); // Dump PICC type - byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); + MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak); Serial.println(mfrc522.PICC_GetTypeName(piccType)); byte buffer[34];