From 6efdc2771dad25864c6b9617655a514451582ae6 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Wed, 29 Oct 2025 22:57:35 +0000 Subject: [PATCH] Simply added an ID to the device --- src/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 9de9f3d..b7d6ef3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,6 +25,9 @@ to have more ways to run analytics // #include // #include +#define ESLABS_DEVICE_ID 0x01 +#define ESLABS_DEVICE_NAME "ESLabs CDashDisplay" + #define UART1_TX 19 #define UART1_RX 18 @@ -80,8 +83,9 @@ typedef uint8_t PacketType; const uint8_t IdentificationPacket = 0; // eventually try this out with __attrubute__((packed)) -struct FlarePacket { +struct __attribute__((packed)) FlarePacket { char StartMarker; + uint8_t DeviceID; PacketType PktType; char deviceName[32]; char EndMarker; @@ -97,9 +101,9 @@ void sendHello() { FlarePacket flare; initFlarePacket(&flare); - const char devName[] = "ESLabs CDashDisplay"; + flare.DeviceID = ESLABS_DEVICE_ID; flare.PktType = IdentificationPacket; - strncpy(flare.deviceName, devName, strlen(devName)); + strncpy(flare.deviceName, ESLABS_DEVICE_NAME, strlen(ESLABS_DEVICE_NAME)); Serial.write((uint8_t*)&flare, sizeof(flare)); Serial.flush();