DS_CAP_APP_ID - denis-stepanov/esp-ds-system GitHub Wiki

DS_CAP_APP_ID — Application Identification

Description

This capability adds support for application identification. The following fields are implemented:

Field Description Default Value
const char *System::app_name Application Name My Program
const char *System::app_version Application Version 0.1
const char *System::app_build Application Build __DATE__ " " __TIME__ (e.g., Sep 22 2020 22:40:48)
const char *System::app_url Application Web Site (empty)

Requires

None.

Cooperates With

  • DS_CAP_APP_LOG && DS_CAP_SYS_TIME — if both application log and time are enabled, application identification will be logged on startup. Example:

      2020/10/10 17:08:30: Started ESP8266 DS Mailbox Automation; Local Module v1.8.1, build Sep 22 2020 22:40:48
    
  • DS_CAP_SYS_LOG_HW — if syslog is enabled, application identification will be printed on startup.

  • DS_CAP_WEBSERVER — if web server is enabled, its "System Information" page will include "Program" line with application identification.

Conflicts With

None.

Usage

MySystem.h:

#define DS_CAP_APP_ID       // Enable application identification

#include "System.h"         // System global definitions

sketch.ino:

#include "MySystem.h"

using namespace ds;

const char *System::app_name    = "Pi Calculator";
const char *System::app_version = "3.14.159";
const char *System::app_url     = "http://www.pi314.net/";

void setup() {
}

void loop() {
}

Mandatory Calls

System::begin() Not required
System::update() Not required

Examples

Bugs

  • Default build string __DATE__ " " __TIME__ will be compiled in System.o on first compilation. In absence of modifications to System.cpp or its dependencies, the file will not be recompiled. This means, if you only change your .ino, the build string will not change. The workaround to this is to set app_build from your sketch explicitly, or just restart the Arduino IDE in order to force complete recompilation of the sketch.

Availability

Version 1.0 or later.

See Also

None.

⚠️ **GitHub.com Fallback** ⚠️