1 #include <MutilaDebug.h> 3 #include "GfxNetInfo.h" 4 #include "GfxTextBox.h" 5 #include "GfxSignalStrength.h" 6 #include "CbOledDisplay.h" 7 #include "CheeseboardConfig.h" 9 GfxNetInfo::GfxNetInfo(String newSsid, int8_t newChannel, uint8_t newSignal) :
17 GfxNetInfo::~GfxNetInfo()
21 GfxNetInfo::GfxNetInfo(
const GfxNetInfo& other)
24 _channel = other._channel;
25 _signal = other._signal;
26 _lastSeenMs = other._lastSeenMs;
32 _channel = other._channel;
33 _signal = other._signal;
34 _lastSeenMs = other._lastSeenMs;
44 gfxSig.setSignal(signal());
46 gfxSig.
draw(xOffset, yOffset);
47 gfxSeen.
draw(xOffset+gfxSig.
width(), yOffset);
48 gfxSsid.draw(xOffset+gfxSig.
width()+gfxSeen.
width(), yOffset);
53 return CBOLED_MESSAGE_FONT_HEIGHT + (2*CBOLED_MESSAGE_FONT_VSEP);
83 uint32_t ago = (Millis() - _lastSeenMs) / 1000;
86 s += String(ago/3600);
88 }
else if (ago >= 60) {
100 _channel = newChannel;
102 _lastSeenMs = Millis();
105 bool GfxNetInfo::operator==(
const GfxNetInfo& other)
107 return _ssid == other._ssid;
void draw(uint16_t xOffset=0, uint16_t yOffset=0)
virtual uint16_t width()=0
int8_t channel()
get the channel
void update(int8_t newChannel, uint8_t newSignal)
Updates the ephemeral details for this ssid.
uint8_t signal()
get the last signal strength
uint32_t lastSeenMs()
get last seen ms
String lastSeen()
get last seen in human readable form
String ssid()
get the ssid
void draw(uint16_t xOffset=0, uint16_t yOffset=0)
void draw(uint16_t xOffset=0, uint16_t yOffset=0)