Skip to content

Commit

Permalink
14拿到安全协商
Browse files Browse the repository at this point in the history
  • Loading branch information
xianengqi committed Dec 24, 2024
1 parent 4e62e46 commit 527492f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions demo-esp32/BlufiManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,19 @@ extension BlufiManager: BlufiDelegate {
}
}

func blufi(_ client: BlufiClient!, didNegotiateSecurity status: BlufiStatusCode) {
print("【DEBUG】安全协商结果: \(status)")
if status == StatusSuccess {
print("安全协商成功")
// 可以在这里开始配置 WiFi
// 例如:
// configureWiFi(ssid: "YourSSID", password: "YourPassword")
} else {
print("安全协商失败")
onError?("安全协商失败")
}
}

func blufi(_ client: BlufiClient!, gattNotification data: Data!, packageType: UInt8, subType: UInt8) -> Bool {
print("收到GATT通知: packageType=\(packageType), subType=\(subType)")
// 返回 false 让 BlufiClient 继续处理数据
Expand Down

0 comments on commit 527492f

Please sign in to comment.