English | 简体中文
Notepad SDK示例
- 扫描设备
let notepadConnector = NotepadConnector()
notepadConnector.scanDelegate = MyScanDelegate()
notepadConnector.startScan()
// ...
notepadConnector.stopScan()
class MyScanDelegate : NotepadScanDelegate {
func didChange(state: Bool) {
print("Bluetooth enabled: \(state)")
}
func didDiscover(notepadScanResult: NotepadScanResult) {
print("didDiscover:notepadScanResult \(notepadScanResult)")
}
}
用NotepadConnector#connect
的authToken
绑定设备
notepadClient.claimAuth(complete: {
print("claimAuth complete")
}) {
print("claimAuth error \($0.description)")
}
// ..
notepadClient.claimAuth(complete: {
print("disclaimAuth complete")
}) {
print("disclaimAuth error \($0.description)")
}