Skip to content

Commit

Permalink
feat: add config mode without params
Browse files Browse the repository at this point in the history
  • Loading branch information
DeimosHall committed Aug 9, 2023
1 parent 3714204 commit bae1fdc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
6 changes: 4 additions & 2 deletions examples/NDEFSend/NDEFSend.ino
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ void setup() {
;
}

if (nfc.configMode(mode)) {
Serial.println("The Configure Mode failed!!");
nfc.setEmulationMode();

if (nfc.configMode()) {
Serial.println("The Configure Mode failed!");
while (1)
;
}
Expand Down
7 changes: 6 additions & 1 deletion src/Electroniccats_PN7150.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,12 @@ uint8_t Electroniccats_PN7150::configMode(uint8_t modeSE) {
return SUCCESS;
}

// Deprecated, use configMode() instead
uint8_t Electroniccats_PN7150::configMode() {
int mode = Electroniccats_PN7150::getMode();
return Electroniccats_PN7150::configMode(mode);
}

// Deprecated, use configMode(void) instead
uint8_t Electroniccats_PN7150::ConfigMode(uint8_t modeSE) {
return Electroniccats_PN7150::configMode(modeSE);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Electroniccats_PN7150.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ class Electroniccats_PN7150 : public Mode {
int getFirmwareVersion();
int GetFwVersion(); // Deprecated, use getFirmwareVersion() instead
uint8_t configMode(uint8_t modeSE);
uint8_t ConfigMode(uint8_t modeSE); // Deprecated, use configMode() instead
uint8_t configMode(void);
uint8_t ConfigMode(uint8_t modeSE); // Deprecated, use configMode(void) instead
bool configureSettings(void);
bool ConfigureSettings(void); // Deprecated, use configureSettings(void) instead
bool configureSettings(uint8_t *nfcuid, uint8_t uidlen);
Expand Down
4 changes: 3 additions & 1 deletion src/Mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ class Mode {
private:
int _mode;

protected:
bool setMode(int mode);

public:
Mode();
Mode_t mode;
bool setMode(int mode);
void setReaderWriterMode();
void setEmulationMode();
void setP2PMode();
Expand Down

0 comments on commit bae1fdc

Please sign in to comment.