Skip to content

Commit 43d3f1b

Browse files
committed
Report actual versionString in FSEQ ping
Use the runtime versionString for sys["version"] instead of the hardcoded "4.0" and parse versionString to derive the ping packet's major/minor version fields. The code strips any suffix after a '-' and extracts major/minor from the X.Y form, falling back to 0 if not present, so discovery packets and system info reflect the actual firmware version.
1 parent b2ed744 commit 43d3f1b

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

usermods/FSEQ/usermod_fpp.h

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class UsermodFPP : public Usermod {
232232
sys["hostname"] = devName;
233233
sys["id"] = WiFi.macAddress();
234234
sys["ip"] = WiFi.localIP().toString();
235-
sys["version"] = "4.0";
235+
sys["version"] = versionString;
236236
sys["hardwareType"] = "ESPixelStick";
237237
sys["type"] = 195;
238238
sys["num_chan"] = strip.getLength() * 3;
@@ -273,10 +273,23 @@ void sendPingPacket(IPAddress destination = IPAddress(255, 255, 255, 255)) {
273273
// --------------------------------------------------
274274
// Version (MSB first!)
275275
// --------------------------------------------------
276-
uint16_t versionMajor = 16;
276+
uint16_t versionMajor = 0;
277277
uint16_t versionMinor = 0;
278278

279-
buf[10] = (versionMajor >> 8) & 0xFF; // MSB first!
279+
String ver = versionString;
280+
281+
int dashPos = ver.indexOf('-');
282+
if (dashPos > 0) {
283+
ver = ver.substring(0, dashPos);
284+
}
285+
286+
int dotPos = ver.indexOf('.');
287+
if (dotPos > 0) {
288+
versionMajor = ver.substring(0, dotPos).toInt();
289+
versionMinor = ver.substring(dotPos + 1).toInt();
290+
}
291+
292+
buf[10] = (versionMajor >> 8) & 0xFF;
280293
buf[11] = versionMajor & 0xFF;
281294
buf[12] = (versionMinor >> 8) & 0xFF;
282295
buf[13] = versionMinor & 0xFF;

0 commit comments

Comments
 (0)