mirror of
https://github.com/Luzifer/espsms.git
synced 2024-12-21 02:11:21 +00:00
Apply clang-format
This commit is contained in:
parent
85deb7e285
commit
989383b00b
4 changed files with 19 additions and 32 deletions
|
@ -1,8 +1,8 @@
|
||||||
|
#include "http.hpp"
|
||||||
|
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
#include <HTTPClient.h>
|
#include <HTTPClient.h>
|
||||||
|
|
||||||
#include "http.hpp"
|
|
||||||
|
|
||||||
HTTPClient http;
|
HTTPClient http;
|
||||||
|
|
||||||
bool sendMessage(String from, String fromName, String date, String message) {
|
bool sendMessage(String from, String fromName, String date, String message) {
|
||||||
|
|
22
src/main.cpp
22
src/main.cpp
|
@ -1,8 +1,9 @@
|
||||||
|
#include "main.hpp"
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
|
|
||||||
#include "http.hpp"
|
#include "http.hpp"
|
||||||
#include "main.hpp"
|
|
||||||
#include "modem.hpp"
|
#include "modem.hpp"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "timerManager.h"
|
#include "timerManager.h"
|
||||||
|
@ -122,8 +123,6 @@ void loop() {
|
||||||
Serial.println("ERR: " + line);
|
Serial.println("ERR: " + line);
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBG: Received +CMT: "+49157***","","20/07/19,12:57:45+08"
|
|
||||||
// DBG: Received Sehr lange SMS um zu demonstrieren wie sich der Kram verh<72>lt wenn sowohl Sonderzeichen als auch viel Text in der Nachricht stecken
|
|
||||||
if (line.startsWith("+CMT: ")) {
|
if (line.startsWith("+CMT: ")) {
|
||||||
String message = readLine();
|
String message = readLine();
|
||||||
|
|
||||||
|
@ -138,7 +137,8 @@ void loop() {
|
||||||
pos = npos + 1;
|
pos = npos + 1;
|
||||||
String date = line.substring(pos);
|
String date = line.substring(pos);
|
||||||
|
|
||||||
if (!sendMessage(trimQuotes(senderNo), trimQuotes(senderName), trimQuotes(date), iso88591ToUTF8(message))) {
|
if (!sendMessage(trimQuotes(senderNo), trimQuotes(senderName),
|
||||||
|
trimQuotes(date), iso88591ToUTF8(message))) {
|
||||||
Serial.println("ERR: Unable to submit message");
|
Serial.println("ERR: Unable to submit message");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,9 +146,7 @@ void loop() {
|
||||||
TimerManager::instance().update();
|
TimerManager::instance().update();
|
||||||
}
|
}
|
||||||
|
|
||||||
String readLine() {
|
String readLine() { return readLine(0); }
|
||||||
return readLine(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
String readLine(int timeout) {
|
String readLine(int timeout) {
|
||||||
String response = "";
|
String response = "";
|
||||||
|
@ -229,13 +227,3 @@ String trimQuotes(String in) {
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateSerial() {
|
|
||||||
delay(500);
|
|
||||||
while (Serial.available()) {
|
|
||||||
SerialAT.write(Serial.read());//Forward what Serial received to Software Serial Port
|
|
||||||
}
|
|
||||||
while(SerialAT.available()) {
|
|
||||||
Serial.write(SerialAT.read());//Forward what Software Serial received to Serial Port
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -18,6 +18,5 @@ String readLine(int timeout);
|
||||||
bool sendBoolCommand(String command);
|
bool sendBoolCommand(String command);
|
||||||
String sendCommand(String command, bool readOK);
|
String sendCommand(String command, bool readOK);
|
||||||
String trimQuotes(String in);
|
String trimQuotes(String in);
|
||||||
void updateSerial();
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue