Skip to content

Commit 9b71c51

Browse files
committed
Made Debug Serial optional
1 parent 2ef4339 commit 9b71c51

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/rn2xx3.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,25 @@ extern "C" {
1919
@param serial Needs to be an already opened stream to write to and read from.
2020
*/
2121
#ifdef SoftwareSerial_h
22+
rn2xx3::rn2xx3(SoftwareSerial& serial):
23+
_serial(serial)
24+
{
25+
_serial.setTimeout(2000);
26+
}
27+
2228
rn2xx3::rn2xx3(SoftwareSerial& serial, Stream& debugSerial):
2329
_serial(serial),_debugSerial(debugSerial)
2430
{
2531
_serial.setTimeout(2000);
2632
}
2733
#endif
2834

35+
rn2xx3::rn2xx3(HardwareSerial& serial):
36+
_serial(serial)
37+
{
38+
_serial.setTimeout(2000);
39+
}
40+
2941
rn2xx3::rn2xx3(HardwareSerial& serial, Stream& debugSerial):
3042
_serial(serial),_debugSerial(debugSerial)
3143
{

src/rn2xx3.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@ class rn2xx3
3030
* A simplified constructor taking only a SoftwareSerial object.
3131
* It is assumed that LoRa WAN will be used.
3232
* The serial port should already be initialised when initialising this library.
33+
* Optional Debug Serial
3334
*/
35+
rn2xx3(SoftwareSerial& serial);
3436
rn2xx3(SoftwareSerial& serial, Stream& debugSerial);
3537
#endif
3638

3739
/*
3840
* A simplified constructor taking only a HardwareSerial object.
3941
* It is assumed that LoRa WAN will be used.
4042
* The serial port should already be initialised when initialising this library.
43+
* Optional Debug Serial
4144
*/
45+
rn2xx3(HardwareSerial& serial);
4246
rn2xx3(HardwareSerial& serial, Stream& debugSerial);
4347
/*
4448
* Transmit the correct sequence to the rn2483 to trigger its autobauding feature.

0 commit comments

Comments
 (0)