Compare commits

...

4 Commits

Author SHA1 Message Date
anschrammh
9874791ace minor changes 2019-08-19 13:55:00 +02:00
anschrammh
970544025b Added the current soft version on the display 2019-08-19 13:54:39 +02:00
anschrammh
47eb7889d0 Added getSoftVersion method to get the current software version 2019-08-19 13:53:57 +02:00
anschrammh
6f74c10140 Added versions.h file to track software versions 2019-08-19 13:53:09 +02:00
6 changed files with 24 additions and 3 deletions

View File

@ -148,6 +148,11 @@ PowerInfo SAB::getPowerInfo(const unsigned char nbOfMeasures) const
return p;
}
const char *SAB::getSoftVersion() const
{
return SOFT_VERSION;
}
unsigned char SAB::getError() const
{
return _error;

View File

@ -10,6 +10,7 @@
#include "WEBServerManager.h"
#include "IOManager.h"
#include "TaskSchedulerManager.h"
#include "versions.h"
#include <Adafruit_SSD1306.h>
#include <RTClib.h>
#include <SD.h>
@ -38,6 +39,7 @@ class SAB
SDCardConfig getSdCardConfig() const;
PowerInfo getPowerInfo(const unsigned char nbOfMeasures = 5) const;
const char *getSoftVersion() const;
unsigned char getError() const;
private:
void initGPIO();

View File

@ -12,7 +12,7 @@ SAB sab;
unsigned long currentMs = 0, batteryMs = 0, buttonMs = 0;
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()};
ViewSTAPacket vstap = {sab.getConnectivityManager().macAddress(), sab.getConnectivityManager().localIP(), sab.getConnectivityManager().RSSI()};
ViewIoInfoPacket vio = {{0},{0}};

12
src/app/versions.h Normal file
View 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

View File

@ -2,7 +2,7 @@
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;
switch(p->powerInfo.powerType)
@ -20,9 +20,10 @@ boolean view_1(Adafruit_SSD1306 &display, void *pData)
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(pageTitle, "GLOBAL INFO v %s",p->version);
display.println(time_str);
display.setCursor(0,56);
display.println(F("GLOBAL INFO"));
display.println(pageTitle);
return true;
}

View File

@ -9,6 +9,7 @@ typedef struct view1Packet
float sdCardSize;
PowerInfo powerInfo;
unsigned char nbViews;
const char *version;
} View1Packet;
//Global info