Skip to content

Commit

Permalink
Merge pull request #7 from egnor/master
Browse files Browse the repository at this point in the history
replace errno, which is often a macro
  • Loading branch information
tueddy authored Jun 3, 2024
2 parents e7f0e8f + 47caf16 commit 7ba0289
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions PN5180ISO15693.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,12 +817,12 @@ bool PN5180ISO15693::setupRF() {
return true;
}

const char *PN5180ISO15693::strerror(ISO15693ErrorCode errno) {
const char *PN5180ISO15693::strerror(ISO15693ErrorCode code) {
PN5180DEBUG(("ISO15693ErrorCode="));
PN5180DEBUG(errno);
PN5180DEBUG(code);
PN5180DEBUG("\n");

switch (errno) {
switch (code) {
case EC_NO_CARD: return ("No card detected!");
case ISO15693_EC_OK: return ("OK!");
case ISO15693_EC_NOT_SUPPORTED: return ("Command is not supported!");
Expand All @@ -835,7 +835,7 @@ const char *PN5180ISO15693::strerror(ISO15693ErrorCode errno) {
case ISO15693_EC_BLOCK_NOT_PROGRAMMED: return ("Specified block was not successfully programmed!");
case ISO15693_EC_BLOCK_NOT_LOCKED: return ("Specified block was not successfully locked!");
default:
if ((errno >= 0xA0) && (errno <= 0xDF)) {
if ((code >= 0xA0) && (code <= 0xDF)) {
return ("Custom command error code!");
}
else return ("Undefined error code in ISO15693!");
Expand Down
2 changes: 1 addition & 1 deletion PN5180ISO15693.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class PN5180ISO15693 : public PN5180 {
*/
public:
bool setupRF();
const char *strerror(ISO15693ErrorCode errno);
const char *strerror(ISO15693ErrorCode code);

};

Expand Down

0 comments on commit 7ba0289

Please sign in to comment.