1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 23:13:07 +01:00

QR code modifyed, insert all bus data

This commit is contained in:
Norbert Walter
2022-01-11 16:41:58 +01:00
parent 1ed55ee3f7
commit 68eb995909
4 changed files with 180 additions and 90 deletions

View File

@@ -4,7 +4,7 @@
#include <Arduino.h>
#include "qrcode.h"
void qrWiFi(){
void qrWiFi(busData values){
// Set start point and pixel size
int16_t box_x = 100; // X offset
int16_t box_y = 30; // Y offset
@@ -14,8 +14,10 @@ void qrWiFi(){
// Create the QR code
QRCode qrcode;
uint8_t qrcodeData[qrcode_getBufferSize(4)];
qrcode_initText(&qrcode, qrcodeData, 4, 0, "WIFI:S:OBP60;T:WPA;P:esp32nmea2k;;");
// Content for QR code: "WIFI:S:mySSID;T:WPA;P:myPASSWORD;;"
String text = "WIFI:S:" + String(values.systemname) + ";T:WPA;P:" + String(values.wifipass) + ";;";
const char *qrcodecontent = text.c_str();
qrcode_initText(&qrcode, qrcodeData, 4, 0, qrcodecontent);
// Top quiet zone
for (uint8_t y = 0; y < qrcode.size; y++) {
@@ -35,8 +37,12 @@ void qrWiFi(){
display.setTextColor(GxEPD_BLACK);
display.setCursor(140, 285);
display.print("WiFi");
display.updateWindow(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, true); // Partial update (fast)
// display.update(); // Full update (slow)
if(values.refresh == true){
display.update(); // Full update (slow)
}
else{
display.updateWindow(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, true); // Partial update (fast)
}
}
#endif