You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: ble/README.md
+3-9
Original file line number
Diff line number
Diff line change
@@ -154,10 +154,8 @@ The `startadvertising()` method runs the following steps:
154
154
<aname="stopadvertising"></a>
155
155
##### The `stopAdvertising()` method
156
156
Requests the platform to stop sending advertisement packets. It runs the following steps:
157
-
- Return a [`Promise`](../README.md/#promise) object `promise` and continue [in parallel](https://html.spec.whatwg.org/#in-parallel).
158
157
- Request from the underlying platform to stop the current advertisement.
159
-
- If the request is unsuccessful, reject `promise` with an [`Error`](../README.md/#error) object `error` with `error.message` set to `"BluetoothStopAdvertisement"`.
160
-
- Otherwise, if the request was successful, resolve `promise`.
158
+
- If the request is unsuccessful, throw an [`Error`](../README.md/#error) object `error` with `error.message` set to `"BluetoothStopAdvertisement"`.
161
159
162
160
<aname="addservice"></a>
163
161
##### The `addService(service)` method
@@ -288,17 +286,13 @@ The `needsResponse` property is a boolean that is by default `true`.
288
286
<aname="respond"></a>
289
287
##### The `respond(data)` method
290
288
Sends a response to the request. It executes the following steps:
291
-
- Return a [`Promise`](../README.md/#promise) object `promise` and continue [in parallel](https://html.spec.whatwg.org/#in-parallel).
292
289
- Create a response to the request, and include `data` in the response.
293
290
- Request from the underlying platform to send the response to the client.
294
-
- If the request is unsuccessful, reject `promise` with an [`Error`](../README.md/#error) object `error` with `error.message` set to `"BluetoothSendResponse"`.
295
-
- Otherwise, if the request was successful, resolve `promise`.
291
+
- If the request is unsuccessful, throw an [`Error`](../README.md/#error) object `error` with `error.message` set to `"BluetoothSendResponse"`.
296
292
297
293
<aname="errormethod"></a>
298
294
##### The `error(error)` method
299
295
Sends an error response to the request. It executes the following steps:
300
-
- Return a [`Promise`](../README.md/#promise) object `promise` and continue [in parallel](https://html.spec.whatwg.org/#in-parallel).
301
296
- Create an error response to the request, and include `error` in the response.
302
297
- Request from the underlying platform to send the response to the client.
303
-
- If the request is unsuccessful, reject `promise` with an [`Error`](../README.md/#error) object `error` with `error.message` set to `"BluetoothSendErrorResponse"`.
304
-
- Otherwise, if the request was successful, resolve `promise`.
298
+
- If the request is unsuccessful, throw an [`Error`](../README.md/#error) object `error` with `error.message` set to `"BluetoothSendErrorResponse"`.
0 commit comments