feat(rk3588s): unify display state semantics and bump version to 1.4.5
This commit is contained in:
@@ -36,19 +36,19 @@ class StatusLed {
|
||||
|
||||
class Display {
|
||||
showAP() {
|
||||
if (writeLvglCommand('show_text:AP')) {
|
||||
log.info('display', '显示屏 → AP');
|
||||
if (writeLvglCommand('show_ap')) {
|
||||
log.info('display', '显示屏 → AP(闪烁)');
|
||||
}
|
||||
}
|
||||
|
||||
showConn() {
|
||||
if (writeLvglCommand('show_text:Conn')) {
|
||||
log.info('display', '显示屏 → Conn');
|
||||
if (writeLvglCommand('show_conn')) {
|
||||
log.info('display', '显示屏 → Conn(闪烁)');
|
||||
}
|
||||
}
|
||||
|
||||
showErr0() {
|
||||
if (writeLvglCommand('show_text:Err0')) {
|
||||
if (writeLvglCommand('show_err0')) {
|
||||
log.info('display', '显示屏 → Err0');
|
||||
}
|
||||
}
|
||||
@@ -61,8 +61,8 @@ class Display {
|
||||
|
||||
showPin(pin) {
|
||||
const s = String(pin || '').padStart(4, '0').slice(-4);
|
||||
if (writeLvglCommand(`show_text:${s}`)) {
|
||||
log.info('display', `显示屏 → PIN: ${s}`);
|
||||
if (writeLvglCommand(`show_pin:${s}`)) {
|
||||
log.info('display', `显示屏 → PIN: ${s}(闪烁)`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,6 @@ class ProvisionManager extends EventEmitter {
|
||||
if (this._state === 'ap') return;
|
||||
|
||||
led.off(); // AP 模式:WiFi 未连接,WiFi 灯熄灭
|
||||
if (!hasInternet()) led.display.showAP(); // 无网时立即显示 AP,有线时等 WS 连接后再定
|
||||
|
||||
try {
|
||||
// 若上次进程退出前留下 clawd-hotspot,必须先释放 wlan0;否则会在 AP 模式下扫描,列表可能只剩 2.4G/自身热点。
|
||||
@@ -149,6 +148,7 @@ class ProvisionManager extends EventEmitter {
|
||||
this._server.startListening();
|
||||
|
||||
this._state = 'ap';
|
||||
led.display.showAP();
|
||||
this._apStartedAt = Date.now();
|
||||
this._lastApSavedWifiRetryAt = 0;
|
||||
log.info('provision', `AP 常驻模式已启动: ${ap.ssid}, 密码 12345678`);
|
||||
|
||||
Binary file not shown.
@@ -142,7 +142,6 @@ static void apply_show_text_async(void *arg)
|
||||
{
|
||||
const char *text = (const char *)arg;
|
||||
show_custom_text = true;
|
||||
custom_text_blink = false;
|
||||
custom_text_visible = true;
|
||||
lv_label_set_text(custom_text_label, text ? text : "");
|
||||
lv_obj_align(custom_text_label, LV_ALIGN_CENTER, 0, -25);
|
||||
@@ -201,14 +200,28 @@ static void *fifo_thread(void *arg)
|
||||
line[--len] = '\0';
|
||||
}
|
||||
|
||||
if (strncmp(line, "show_text:", 10) == 0) {
|
||||
if (strcmp(line, "show_ap") == 0) {
|
||||
lv_async_call(apply_show_ap_async, NULL);
|
||||
} else if (strcmp(line, "show_conn") == 0) {
|
||||
strncpy(custom_text_buf, "Conn", sizeof(custom_text_buf) - 1);
|
||||
custom_text_buf[sizeof(custom_text_buf) - 1] = '\0';
|
||||
custom_text_blink = true;
|
||||
lv_async_call(apply_show_text_async, custom_text_buf);
|
||||
} else if (strcmp(line, "show_err0") == 0) {
|
||||
strncpy(custom_text_buf, "Err0", sizeof(custom_text_buf) - 1);
|
||||
custom_text_buf[sizeof(custom_text_buf) - 1] = '\0';
|
||||
custom_text_blink = false;
|
||||
lv_async_call(apply_show_text_async, custom_text_buf);
|
||||
} else if (strncmp(line, "show_pin:", 9) == 0) {
|
||||
strncpy(custom_text_buf, line + 9, sizeof(custom_text_buf) - 1);
|
||||
custom_text_buf[sizeof(custom_text_buf) - 1] = '\0';
|
||||
custom_text_blink = true;
|
||||
lv_async_call(apply_show_text_async, custom_text_buf);
|
||||
} else if (strncmp(line, "show_text:", 10) == 0) {
|
||||
strncpy(custom_text_buf, line + 10, sizeof(custom_text_buf) - 1);
|
||||
custom_text_buf[sizeof(custom_text_buf) - 1] = '\0';
|
||||
if (strcmp(custom_text_buf, "AP") == 0) {
|
||||
lv_async_call(apply_show_ap_async, NULL);
|
||||
} else {
|
||||
custom_text_blink = false;
|
||||
lv_async_call(apply_show_text_async, custom_text_buf);
|
||||
}
|
||||
} else if (strcmp(line, "show_time") == 0) {
|
||||
lv_async_call(apply_show_time_async, NULL);
|
||||
}
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "clawd",
|
||||
"version": "1.4.4",
|
||||
"version": "1.4.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "clawd",
|
||||
"version": "1.4.4",
|
||||
"version": "1.4.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ssh2": "^1.17.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "clawd",
|
||||
"version": "1.4.4",
|
||||
"version": "1.4.5",
|
||||
"description": "Claw Box daemon - connects local Linux box to claw.cutos.ai via WebSocket",
|
||||
"main": "lib/client.js",
|
||||
"bin": {
|
||||
|
||||
Reference in New Issue
Block a user