Skip to content

Commit

Permalink
Merge pull request #89 from OnFreund/master
Browse files Browse the repository at this point in the history
Support a stream for serial
  • Loading branch information
ladyada authored Oct 15, 2020
2 parents 72f17ac + 6804167 commit 9beed22
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Adafruit_Fingerprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,27 @@ Adafruit_Fingerprint::Adafruit_Fingerprint(HardwareSerial *hs,
mySerial = hwSerial;
}

/**************************************************************************/
/*!
@brief Instantiates sensor with a stream for Serial
@param serial Pointer to a Stream object
@param password 32-bit integer password (default is 0)
*/
/**************************************************************************/

Adafruit_Fingerprint::Adafruit_Fingerprint(Stream *serial, uint32_t password) {

thePassword = password;
theAddress = 0xFFFFFFFF;

hwSerial = NULL;
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
swSerial = NULL;
#endif
mySerial = serial;
}

/**************************************************************************/
/*!
@brief Initializes serial interface and baud rate
Expand Down
1 change: 1 addition & 0 deletions Adafruit_Fingerprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class Adafruit_Fingerprint {
Adafruit_Fingerprint(SoftwareSerial *ss, uint32_t password = 0x0);
#endif
Adafruit_Fingerprint(HardwareSerial *hs, uint32_t password = 0x0);
Adafruit_Fingerprint(Stream *serial, uint32_t password = 0x0);

void begin(uint32_t baud);

Expand Down

0 comments on commit 9beed22

Please sign in to comment.