Compare commits
4 Commits
56654447d2
...
9874791ace
Author | SHA1 | Date | |
---|---|---|---|
|
9874791ace | ||
|
970544025b | ||
|
47eb7889d0 | ||
|
6f74c10140 |
@ -148,6 +148,11 @@ PowerInfo SAB::getPowerInfo(const unsigned char nbOfMeasures) const
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *SAB::getSoftVersion() const
|
||||||
|
{
|
||||||
|
return SOFT_VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned char SAB::getError() const
|
unsigned char SAB::getError() const
|
||||||
{
|
{
|
||||||
return _error;
|
return _error;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "WEBServerManager.h"
|
#include "WEBServerManager.h"
|
||||||
#include "IOManager.h"
|
#include "IOManager.h"
|
||||||
#include "TaskSchedulerManager.h"
|
#include "TaskSchedulerManager.h"
|
||||||
|
#include "versions.h"
|
||||||
#include <Adafruit_SSD1306.h>
|
#include <Adafruit_SSD1306.h>
|
||||||
#include <RTClib.h>
|
#include <RTClib.h>
|
||||||
#include <SD.h>
|
#include <SD.h>
|
||||||
@ -38,6 +39,7 @@ class SAB
|
|||||||
SDCardConfig getSdCardConfig() const;
|
SDCardConfig getSdCardConfig() const;
|
||||||
|
|
||||||
PowerInfo getPowerInfo(const unsigned char nbOfMeasures = 5) const;
|
PowerInfo getPowerInfo(const unsigned char nbOfMeasures = 5) const;
|
||||||
|
const char *getSoftVersion() const;
|
||||||
unsigned char getError() const;
|
unsigned char getError() const;
|
||||||
private:
|
private:
|
||||||
void initGPIO();
|
void initGPIO();
|
||||||
|
@ -12,7 +12,7 @@ SAB sab;
|
|||||||
|
|
||||||
unsigned long currentMs = 0, batteryMs = 0, buttonMs = 0;
|
unsigned long currentMs = 0, batteryMs = 0, buttonMs = 0;
|
||||||
volatile boolean ioStateChange(false);
|
volatile boolean ioStateChange(false);
|
||||||
View1Packet v1p = {sab.getRtcManager().getDateTime(), sab.getSdCardManager().getSize(GBYTE), sab.getPowerInfo(),0};
|
View1Packet v1p = {sab.getRtcManager().getDateTime(), sab.getSdCardManager().getSize(GBYTE), sab.getPowerInfo(),0, sab.getSoftVersion()};
|
||||||
ViewAPPacket vap = {sab.getConnectivityManager().softAPmacAddress(), sab.getConnectivityManager().softAPSSID(), sab.getConnectivityManager().softAPIP(), sab.getConnectivityManager().softAPgetStationNum()};
|
ViewAPPacket vap = {sab.getConnectivityManager().softAPmacAddress(), sab.getConnectivityManager().softAPSSID(), sab.getConnectivityManager().softAPIP(), sab.getConnectivityManager().softAPgetStationNum()};
|
||||||
ViewSTAPacket vstap = {sab.getConnectivityManager().macAddress(), sab.getConnectivityManager().localIP(), sab.getConnectivityManager().RSSI()};
|
ViewSTAPacket vstap = {sab.getConnectivityManager().macAddress(), sab.getConnectivityManager().localIP(), sab.getConnectivityManager().RSSI()};
|
||||||
ViewIoInfoPacket vio = {{0},{0}};
|
ViewIoInfoPacket vio = {{0},{0}};
|
||||||
|
12
src/app/versions.h
Normal file
12
src/app/versions.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef VERSIONS_H
|
||||||
|
#define VERSIONS_H
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Here is listed the version history of the soft with some information about them.
|
||||||
|
*
|
||||||
|
* Versioning scheme MAJOR.MINOR.PATCH
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define SOFT_VERSION "1.0.0" //First version tracking
|
||||||
|
|
||||||
|
#endif //VERSIONS_H
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
boolean view_1(Adafruit_SSD1306 &display, void *pData)
|
boolean view_1(Adafruit_SSD1306 &display, void *pData)
|
||||||
{
|
{
|
||||||
char time_str[300] = "", power_str[15] = "", sdCard[10] = "";
|
char time_str[300] = "", power_str[15] = "", sdCard[10] = "", pageTitle[22] = "";
|
||||||
View1Packet *p = (View1Packet *) pData;
|
View1Packet *p = (View1Packet *) pData;
|
||||||
|
|
||||||
switch(p->powerInfo.powerType)
|
switch(p->powerInfo.powerType)
|
||||||
@ -20,9 +20,10 @@ boolean view_1(Adafruit_SSD1306 &display, void *pData)
|
|||||||
sprintf(sdCard,"NO CARD");
|
sprintf(sdCard,"NO CARD");
|
||||||
|
|
||||||
sprintf(time_str,"Time : %d:%d:%d\nDate : %d/%d/%d\nFree RAM : %d\nSdCard : %s\nPower : %s\nViews : %u\n", p->dateTime.hour(), p->dateTime.minute(), p->dateTime.second(), p->dateTime.day(), p->dateTime.month(), p->dateTime.year(),ESP.getFreeHeap(),sdCard,power_str, p->nbViews);
|
sprintf(time_str,"Time : %d:%d:%d\nDate : %d/%d/%d\nFree RAM : %d\nSdCard : %s\nPower : %s\nViews : %u\n", p->dateTime.hour(), p->dateTime.minute(), p->dateTime.second(), p->dateTime.day(), p->dateTime.month(), p->dateTime.year(),ESP.getFreeHeap(),sdCard,power_str, p->nbViews);
|
||||||
|
sprintf(pageTitle, "GLOBAL INFO v %s",p->version);
|
||||||
display.println(time_str);
|
display.println(time_str);
|
||||||
display.setCursor(0,56);
|
display.setCursor(0,56);
|
||||||
display.println(F("GLOBAL INFO"));
|
display.println(pageTitle);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ typedef struct view1Packet
|
|||||||
float sdCardSize;
|
float sdCardSize;
|
||||||
PowerInfo powerInfo;
|
PowerInfo powerInfo;
|
||||||
unsigned char nbViews;
|
unsigned char nbViews;
|
||||||
|
const char *version;
|
||||||
} View1Packet;
|
} View1Packet;
|
||||||
|
|
||||||
//Global info
|
//Global info
|
||||||
|
Loading…
Reference in New Issue
Block a user