Skip to content

Commit b9fcfed

Browse files
authored
Merge pull request #98 from sebromero/downlink-port-getter
Add getter for downlink port
2 parents 3a101d3 + 0646df1 commit b9fcfed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/MKRWAN.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ class LoRaModem : public Stream
288288
String fw_version;
289289
unsigned long lastPollTime;
290290
unsigned long pollInterval;
291+
uint8_t downlinkPort; // Valid values are between 1 and 223
291292
int mask_size;
292293
uint16_t channelsMask[6];
293294
String channel_mask_str;
@@ -728,6 +729,10 @@ class LoRaModem : public Stream
728729
return true;
729730
}
730731

732+
uint8_t getDownlinkPort(){
733+
return downlinkPort;
734+
}
735+
731736
bool publicNetwork(bool publicNetwork) {
732737
sendAT(GF("+NWK="), publicNetwork);
733738
if (waitResponse() != 1) {
@@ -1106,7 +1111,7 @@ class LoRaModem : public Stream
11061111
goto finish;
11071112
} else if (data.endsWith("+RECV=")) {
11081113
data = "";
1109-
stream.readStringUntil(',').toInt();
1114+
downlinkPort = stream.readStringUntil(',').toInt();
11101115
length = stream.readStringUntil('\r').toInt();
11111116
streamSkipUntil('\n');
11121117
streamSkipUntil('\n');

0 commit comments

Comments
 (0)