Browse Source

Make modem.stream public. Make user and pass optional in gprsConnect()

v_master
Volodymyr Shymanskyy 7 years ago
parent
commit
4f9182919f
6 changed files with 25 additions and 12 deletions
  1. +4
    -2
      src/TinyGsmClientA6.h
  2. +4
    -1
      src/TinyGsmClientESP8266.h
  3. +4
    -2
      src/TinyGsmClientM590.h
  4. +4
    -2
      src/TinyGsmClientSIM800.h
  5. +4
    -2
      src/TinyGsmClientU201.h
  6. +5
    -3
      src/TinyGsmClientXBee.h

+ 4
- 2
src/TinyGsmClientA6.h View File

@ -369,7 +369,7 @@ public:
/*
* GPRS functions
*/
bool gprsConnect(const char* apn, const char* user, const char* pwd) {
bool gprsConnect(const char* apn, const char* user = NULL, const char* pwd = NULL) {
gprsDisconnect();
sendAT(GF("+CGATT=1"));
@ -748,8 +748,10 @@ finish:
return waitResponse(1000, r1, r2, r3, r4, r5);
}
protected:
public:
Stream& stream;
protected:
GsmClient* sockets[TINY_GSM_MUX_COUNT];
};


+ 4
- 1
src/TinyGsmClientESP8266.h View File

@ -381,6 +381,7 @@ protected:
}
bool modemGetConnected(uint8_t mux) {
// TODO: re-check this
sendAT(GF("+CIPSTATUS="), mux);
int res1 = waitResponse(3000, GF("STATUS:"));
int res2;
@ -518,8 +519,10 @@ finish:
return waitResponse(1000, r1, r2, r3, r4, r5);
}
protected:
public:
Stream& stream;
protected:
GsmClient* sockets[TINY_GSM_MUX_COUNT];
};


+ 4
- 2
src/TinyGsmClientM590.h View File

@ -375,7 +375,7 @@ public:
/*
* GPRS functions
*/
bool gprsConnect(const char* apn, const char* user, const char* pwd) {
bool gprsConnect(const char* apn, const char* user = NULL, const char* pwd = NULL) {
gprsDisconnect();
sendAT(GF("+XISP=0"));
@ -694,8 +694,10 @@ finish:
return waitResponse(1000, r1, r2, r3, r4, r5);
}
protected:
public:
Stream& stream;
protected:
GsmClient* sockets[TINY_GSM_MUX_COUNT];
};


+ 4
- 2
src/TinyGsmClientSIM800.h View File

@ -447,7 +447,7 @@ public:
/*
* GPRS functions
*/
bool gprsConnect(const char* apn, const char* user, const char* pwd) {
bool gprsConnect(const char* apn, const char* user = NULL, const char* pwd = NULL) {
gprsDisconnect();
// Set the Bearer for the IP
@ -949,8 +949,10 @@ finish:
return waitResponse(1000, r1, r2, r3, r4, r5);
}
protected:
public:
Stream& stream;
protected:
GsmClient* sockets[TINY_GSM_MUX_COUNT];
};


+ 4
- 2
src/TinyGsmClientU201.h View File

@ -380,7 +380,7 @@ public:
/*
* GPRS functions
*/
bool gprsConnect(const char* apn, const char* user, const char* pwd) {
bool gprsConnect(const char* apn, const char* user = NULL, const char* pwd = NULL) {
gprsDisconnect();
sendAT(GF("+CGATT=1"));
@ -699,8 +699,10 @@ finish:
return waitResponse(1000, r1, r2, r3, r4, r5);
}
protected:
public:
Stream& stream;
protected:
GsmClient* sockets[TINY_GSM_MUX_COUNT];
};


+ 5
- 3
src/TinyGsmClientXBee.h View File

@ -442,7 +442,7 @@ fail:
/*
* GPRS functions
*/
bool gprsConnect(const char* apn, const char* user = "", const char* pw = "") {
bool gprsConnect(const char* apn, const char* user = NULL, const char* pwd = NULL) {
commandMode();
sendAT(GF("AN"), apn); // Set the APN
waitResponse();
@ -660,10 +660,12 @@ finish:
return waitResponse(1000, r1, r2, r3, r4, r5);
}
private:
public:
Stream& stream;
protected:
int guardTime;
XBeeType beeType;
Stream& stream;
GsmClient* sockets[TINY_GSM_MUX_COUNT];
};


Loading…
Cancel
Save