Skip to content

Web bluetooth can't subscribe/notify to characteristics #25

@agrath

Description

@agrath

Starting zwack to announce a RSC service, and connecting to the service and attempting to subscribe to the notify of the measurement charactersitic fails with a GATT unknown error in Chrome.

See: https://stackoverflow.com/questions/65290098/ble-browser-api-startnotifications-returns-gatt-error-not-supported/79344297#79344297 (with my answer)

image

Ultimately, the root cause is upstream in abandonware@bleno https://github.com/abandonware/bleno/blob/master/lib/hci-socket/gatt.js#L208 where the 2902 characteristic descriptor is added automatically if the characteristic is marked as notify.

I have created an issue there abandonware/bleno#51, and a PR abandonware/bleno#52

However, in Zwack, these descriptors are also declared manually on the service/characteristic, for example: https://github.com/paixaop/zwack/blob/master/lib/rsc/rsc-measurement-characteristic.js#L22
This results in a duplicate 2902 descriptor 'on the air' which causes Chrome to be unable to subscribe.

PR incoming

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions