Added check for valid QOS (0 or 1)
This commit is contained in:
parent
359fd03f03
commit
94df17720e
@ -306,6 +306,9 @@ boolean PubSubClient::subscribe(char* topic) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean PubSubClient::subscribe(char* topic, uint8_t qos) {
|
boolean PubSubClient::subscribe(char* topic, uint8_t qos) {
|
||||||
|
if (qos < 0 || qos > 1)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (connected()) {
|
if (connected()) {
|
||||||
// Leave room in the buffer for header and variable length field
|
// Leave room in the buffer for header and variable length field
|
||||||
uint16_t length = 5;
|
uint16_t length = 5;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user