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
@@ -312,6 +312,22 @@ int net_wifi_scan(meow_net_t *out, int max)
|
||||
while (*se && *se != '\n' && *se != '\r') se++;
|
||||
while (se > ssid && (se[-1] == ' ' || se[-1] == '\t')) se--;
|
||||
int has = (se > ssid && *ssid);
|
||||
/* M6.0:flags 首个方括号内容 = 安全类型([WPA-PSK-CCMP] 等);纯 [ESS]/[IBSS] = 开放。
|
||||
* 供「WiFi 新网络录入」判断是否需要弹 IME 输密码。 */
|
||||
char sec[16] = "Open";
|
||||
if (br) {
|
||||
char *be = strchr(br + 1, ']');
|
||||
if (be) {
|
||||
int sl = (int)(be - (br + 1));
|
||||
if (sl > 15) sl = 15;
|
||||
if (sl > 0) {
|
||||
memcpy(sec, br + 1, (size_t)sl); sec[sl] = 0;
|
||||
if (!strstr(sec, "WPA") && !strstr(sec, "RSN") && !strstr(sec, "WEP") &&
|
||||
!strstr(sec, "SAE") && !strstr(sec, "EAP"))
|
||||
snprintf(sec, sizeof sec, "Open");
|
||||
}
|
||||
}
|
||||
}
|
||||
/* 去重:同一 BSSID 只留一条,优先具名 SSID */
|
||||
int idx = -1;
|
||||
for (int j = 0; j < n; j++) if (!strcmp(seen_bssid[j], bssid)) { idx = j; break; }
|
||||
@@ -323,6 +339,7 @@ int net_wifi_scan(meow_net_t *out, int max)
|
||||
named[idx] = has;
|
||||
out[idx].id = -1;
|
||||
snprintf(out[idx].mac, sizeof out[idx].mac, "%s", bssid); /* 保留 BSSID 供详情展示 */
|
||||
snprintf(out[idx].sec, sizeof out[idx].sec, "%s", sec);
|
||||
if (has) {
|
||||
/* M2.41:扫描结果 SSID 也可能是 wpa_cli 的 \xNN 转义(中文),还原成真 UTF-8 */
|
||||
char raw[96];
|
||||
|
||||
Reference in new issue
Block a user