Search code examples
javascriptbluetooth-lowenergybluetooth-gattweb-bluetooth

create advertise data packet with web Bluetooth API with JavaScript


how can I create an advertiser with web Bluetooth API? now I am only able to scan nearby Bluetooth devices.

but how can I make my laptop a peripheral device that advertises data to another Bluetooth device to establish a connection? with(web BLE API)


Solution

  • The specification of Web Bluetooth is very clear about it:

    The first version of this specification allows web pages, running on a UA in the Central role, to connect to GATT Servers over either a BR/EDR or LE connection.

    The answer is: you can't.

    There is a specification issue for Advertisement /Beacon Broadcast Support.

    And, a Chromium Issue 1043409: Bluetooth Advertiser which you can Star to follow.