diff --git a/sensor/src/constants.h b/sensor/src/constants.h index fcb6b14..acc1651 100644 --- a/sensor/src/constants.h +++ b/sensor/src/constants.h @@ -28,4 +28,6 @@ #define STATUS_BOOT 0 #define STATUS_WIFI 2 -#define STATUS_OK 1 \ No newline at end of file +#define STATUS_OK 1 +#define STATUS_WAITING_DATA 3 +#define STATUS_WAITING_PANEL 4 \ No newline at end of file diff --git a/sensor/src/sensor.ino b/sensor/src/sensor.ino index 656c0a8..e1936bc 100644 --- a/sensor/src/sensor.ino +++ b/sensor/src/sensor.ino @@ -250,6 +250,12 @@ void setPixel(uint8_t color) { case 2: pixels.setPixelColor(0, pixels.Color(0,0,255)); break; + case 3: + pixels.setPixelColor(0, pixels.Color(255,255,0)); + break; + case 4: + pixels.setPixelColor(0, pixels.Color(255,0,255)); + break; } pixels.show(); #endif @@ -468,6 +474,14 @@ void loop() { msgLength = 0; } } + else { + if(panelDetected) { + setPixel(STATUS_WAITING_DATA); + } + else { + setPixel(STATUS_WAITING_PANEL); + } + } if (panelSelect == HIGH || !panelDetected) { // Controller talking to other topside panels - we are in effect idle @@ -484,7 +498,7 @@ void loop() { telnetLoop(); - if (sendBuffer.isEmpty()) { // Only handle status is we aren't trying to send commands, webserver and websocket + if (sendBuffer.isEmpty() || !panelDetected) { // Only handle status is we aren't trying to send commands, webserver and websocket // can both block for a long time webserver.handleClient();