BluetoothRemoteGATTServer: maxwritewithoutresponsesizechanged event
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The maxwritewithoutresponsesizechanged event of the BluetoothRemoteGATTServer interface fires when the browser updates the known value of BluetoothRemoteGATTServer.maxWriteWithoutResponseSize for a connection. For example, this can happen when the browser learns that the connection's ATT MTU has changed.
The event does not include the new size; read the property to get the current value. On platforms that do not report MTU changes to the browser, the value may remain constant and the event may not fire.
Syntax
Use the event name in methods like addEventListener(), or set an event handler property.
js
addEventListener("maxwritewithoutresponsesizechanged", (event) => { })
onmaxwritewithoutresponsesizechanged = (event) => { }
Event type
A generic Event.
Examples
js
const server = device.gatt;
server.addEventListener("maxwritewithoutresponsesizechanged", () => {
console.log(`Maximum write payload: ${server.maxWriteWithoutResponseSize}`);
});
await server.connect();