TL; DR;Blunoボード上のWeb bluetooth API特性通知はサポートされていませんか?
私の質問は:
は完全にこの時点でのArduinoボードのようないくつかのカスタム・デバイスをサポートしていないhttps://developer.mozilla.org/en-US/docs/Web/API/BluetoothからWeb bluetoothのAPIですか?なぜなら、Blume Beetleボードに
BluetoothRemoteGATTCharacteristic.startNotifications()
を使用しようとすると、DOMException: GATT Error: Not supported.
の例外が発生したからです。startNotifications()
が完全に実装されている場合。その後、通知が機能するように設定する必要があるBlunoボードに余分な設定がありますか?ほとんどのオンラインの例から、この方法を使用する前に、デバイス上の余分な設定についての記述はありません。そして、私はnotify
の目標特性のプロパティが実行時にtrue
であることを確認しました。それはhttps://webbluetoothcg.github.io/web-bluetooth/に述べたように、この例外を持っていることの理由であってはならない。If neither of the Notify or Indicate bits are set in characteristic’s properties, reject promise with a NotSupportedError and abort these steps.
私の場合:
私は出力することができるテキストクロームにはほとんどのウェブデモを構築しようとしています私のBluno Beetle v1.0ボードから送信されました。私のボード内部
プログラムは非常に簡単です:
void setup() {
Serial.begin(115200); //initial the Serial
}
void loop() {
Serial.write("hello world");
Serial.println();
delay(500);
}
私は
// UUID using by Bluno Beetle
var RXTX_SERVICE = 0xdfb0;
var RXTX_CHARACTERISTIC = 0xdfb2;
function handleCharacteristicValueChanged(event) {
var value = event.target.value;
}
navigator.bluetooth.requestDevice({ acceptAllDevices: true, optionalServices: [RXTX_SERVICE] })
.then(device => { console.log(device); return device.gatt.connect(); })
.then(server => { return server.getPrimaryService(RXTX_SERVICE); })
.then(service => { return service.getCharacteristic(RXTX_CHARACTERISTIC); })
.then(ch => { console.log(ch);
ch.addEventListener('characteristicvaluechanged', handleCharacteristicValueChanged);
console.log('Notifications have been started.');
return ch;
})
.then(ch => { return ch.startNotifications() })
.catch(error => { console.log(error); });
すべてが非常によく行くdeveloper.mozilla.orgにからWeb bluetoothのAPIを使用しています、しかし、私はときに、この例外が発生しましたch.startNotifications()
DOMException: GATT Error: Not supported.
私が試したのiOS /アンを使用して:行を実行droid APPは同じタスクを実行し、両方のAPPはその特性の変化の通知を処理しています。だから私は私のBlunoボードがいくつかの設定で正常に動作していると仮定します。しかし、私はこれを克服するために私にとって有益なWebのBluetooth APIを見つけることができません。
助けていただけたら幸いです!ありがとう。