Skip to content

Commit 8016aa7

Browse files
committed
typechange: byte -> PICC_Type
1 parent 36a43db commit 8016aa7

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

MFRC522.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ MFRC522::PICC_Type MFRC522::PICC_GetType(byte sak ///< The SAK byte returned fr
12141214
*
12151215
* @return const __FlashStringHelper *
12161216
*/
1217-
const __FlashStringHelper *MFRC522::PICC_GetTypeName(byte piccType ///< One of the PICC_Type enums.
1217+
const __FlashStringHelper *MFRC522::PICC_GetTypeName(PICC_Type piccType ///< One of the PICC_Type enums.
12181218
) {
12191219
switch (piccType) {
12201220
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
12521252
Serial.println();
12531253

12541254
// PICC type
1255-
byte piccType = PICC_GetType(uid->sak);
1255+
PICC_Type piccType = PICC_GetType(uid->sak);
12561256
Serial.print(F("PICC type: "));
12571257
Serial.println(PICC_GetTypeName(piccType));
12581258

@@ -1293,9 +1293,9 @@ void MFRC522::PICC_DumpToSerial(Uid *uid ///< Pointer to Uid struct returned fro
12931293
* Dumps memory contents of a MIFARE Classic PICC.
12941294
* On success the PICC is halted after dumping the data.
12951295
*/
1296-
void MFRC522::PICC_DumpMifareClassicToSerial( Uid *uid, ///< Pointer to Uid struct returned from a successful PICC_Select().
1297-
byte piccType, ///< One of the PICC_Type enums.
1298-
MIFARE_Key *key ///< Key A used for all sectors.
1296+
void MFRC522::PICC_DumpMifareClassicToSerial( Uid *uid, ///< Pointer to Uid struct returned from a successful PICC_Select().
1297+
PICC_Type piccType, ///< One of the PICC_Type enums.
1298+
MIFARE_Key *key ///< Key A used for all sectors.
12991299
) {
13001300
byte no_of_sectors = 0;
13011301
switch (piccType) {

MFRC522.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,12 @@ class MFRC522 {
380380
// old function used too much memory, now name moved to flash; if you need char, copy from flash to memory
381381
//const char *GetStatusCodeName(byte code);
382382
const __FlashStringHelper *GetStatusCodeName(MFRC522::StatusCode code);
383-
MFRC522::PICC_Type PICC_GetType(byte sak);
383+
PICC_Type PICC_GetType(byte sak);
384384
// old function used too much memory, now name moved to flash; if you need char, copy from flash to memory
385385
//const char *PICC_GetTypeName(byte type);
386-
const __FlashStringHelper *PICC_GetTypeName(byte type);
386+
const __FlashStringHelper *PICC_GetTypeName(PICC_Type type);
387387
void PICC_DumpToSerial(Uid *uid);
388-
void PICC_DumpMifareClassicToSerial(Uid *uid, byte piccType, MIFARE_Key *key);
388+
void PICC_DumpMifareClassicToSerial(Uid *uid, PICC_Type piccType, MIFARE_Key *key);
389389
void PICC_DumpMifareClassicSectorToSerial(Uid *uid, MIFARE_Key *key, byte sector);
390390
void PICC_DumpMifareUltralightToSerial();
391391
void MIFARE_SetAccessBits(byte *accessBitBuffer, byte g0, byte g1, byte g2, byte g3);

examples/ChangeUID/ChangeUID.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void loop() {
9191
Serial.println();
9292

9393
// Dump PICC type
94-
// byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
94+
// MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
9595
// Serial.print(F("PICC type: "));
9696
// Serial.print(mfrc522.PICC_GetTypeName(piccType));
9797
// Serial.print(F(" (SAK "));

examples/MifareClassicValueBlock/MifareClassicValueBlock.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void loop() {
7878
dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
7979
Serial.println();
8080
Serial.print(F("PICC type: "));
81-
byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
81+
MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
8282
Serial.println(mfrc522.PICC_GetTypeName(piccType));
8383

8484
// Check for compatibility

examples/ReadAndWrite/ReadAndWrite.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void loop() {
7777
dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
7878
Serial.println();
7979
Serial.print(F("PICC type: "));
80-
byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
80+
MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
8181
Serial.println(mfrc522.PICC_GetTypeName(piccType));
8282

8383
// Check for compatibility

examples/ReadUidMultiReader/ReadUidMultiReader.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void loop() {
7272
dump_byte_array(mfrc522[reader].uid.uidByte, mfrc522[reader].uid.size);
7373
Serial.println();
7474
Serial.print(F("PICC type: "));
75-
byte piccType = mfrc522[reader].PICC_GetType(mfrc522[reader].uid.sak);
75+
MFRC522::PICC_Type piccType = mfrc522[reader].PICC_GetType(mfrc522[reader].uid.sak);
7676
Serial.println(mfrc522[reader].PICC_GetTypeName(piccType));
7777

7878
// Halt PICC

examples/rfid_default_keys/rfid_default_keys.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void loop() {
132132
dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
133133
Serial.println();
134134
Serial.print(F("PICC type: "));
135-
byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
135+
MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
136136
Serial.println(mfrc522.PICC_GetTypeName(piccType));
137137

138138
// Try the known default keys

examples/rfid_write_personal_data/rfid_write_personal_data.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void loop() {
5353
Serial.print(mfrc522.uid.uidByte[i], HEX);
5454
}
5555
Serial.print(F(" PICC type: ")); // Dump PICC type
56-
byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
56+
MFRC522::PICC_Type piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
5757
Serial.println(mfrc522.PICC_GetTypeName(piccType));
5858

5959
byte buffer[34];

0 commit comments

Comments
 (0)