feat(launcher, NETMGR_DESIGN §12): 设置页 WiFi/蓝牙子页迁 netmgr IPC + WiFi 新网络录入 UI
- wifi_page/bt_page 查询/操作改走 netmgrd IPC(netmgr_ipc.c 客户端: socket /usr/data/meow_net.sock,HELLO 鉴权 → WIFI_CTL/BT_CTL → RESULT)。 - WiFi 新网络录入:扫描结果点选 →(加密网络)SDK IME 输密码 → connect → 结果反馈 → 刷新已存网络;开放网络直连;当前连接详情含断开。 - 双轨过渡:netmgrd 不可达(NETMGR_UNREACH)回退 net.c 直连 wpa_cli/hciconfig (保功能),页面显示「网络管理服务未运行(直连模式)」降级占位(不崩)。 - BT 仅迁 on/off/status/paired(netmgrd BT_CTL 无连接/配对子命令,其余直连)。 - net.c net_wifi_scan 补 sec 字段(wifi_page.c 补 meow_net_t.sec)。 - 测试:+test_netmgr_ipc.c(假 socket 帧:扫描渲染/连接成功失败两态/降级占位)。
This commit is contained in:
1 parent
cd4e2c247f
commit
3b6a73ac10
8 files changed
+922
-54
No files matched your search
@@ -53,12 +53,12 @@ static int bt_top_sw(void *ctx, int *on)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 顶栏开关切换:写设置 + hciconfig up/down + 触发扫描 + 同步状态栏 */
|
||||
/* 顶栏开关切换:写设置 + on/off(netmgr IPC,回退直连 hciconfig)+ 触发扫描 + 同步状态栏 */
|
||||
static void bt_top_sw_set(void *ctx, int on)
|
||||
{
|
||||
(void)ctx;
|
||||
meow_settings_set_bool("network.bluetooth_enabled", on);
|
||||
s_net_toggle_bt(on);
|
||||
nm_bt_onoff(on);
|
||||
g_sys.bt_on = on;
|
||||
bt_role_refresh(1);
|
||||
paint_sb_right();
|
||||
@@ -73,10 +73,12 @@ static int bt_rows(void *ctx, sub_row_t *rbuf, int max)
|
||||
{
|
||||
bt_ctx_t *c = ctx;
|
||||
int full = c->full; c->full = 0; /* 消费一次全量标记 */
|
||||
c->bt_on = hci_powered();
|
||||
c->bt_on = nm_bt_powered(); /* IPC status;回退直连 hci_powered() */
|
||||
if (full || c->conn_n < 0) { /* 首次/动作后:全量重扫 conn/paired */
|
||||
/* conn 列表 netmgrd 无子命令(BT_CTL=status/on/off/paired),保持直连 bluetoothctl;
|
||||
* paired 走 IPC(权威),回退直连。 */
|
||||
c->conn_n = net_bt_connected(c->conn, S_NET_MAX);
|
||||
c->paired_n = net_bt_paired(c->paired, S_NET_MAX);
|
||||
c->paired_n = nm_bt_paired(c->paired, S_NET_MAX);
|
||||
if (c->conn_n < 0) c->conn_n = 0;
|
||||
if (c->paired_n < 0) c->paired_n = 0;
|
||||
}
|
||||
@@ -86,6 +88,11 @@ static int bt_rows(void *ctx, sub_row_t *rbuf, int max)
|
||||
net_bt_mode_str(c->mode, sizeof c->mode);
|
||||
|
||||
int n = 0;
|
||||
/* 降级占位:netmgrd 不可达 → 提示(直连仍在跑,保功能) */
|
||||
if (!netmgr_ok() && n < max) {
|
||||
rbuf[n].kind = SUB_HDR; rbuf[n].label = "网络管理服务未运行(直连模式)";
|
||||
rbuf[n].sub = NULL; rbuf[n].on = 0; rbuf[n].act = 0; n++;
|
||||
}
|
||||
/* 已连接设备 */
|
||||
if (n < max) { rbuf[n].kind = SUB_HDR; rbuf[n].label = "已连接设备"; rbuf[n].sub = NULL; rbuf[n].on = 0; rbuf[n].act = 0; n++; }
|
||||
if (c->conn_n == 0) {
|
||||
|
||||
Reference in new issue
Block a user