|
@@ -8,10 +8,11 @@ void saisiePin(char *pin);
|
|
|
void saisieTxt(char *txt);
|
|
|
void send_AT_cmd(const char *at_cmd, char *at_rep);
|
|
|
void send_sms();
|
|
|
+void read_sms();
|
|
|
void enter_pin();
|
|
|
|
|
|
// CAYE PAS BIEN ET JMEN FOUT !
|
|
|
-char rep[50];
|
|
|
+char rep[512];
|
|
|
char Operator[50];
|
|
|
//char Signal[];
|
|
|
|
|
@@ -27,10 +28,10 @@ void setup()
|
|
|
char mess_ok[50];
|
|
|
m.clearScreen();
|
|
|
m.textMode();
|
|
|
+ m.bgColor(RED);
|
|
|
m.textColor(WHITE);
|
|
|
- m.bgColor(BLACK);
|
|
|
-
|
|
|
m.text(" Smartphone Minitel V1 ", 1, 1);
|
|
|
+ m.bgColor(BLACK);
|
|
|
/**** check du pin *****/
|
|
|
send_AT_cmd("AT+CPIN?\r", rep);
|
|
|
Serial.println(rep);
|
|
@@ -59,12 +60,12 @@ void setup()
|
|
|
sprintf(Operator, "Operator : %s", token);
|
|
|
m.noBlink();
|
|
|
m.text("[*]", 2, 5);
|
|
|
- m.text(mess_ok, 5, 5);
|
|
|
- delay(2000);
|
|
|
+ m.text(mess_ok, 6, 5);
|
|
|
+// delay(2000);
|
|
|
send_AT_cmd("AT+CGREG?\r\r", rep);
|
|
|
Serial.print(rep);
|
|
|
|
|
|
- delay(1000);
|
|
|
+// delay(1000);
|
|
|
|
|
|
|
|
|
}
|
|
@@ -74,11 +75,11 @@ void loop()
|
|
|
|
|
|
m.clearScreen();
|
|
|
m.textMode();
|
|
|
- m.textColor(WHITE);
|
|
|
m.bgColor(RED);
|
|
|
- m.text(" Smartphone Minitel V1 ", 1, 1);
|
|
|
- m.text(Operator, 1, 23);
|
|
|
+ m.text(" Smartphone Minitel V1 ", 1, 1);
|
|
|
+ m.textColor(WHITE);
|
|
|
m.bgColor(BLACK);
|
|
|
+ m.text(Operator, 1, 23);
|
|
|
m.text("1 - Send SMS", 4, 5 );
|
|
|
m.text("2 - Read SMS", 4, 6 );
|
|
|
m.text("5 - Adress Book", 4, 8 );
|
|
@@ -96,6 +97,7 @@ void loop()
|
|
|
break;
|
|
|
|
|
|
case '2':
|
|
|
+ read_sms();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -162,7 +164,21 @@ void send_sms()
|
|
|
|
|
|
}
|
|
|
|
|
|
+void read_sms()
|
|
|
+{
|
|
|
+ m.clearScreen();
|
|
|
+ m.textMode();
|
|
|
+ m.textColor(WHITE);
|
|
|
+ m.bgColor(RED);
|
|
|
+ m.text(" Read SMS ", 4, 1);
|
|
|
+ m.bgColor(BLACK);
|
|
|
+
|
|
|
+ send_AT_cmd("AT+CMGL=\"ALL\"\r", rep);
|
|
|
+ Serial.println(rep);
|
|
|
+
|
|
|
+ return loop();
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
void saisieNum(char *num) {
|
|
@@ -273,6 +289,8 @@ void send_AT_cmd(const char *at_cmd, char *at_rep)
|
|
|
at_rep[strCount] = reponse;
|
|
|
strCount++;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
at_rep[strCount]='\0';
|
|
|
delay(1000);
|
|
|
}
|