typechange: byte -> PICC_Type

This commit is contained in:
Rotzbua
2015-12-05 22:32:57 +01:00
parent 36a43dbb70
commit 8016aa7c98
8 changed files with 14 additions and 14 deletions

View File

@@ -1214,7 +1214,7 @@ MFRC522::PICC_Type MFRC522::PICC_GetType(byte sak ///< The SAK byte returned fr
* *
* @return const __FlashStringHelper * * @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) { switch (piccType) {
case PICC_TYPE_ISO_14443_4: return F("PICC compliant with ISO/IEC 14443-4"); 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(); Serial.println();
// PICC type // PICC type
byte piccType = PICC_GetType(uid->sak); PICC_Type piccType = PICC_GetType(uid->sak);
Serial.print(F("PICC type: ")); Serial.print(F("PICC type: "));
Serial.println(PICC_GetTypeName(piccType)); 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. * Dumps memory contents of a MIFARE Classic PICC.
* On success the PICC is halted after dumping the data. * 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(). void MFRC522::PICC_DumpMifareClassicToSerial( Uid *uid, ///< Pointer to Uid struct returned from a successful PICC_Select().
byte piccType, ///< One of the PICC_Type enums. PICC_Type piccType, ///< One of the PICC_Type enums.
MIFARE_Key *key ///< Key A used for all sectors. MIFARE_Key *key ///< Key A used for all sectors.
) { ) {
byte no_of_sectors = 0; byte no_of_sectors = 0;
switch (piccType) { switch (piccType) {

View File

@@ -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 // 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 char *GetStatusCodeName(byte code);
const __FlashStringHelper *GetStatusCodeName(MFRC522::StatusCode 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 // 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 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_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_DumpMifareClassicSectorToSerial(Uid *uid, MIFARE_Key *key, byte sector);
void PICC_DumpMifareUltralightToSerial(); void PICC_DumpMifareUltralightToSerial();
void MIFARE_SetAccessBits(byte *accessBitBuffer, byte g0, byte g1, byte g2, byte g3); void MIFARE_SetAccessBits(byte *accessBitBuffer, byte g0, byte g1, byte g2, byte g3);

View File

@@ -91,7 +91,7 @@ void loop() {
Serial.println(); Serial.println();
// Dump PICC type // 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(F("PICC type: "));
// Serial.print(mfrc522.PICC_GetTypeName(piccType)); // Serial.print(mfrc522.PICC_GetTypeName(piccType));
// Serial.print(F(" (SAK ")); // Serial.print(F(" (SAK "));

View File

@@ -78,7 +78,7 @@ void loop() {
dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size); dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
Serial.println(); Serial.println();
Serial.print(F("PICC type: ")); 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)); Serial.println(mfrc522.PICC_GetTypeName(piccType));
// Check for compatibility // Check for compatibility

View File

@@ -77,7 +77,7 @@ void loop() {
dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size); dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
Serial.println(); Serial.println();
Serial.print(F("PICC type: ")); 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)); Serial.println(mfrc522.PICC_GetTypeName(piccType));
// Check for compatibility // Check for compatibility

View File

@@ -72,7 +72,7 @@ void loop() {
dump_byte_array(mfrc522[reader].uid.uidByte, mfrc522[reader].uid.size); dump_byte_array(mfrc522[reader].uid.uidByte, mfrc522[reader].uid.size);
Serial.println(); Serial.println();
Serial.print(F("PICC type: ")); 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)); Serial.println(mfrc522[reader].PICC_GetTypeName(piccType));
// Halt PICC // Halt PICC

View File

@@ -132,7 +132,7 @@ void loop() {
dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size); dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
Serial.println(); Serial.println();
Serial.print(F("PICC type: ")); 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)); Serial.println(mfrc522.PICC_GetTypeName(piccType));
// Try the known default keys // Try the known default keys

View File

@@ -53,7 +53,7 @@ void loop() {
Serial.print(mfrc522.uid.uidByte[i], HEX); Serial.print(mfrc522.uid.uidByte[i], HEX);
} }
Serial.print(F(" PICC type: ")); // Dump PICC type 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)); Serial.println(mfrc522.PICC_GetTypeName(piccType));
byte buffer[34]; byte buffer[34];