Modular PR1: NetMgr, HttpClient, SmsMgr with working attach/HTTP/SMS

This commit is contained in:
2025-09-02 09:20:23 +10:00
parent aba2234f53
commit aac68aa77c
8 changed files with 229 additions and 3 deletions

View File

@@ -1,9 +1,26 @@
#include "app/App.hpp"
#include "src/core/NetMgr.hpp"
#include "src/core/HttpClient.hpp"
#include "src/core/SmsMgr.hpp"
static const char* APN = "hologram";
static const char* BASE_URL = "http://laravel-server.lab.audasmedia.com.au";
static const char* PATH = "/api/gps";
void setup() {
App::instance().setup();
Serial.begin(115200);
Serial2.begin(9600, SERIAL_8N1, 16, 17); // RX=16, TX=17
NetMgr::powerOnSIM7080(4); // PWRKEY pin 4
NetMgr::attachAndPdp(APN); // LTE reg + CNACT + DNS
SmsMgr::setup(); // enable text mode + URCs
String json = "{\"device_id\":\"sim7080g-01\",\"lat\":-33.865143,"
"\"lng\":151.2099,\"speed\":12.5,\"altitude\":30.2}";
HttpClient::postJson(BASE_URL, PATH, json);
}
void loop() {
App::instance().loop();
SmsMgr::pollUrc(); // non‑blocking URC scan; handles +CMTI
SmsMgr::pollUnread(); // optional safety poll
delay(250);
}