@@ -19,10 +19,14 @@ static unsigned char OFFLINE_BITS[] = {
1919 0xE6 , 0x00 , 0xFE , 0x1F , 0xFE , 0x1F , 0xE6 , 0x00 , 0x62 , 0x00 ,
2020 0x30 , 0x00 , 0x10 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
2121};
22- // {
23- // 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x60, 0x00, 0x62, 0x00, 0xE2, 0x00,
24- // 0xFE, 0x1F, 0xFE, 0x1F, 0xE2, 0x00, 0x62, 0x00, 0x60, 0x00, 0x30, 0x00,
25- // 0x00, 0x00, 0x00, 0x00, };
22+
23+ static unsigned char BLUETOOTH_BITS[] = {
24+ 0x00 , 0x02 , 0x00 , 0x00 , 0x06 , 0x00 , 0x00 , 0x0e , 0x00 , 0x00 , 0x1e , 0x00 , 0x00 , 0x3a , 0x00 , 0x60 ,
25+ 0x72 , 0x00 , 0xe0 , 0x72 , 0x00 , 0xc0 , 0x3b , 0x00 , 0x80 , 0x1f , 0x00 , 0x00 , 0x0f , 0x00 , 0x00 , 0x0f ,
26+ 0x00 , 0x80 , 0x1f , 0x00 , 0xc0 , 0x3b , 0x00 , 0xe0 , 0x72 , 0x00 , 0x60 , 0x72 , 0x00 , 0x00 , 0x3a , 0x00 ,
27+ 0x00 , 0x1e , 0x00 , 0x00 , 0x0e , 0x00 , 0x00 , 0x06 , 0x00 , 0x00 , 0x02 , 0x00
28+ };
29+
2630/* *
2731 * @brief Show dashboard temperature and humdity
2832 *
@@ -270,6 +274,28 @@ void OledDisplay::setText(const char *line1, const char *line2,
270274 }
271275}
272276
277+ void OledDisplay::showWiFiProvisioning (bool firstRun, int countdown) {
278+ if (firstRun) {
279+ DISP ()->clearBuffer ();
280+ DISP ()->setFont (u8g2_font_t0_16_tf);
281+ DISP ()->drawStr (1 , 25 , " to WiFi hotspot:" );
282+ DISP ()->drawStr (1 , 40 , " \" airgradient-" );
283+ DISP ()->drawStr (1 , 55 , (ag->deviceId () + " \" " ).c_str ());
284+ DISP ()->drawXBM (108 , 44 , 20 , 20 , BLUETOOTH_BITS);
285+ DISP ()->sendBuffer ();
286+ }
287+
288+ // Now just update countdown area
289+ char buf[16 ];
290+ snprintf (buf, sizeof (buf), " %ds to connect" , countdown);
291+ DISP ()->setDrawColor (0 ); // erase previous text
292+ DISP ()->drawBox (0 , 0 , 128 , 16 ); // clear top region
293+ DISP ()->setDrawColor (1 ); // draw new text in white
294+ DISP ()->setFont (u8g2_font_t0_16_tf);
295+ DISP ()->drawStr (1 , 10 , buf);
296+ DISP ()->sendBuffer ();
297+ }
298+
273299/* *
274300 * @brief Update dashboard content
275301 *
0 commit comments