Browse Source

Fix build

v_master 0.1.3
Volodymyr Shymanskyy 8 years ago
parent
commit
c31c1544ce
2 changed files with 19 additions and 6 deletions
  1. +17
    -4
      extras/test_build/test_build.ino
  2. +2
    -2
      tools/SimpleTest/SimpleTest.ino

+ 17
- 4
extras/test_build/test_build.ino View File

@ -6,7 +6,8 @@
#include <TinyGsmClient.h> #include <TinyGsmClient.h>
TinyGsmClient client(Serial);
TinyGsm modem(Serial);
TinyGsmClient client(modem);
char server[] = "somewhere"; char server[] = "somewhere";
char resource[] = "something"; char resource[] = "something";
@ -14,11 +15,23 @@ char resource[] = "something";
void setup() { void setup() {
Serial.begin(115200); Serial.begin(115200);
delay(3000); delay(3000);
client.restart();
modem.restart();
} }
void loop() { void loop() {
if (!client.networkConnect("YourAPN", "", "")) {
modem.restart();
modem.begin();
modem.getOperator();
modem.getSimCCID();
modem.getSimStatus();
modem.waitForNetwork();
if (!modem.gprsConnect("YourAPN", "", "")) {
delay(10000); delay(10000);
return; return;
} }
@ -43,7 +56,7 @@ void loop() {
client.stop(); client.stop();
client.networkDisconnect();
modem.gprsDisconnect();
// Do nothing forevermore // Do nothing forevermore
while (true) { while (true) {


+ 2
- 2
tools/SimpleTest/SimpleTest.ino View File

@ -60,7 +60,7 @@ void setup() {
} }
void loop() { void loop() {
if (!modem.networkConnect(apn, user, pass)) {
if (!modem.gprsConnect(apn, user, pass)) {
delay(10000); delay(10000);
return; return;
} }
@ -92,7 +92,7 @@ void loop() {
client.stop(); client.stop();
modem.networkDisconnect();
modem.gprsDisconnect();
SerialMon.println(); SerialMon.println();
SerialMon.println("************************"); SerialMon.println("************************");


Loading…
Cancel
Save