W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
根據(jù)指定的外圍設(shè)備 UUID 及其服務(wù) UUID 獲取該外圍設(shè)備的所有特征(Characteristic)
discoverCharacteristics({params}, callback(ret, err))
serviceUUID
peripheralUUID:
ret:
{
status: true , //布爾類型;是否獲取成功,true|false
characteristics:[{ //數(shù)組類型;獲取的所有特征信息的集合
uuid: '', //字符串類型;特征的 UUID
serviceUUID: '', //字符串類型;服務(wù)的 UUID
permissions: '', //字符串類型;特征的權(quán)限,取值范圍如下:
//readable:
//writeable:
//readEncryptionRequired:
//writeEncryptionRequired:
properties: '' //字符串類型;特征的屬性,取值范圍如下:
//broadcast:
//read:
//writeWithoutResponse:
//write:
//notify:
//indicate:
//authenticatedSignedWrites:
//extendedProperties:
//notifyEncryptionRequired:
//indicateEncryptionRequired:
}]
}
err:
{
code: 1 //數(shù)字類型;連接失敗時返回錯誤碼,取值范圍如下:
//-1:未知錯誤
//1:peripheralUUID 為空
//2:serviceUUID 為空
//3:未找到指定服務(wù)(service)
//4:尚未搜索到該藍(lán)牙設(shè)備
}
var ble = api.require('ble');
ble.discoverCharacteristics({
serviceUUID:'',
peripheralUUID: ''
}, function(ret) {
if (ret) {
api.alert({ msg: JSON.stringify(ret) });
}
});
iOS系統(tǒng),Android系統(tǒng)
可提供的1.0.0及更高版本
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: