What program is in my Photon? Is the filename uploaded to it?

@OdorDecoder, I use a Particle.variable to report some details on what is running on a given device:

// This strips the path from the filename
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)

char gDeviceInfo[120];  //adjust size as required


void setup() {

	Particle.variable("deviceInfo",gDeviceInfo);

	snprintf(gDeviceInfo, sizeof(gDeviceInfo)
          ,"App: %s, Date: %s, Time: %s, Sysver: %s
          ,__FILENAME__
          ,__DATE__
          ,__TIME__
          ,(const char*)System.version()  // cast required for String
          );
...
}

This produces, for example, the following string when the variable is queried:
App: MarcoPolo.ino, Date: Dec 14 2018, Time: 17:38:07, Sysver: 0.8.0-rc.26

The Date and Time are the compile date and time.

5 Likes