Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 55cb7e6

Browse files
committed
BLE: remove some Promises
Signed-off-by: Zoltan Kis <[email protected]>
1 parent f8d1253 commit 55cb7e6

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

Diff for: ble/README.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,8 @@ The `startadvertising()` method runs the following steps:
154154
<a name="stopadvertising"></a>
155155
##### The `stopAdvertising()` method
156156
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).
158157
- 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"`.
161159

162160
<a name="addservice"></a>
163161
##### The `addService(service)` method
@@ -288,17 +286,13 @@ The `needsResponse` property is a boolean that is by default `true`.
288286
<a name="respond"></a>
289287
##### The `respond(data)` method
290288
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).
292289
- Create a response to the request, and include `data` in the response.
293290
- 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"`.
296292

297293
<a name="errormethod"></a>
298294
##### The `error(error)` method
299295
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).
301296
- Create an error response to the request, and include `error` in the response.
302297
- 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"`.

Diff for: ble/webidl.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface BluetoothPeripheralDevice {
1919

2020
Promise<AdvertisingOptions> startAdvertising(Advertisement advertisement,
2121
optional AdvertisingOptions options);
22-
Promise stopAdvertising();
22+
void stopAdvertising(); // Promise?
2323

2424
readonly attribute boolean enabled;
2525
attribute EventHandler onenabledchange;
@@ -125,8 +125,8 @@ interface Request {
125125
readonly attribute Buffer? data = null;
126126
readonly attribute boolean needsResponse;
127127

128-
Promise respond(optional Buffer data);
129-
Promise respondWithError(Error error);
128+
void respond(optional Buffer data); // Promise?
129+
void respondWithError(Error error); // Promise?
130130
};
131131

132132
enum RequestType { "read", "write", "notify", "subscribe", "unsubscribe"};

Diff for: board/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ If the functionality is not supported by the platform, `require` should throw `N
3737

3838
<a name="board"></a>
3939
### The `Board` interface
40-
Represents a hardware circuit board such as Arduino 101.
40+
Represents a hardware circuit board such as Arduino 101.
4141

4242
| Property | Type | Optional | Default value | Represents |
4343
| --- | --- | --- | --- | --- |

0 commit comments

Comments
 (0)