mirror of
https://github.com/KevinMidboe/TinyGSM.git
synced 2025-10-29 18:00:18 +00:00
Check possible mux numbers
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
@@ -59,16 +59,20 @@ class TinyGsmM590 : public TinyGsmModem<TinyGsmM590>,
|
||||
public:
|
||||
GsmClientM590() {}
|
||||
|
||||
explicit GsmClientM590(TinyGsmM590& modem, uint8_t mux = 1) {
|
||||
explicit GsmClientM590(TinyGsmM590& modem, uint8_t mux = 0) {
|
||||
init(&modem, mux);
|
||||
}
|
||||
|
||||
bool init(TinyGsmM590* modem, uint8_t mux = 1) {
|
||||
bool init(TinyGsmM590* modem, uint8_t mux = 0) {
|
||||
this->at = modem;
|
||||
this->mux = mux;
|
||||
sock_connected = false;
|
||||
|
||||
at->sockets[mux] = this;
|
||||
if (mux < TINY_GSM_MUX_COUNT) {
|
||||
this->mux = mux;
|
||||
} else {
|
||||
this->mux = (mux % TINY_GSM_MUX_COUNT);
|
||||
}
|
||||
at->sockets[this->mux] = this;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user