Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
vshymanskyy committed Dec 8, 2016
1 parent 96e5feb commit c31c154
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
21 changes: 17 additions & 4 deletions extras/test_build/test_build.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,32 @@

#include <TinyGsmClient.h>

TinyGsmClient client(Serial);
TinyGsm modem(Serial);
TinyGsmClient client(modem);

char server[] = "somewhere";
char resource[] = "something";

void setup() {
Serial.begin(115200);
delay(3000);
client.restart();
modem.restart();
}

void loop() {
if (!client.networkConnect("YourAPN", "", "")) {
modem.restart();

modem.begin();

modem.getOperator();

modem.getSimCCID();

modem.getSimStatus();

modem.waitForNetwork();

if (!modem.gprsConnect("YourAPN", "", "")) {
delay(10000);
return;
}
Expand All @@ -43,7 +56,7 @@ void loop() {

client.stop();

client.networkDisconnect();
modem.gprsDisconnect();

// Do nothing forevermore
while (true) {
Expand Down
4 changes: 2 additions & 2 deletions tools/SimpleTest/SimpleTest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void setup() {
}

void loop() {
if (!modem.networkConnect(apn, user, pass)) {
if (!modem.gprsConnect(apn, user, pass)) {
delay(10000);
return;
}
Expand Down Expand Up @@ -92,7 +92,7 @@ void loop() {

client.stop();

modem.networkDisconnect();
modem.gprsDisconnect();

SerialMon.println();
SerialMon.println("************************");
Expand Down

0 comments on commit c31c154

Please sign in to comment.