Show BT icon on countdown

This commit is contained in:
samuelbles07
2025-11-10 15:59:35 +07:00
parent f1110905ca
commit 38bcf4c05e
3 changed files with 34 additions and 10 deletions

View File

@@ -19,10 +19,14 @@ static unsigned char OFFLINE_BITS[] = {
0xE6, 0x00, 0xFE, 0x1F, 0xFE, 0x1F, 0xE6, 0x00, 0x62, 0x00,
0x30, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
};
// {
// 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x60, 0x00, 0x62, 0x00, 0xE2, 0x00,
// 0xFE, 0x1F, 0xFE, 0x1F, 0xE2, 0x00, 0x62, 0x00, 0x60, 0x00, 0x30, 0x00,
// 0x00, 0x00, 0x00, 0x00, };
static unsigned char BLUETOOTH_BITS[] = {
0x00, 0x02, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x3a, 0x00, 0x60,
0x72, 0x00, 0xe0, 0x72, 0x00, 0xc0, 0x3b, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f,
0x00, 0x80, 0x1f, 0x00, 0xc0, 0x3b, 0x00, 0xe0, 0x72, 0x00, 0x60, 0x72, 0x00, 0x00, 0x3a, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x06, 0x00, 0x00, 0x02, 0x00
};
/**
* @brief Show dashboard temperature and humdity
*
@@ -270,6 +274,28 @@ void OledDisplay::setText(const char *line1, const char *line2,
}
}
void OledDisplay::showWiFiProvisioning(bool firstRun, int countdown) {
if (firstRun) {
DISP()->clearBuffer();
DISP()->setFont(u8g2_font_t0_16_tf);
DISP()->drawStr(1, 25, "to WiFi hotspot:");
DISP()->drawStr(1, 40, "\"airgradient-");
DISP()->drawStr(1, 55, (ag->deviceId() + "\"").c_str());
DISP()->drawXBM(108, 44, 20, 20, BLUETOOTH_BITS);
DISP()->sendBuffer();
}
// Now just update countdown area
char buf[16];
snprintf(buf, sizeof(buf), "%ds to connect", countdown);
DISP()->setDrawColor(0); // erase previous text
DISP()->drawBox(0, 0, 128, 16); // clear top region
DISP()->setDrawColor(1); // draw new text in white
DISP()->setFont(u8g2_font_t0_16_tf);
DISP()->drawStr(1, 10, buf);
DISP()->sendBuffer();
}
/**
* @brief Update dashboard content
*