diff --git a/platformio.ini b/platformio.ini index f949eb7..cd07950 100644 --- a/platformio.ini +++ b/platformio.ini @@ -39,6 +39,8 @@ extra_scripts = post:post.py lib_ldf_mode = chain+ monitor_speed = 115200 +build_flags = + -D PIO_ENV_BUILD=$PIOENV [env:m5stack-atom] board = m5stack-atom diff --git a/src/main.cpp b/src/main.cpp index f66d556..d35bb77 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -87,7 +87,11 @@ const unsigned long HEAP_REPORT_TIME=2000; //set to 0 to disable heap reporting #define MAX_NMEA2000_MESSAGE_SEASMART_SIZE 500 #define MAX_NMEA0183_MESSAGE_SIZE 150 // For AIS +#ifndef FIRMWARE_TYPE +#define FIRMWARE_TYPE PIO_ENV_BUILD +#endif +String firmwareType(GWSTRINGIFY(FIRMWARE_TYPE)); typedef std::map StringMap; @@ -474,6 +478,7 @@ protected: char buffer[bsize]; toHex(base,buffer,bsize); status["salt"] = buffer; + status["fwtype"]= firmwareType; //nmea0183Converter->toJson(status); countNMEA2KIn.toJson(status); countNMEA2KOut.toJson(status); diff --git a/web/index.html b/web/index.html index a9bad2c..571dde1 100644 --- a/web/index.html +++ b/web/index.html @@ -76,6 +76,10 @@