add signal strength meter

This commit is contained in:
2023-10-07 13:38:17 -07:00
parent 63faf519c1
commit e5cf44c3a6
14 changed files with 414 additions and 148 deletions

View File

@@ -2,7 +2,7 @@
#define KIMODEM_PREFS_H
namespace config {
namespace Config {
// Networking
@@ -14,6 +14,11 @@ void SetStartTryConnecting(bool opt);
// Misc.
bool EnableMeter();
void SetEnableMeter(bool opt);
// Misc. control
void FactoryDefaults();
}

View File

@@ -6,29 +6,20 @@
#define ANSI_CLEAR_SCREEN "\33[2J"
/*
class Display {
public:
Display();
namespace Display {
void Clear();
void Draw();
bool HasDisplay();
void Init();
void Clear();
void Clear(bool hint);
void Draw();
bool HasDisplay();
void Print(const char *);
void Println(const char *);
void SetCursor(int16_t x, int16_t y);
} // namespace Display
void Print(const char *);
void Println(const char *);
void SetCursor(int16_t x, int16_t y);
};
*/
#if defined(ADAFRUIT_OLED)
#include "internal/DisplayAdafruitOLED.h"
#else
#include "internal/DisplayNone.h"
#endif
static Display display;
#endif

20
include/WiFiMeter.h Normal file
View File

@@ -0,0 +1,20 @@
#ifndef KIMODEM_WIFI_METER_H
#define KIMODEM_WIFI_METER_H
#include <Arduino.h>
namespace Meter {
void Begin();
void Enable();
void Disable();
void Update();
}
#endif

View File

@@ -10,6 +10,7 @@ bool SetupWiFi();
bool Autoconnect(Dictionary &pb);
bool Autoconnect(Dictionary &pb, bool reset);
bool TryConnect(Dictionary &pb);
void WiFiRefresh(Dictionary &pb);
#endif

View File

@@ -1,26 +0,0 @@
#ifndef KIMODEM_ADAFRUIT_OLED_H
#define KIMODEM_ADAFRUIT_OLED_H
#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_SSD1306.h>
class Display {
public:
Display();
void Clear();
void Draw();
bool HasDisplay();
void Print(const char *);
void Println(const char *);
void SetCursor(int16_t x, int16_t y);
private:
Adafruit_SSD1306 oled;
};
#endif

View File

@@ -1,20 +0,0 @@
#ifndef KIMODEM_DISPLAY_SERIAL
#define KIMODEM_DISPLAY_SERIAL
#include <Arduino.h>
class Display {
public:
Display() {};
void Clear();
void Draw();
bool HasDisplay();
void Print(const char *);
void Println(const char *);
void SetCursor(int16_t x, int16_t y);
};
#endif