BLE GATT Not supported Error when writing to notify characteristic
Reported by
cmcil...@gmail.com,
Jan 26 2017
|
||
Issue description
Chrome Version : 55.0.2883.95
OS Version: OS X 10.12.2
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari 5:
Firefox 4.x:
IE 7/8/9:
What steps will reproduce the problem?
1. Pair with BLE glucometer
2. Attempt to write to a notify characteristic
3.
What is the expected result?
Ability to read data off of bluetooth device
What happens instead of that?
VERBOSE1:bluetooth_remote_gatt_characteristic_mac.mm(311)] Bluetooth error while writing for characteristic, domain: CBErrorDomain, error code: 0
Please provide any additional information below. Attach a screenshot if
possible.
UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36
,
Jan 27 2017
I wonder if notifications need to be started as well in Glucose Measurement Context characteristic before... Do you mind trying this code below?
var glucoseCharacteristic, glucoseContextCharacteristic, racpCharacteristic;
function onButtonClick() {
navigator.bluetooth.requestDevice({filters: [{services: ['glucose']}]})
.then(device => device.gatt.connect())
.then(server => server.getPrimaryService('glucose'))
.then(service => {
return Promise.all([
service.getCharacteristic('glucose_measurement'),
service.getCharacteristic('glucose_measurement_context'),
service.getCharacteristic('record_access_control_point')
])
})
.then(characteristics => {
[glucoseCharacteristic, glucoseContextCharacteristic, racpCharacteristic] = characteristics;
})
.then(_ => glucoseCharacteristic.startNotifications())
.then(_ => glucoseCharacteristic.addEventListener('characteristicvaluechanged', handleGlucose))
.then(_ => glucoseContextCharacteristic.startNotifications())
.then(_ => glucoseContextCharacteristic.addEventListener('characteristicvaluechanged', handleGlucoseContext))
.then(_ => racpCharacteristic.startNotifications())
.then(_ => racpCharacteristic.addEventListener('characteristicvaluechanged', handleRacp))
.then(_ => racpCharacteristic.writeValue(new Uint8Array([1, 1])))
.catch(error => {
console.log(error);
});
function handleGlucose(event) {
console.log(event.target.value);
}
function handleGlucoseContext(event) {
console.log(event.target.value);
}
function handleRacp(event) {
console.log(event.target.value);
}
}
,
Jan 28 2017
Success! Thank you so much for your support.
,
Feb 1 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by fbeaufort@chromium.org
, Jan 27 2017Components: Blink>Bluetooth
Status: Untriaged (was: Unconfirmed)