New issue
Advanced search Search tips

Issue 685646 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

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



 
glucometer-3.js
1.0 KB View Download
meter.html
1.4 KB View Download
Cc: jlebel@chromium.org
Components: Blink>Bluetooth
Status: Untriaged (was: Unconfirmed)
For future reference, here's chrome log that comes from https://groups.google.com/a/chromium.org/forum/#!topic/web-bluetooth/w8YehTBEtso

[6206:775:0125/211111:VERBOSE1:bluetooth_discovery_session.cc(45)] Stopping device discovery session.
[6206:775:0125/211111:VERBOSE1:bluetooth_low_energy_discovery_manager_mac.mm(80)] StopDiscovery
[6206:775:0125/211111:VERBOSE1:bluetooth_allowed_devices_map.cc(28)] Adding a device to Map of Allowed Devices.
[6206:775:0125/211111:VERBOSE1:bluetooth_allowed_devices_map.cc(46)] Id generated for device: kHPzcr+1gtCzkKvipYYdYQ==
[6206:775:0125/211111:VERBOSE1:web_bluetooth_service_impl.cc(783)] Device: NiproBGM
[6206:775:0125/211111:VERBOSE1:web_bluetooth_service_impl.cc(784)] UUIDs:
[6206:775:0125/211112:VERBOSE1:web_bluetooth_service_impl.cc(440)] Services not yet discovered.
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(268)] Services discovered for device: 70:50:B1:31:2F:7D
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(158)] Looking for service: 00001808-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(161)] Service in cache: b39078a0-4289-11e4-9368-0002a5d5c51b
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(161)] Service in cache: 00a215bd-9b02-4e5a-9a65-98f1095f4755
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(161)] Service in cache: 00001808-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(161)] Service in cache: 0000180a-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(746)] Services found in device.
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(139)] Looking for characteristic: 00002a18-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(143)] Characteristic in cache: 00002a51-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(143)] Characteristic in cache: 00002a34-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(143)] Characteristic in cache: 00002a52-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(143)] Characteristic in cache: 00002a18-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(139)] Looking for characteristic: 00002a52-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(143)] Characteristic in cache: 00002a51-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(143)] Characteristic in cache: 00002a34-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(143)] Characteristic in cache: 00002a52-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:web_bluetooth_service_impl.cc(143)] Characteristic in cache: 00002a18-0000-1000-8000-00805f9b34fb
[6206:775:0125/211113:VERBOSE1:bluetooth_remote_gatt_characteristic_mac.mm(311)] Bluetooth error while writing for characteristic, domain: CBErrorDomain, error code: 0
[6206:775:0125/211113:INFO:CONSOLE(22)] "[object DOMException]", source: file:///Users/cmcilvoy/Desktop/glucometer-3.js (22)
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);
}

}

Comment 3 by cmcil...@gmail.com, Jan 28 2017

Success! 

Thank you so much for your support.




Status: Fixed (was: Untriaged)

Sign in to add a comment