feat: Added AT basic commands

This commit is contained in:
Darks 2020-07-05 09:38:53 +02:00
parent 9432cc9c4f
commit c8dbf58fa3
Signed by: Darks
GPG Key ID: F61F10FA138E797C
3 changed files with 24 additions and 10 deletions

View File

@ -16,15 +16,14 @@
// Fingerprint for demo URL, expires on June 2, 2021, needs to be updated well before this date
const uint8_t fingerprint[20] = {0xCF, 0xAC, 0xAE, 0x63, 0x39, 0xEA, 0x75, 0xDB, 0x28, 0xB9, 0xD9, 0x6D, 0x1B, 0xF3, 0x0F, 0xFE, 0xAF, 0x26, 0xEB, 0xE6};
ESP8266WiFiMulti WiFiMulti;
const char *VERSION = "webcalc-esp8266-0.1";
bool echo = false; // Echo command received
void setup() {
Serial.begin(115200);
// Serial.setDebugOutput(true);
Serial.println();
Serial.println();
Serial.println();
for (uint8_t t = 4; t > 0; t--) {
@ -35,6 +34,8 @@ void setup() {
WiFi.mode(WIFI_STA);
WiFiMulti.addAP("SSID", "PASSWORD");
Serial.println("ready");
}
void loop() {

View File

@ -4,21 +4,24 @@
// AT: test startup
void at() {
Serial.println("")
Serial.println("OK");
}
void at_rst() {
void(*reset)(void) = 0;
Serial.println("OK");
reset();
}
void at_gmr() {
extern char* VERSION;
Serial.println(VERSION);
}
void at_gslp() {
void at_gslp(uint32_t t) {
sleep(t);
}
void ate() {
void ate(bool e) {
extern bool echo = e;
}

10
at_basic.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef _AT_BASIC_H
#define _AT_BASIC_H
void at(); // Echo OK
void at_rst(); // Reset the module
void at_gmr(); // Print software version
void at_gslp(uint32_t t); // Sleeps x milliseconds
void ate(bool e); // Enable/disable echo
#endif