Skip to content

Commit

Permalink
Fix connectedDevices documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cierpliwy committed Apr 6, 2018
1 parent 4f4c755 commit a023f08
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
14 changes: 8 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2564,8 +2564,9 @@ <h3 class='fl m0' id='blemanager'>



<p>Returns a list of the peripherals (containing any of the specified services) currently connected to the system.
Make sure that services are actually discovered for specified device before calling this function.</p>
<p>Returns a list of the peripherals (containing any of the specified services) currently connected to the system
which have discovered services. Returned devices <strong>may not be connected</strong> to your application. Make sure to check
if that's the case with function <a href="#blemanagerisdeviceconnected">isDeviceConnected</a>.</p>


<div class='pre p1 fill-light mt0'>connectedDevices(serviceUUIDs: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&#x3C;<a href="#uuid">UUID</a>>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&#x3C;<a href="#device">Device</a>>></div>
Expand All @@ -2586,7 +2587,7 @@ <h3 class='fl m0' id='blemanager'>
<div class='space-bottom0'>
<div>
<span class='code bold'>serviceUUIDs</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&#x3C;<a href="#uuid">UUID</a>>)</code>
List of service UUIDs. Device must contain as list one of them to be listed.
List of service UUIDs. Device must contain at least one of them to be listed.

</div>

Expand Down Expand Up @@ -13291,7 +13292,8 @@ <h3 class='fl m0' id='connecteddevices'>
</div>


<p>Returns a list of the peripherals (containing any of the specified services) currently connected to the system.</p>
<p>Returns a list of the peripherals (containing any of the specified services) currently connected to the system
which have discovered services. Returned devices <strong>may not be connected</strong> to your application.</p>


<div class='pre p1 fill-light mt0'>connectedDevices</div>
Expand All @@ -13311,8 +13313,8 @@ <h3 class='fl m0' id='connecteddevices'>

<div class='space-bottom0'>
<div>
<span class='code bold'>deviceIdentifiers</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&#x3C;<a href="#deviceid">DeviceId</a>>)</code>
List of device identifiers
<span class='code bold'>serviceUUIDs</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&#x3C;<a href="#uuid">UUID</a>>)</code>
List of service UUIDs. Device must contain at least one of them to be listed.

</div>

Expand Down
7 changes: 4 additions & 3 deletions src/BleManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,10 @@ export class BleManager {
}

/**
* Returns a list of the peripherals (containing any of the specified services) currently connected to the system.
* Make sure that services are actually discovered for specified device before calling this function.
* @param {Array<UUID>} serviceUUIDs List of service UUIDs. Device must contain as list one of them to be listed.
* Returns a list of the peripherals (containing any of the specified services) currently connected to the system
* which have discovered services. Returned devices **may not be connected** to your application. Make sure to check
* if that's the case with function {@link #blemanagerisdeviceconnected|isDeviceConnected}.
* @param {Array<UUID>} serviceUUIDs List of service UUIDs. Device must contain at least one of them to be listed.
*/
async connectedDevices(serviceUUIDs: Array<UUID>): Promise<Array<Device>> {
const nativeDevices = await this._callPromise(BleModule.connectedDevices(serviceUUIDs))
Expand Down
5 changes: 3 additions & 2 deletions src/BleModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,9 @@ export interface BleModuleInterface {
devices(deviceIdentifiers: Array<DeviceId>): Promise<Array<NativeDevice>>;

/**
* Returns a list of the peripherals (containing any of the specified services) currently connected to the system.
* @param {Array<DeviceId>} deviceIdentifiers List of device identifiers
* Returns a list of the peripherals (containing any of the specified services) currently connected to the system
* which have discovered services. Returned devices **may not be connected** to your application.
* @param {Array<UUID>} serviceUUIDs List of service UUIDs. Device must contain at least one of them to be listed.
*/
connectedDevices(serviceUUIDs: Array<UUID>): Promise<Array<NativeDevice>>;

Expand Down

0 comments on commit a023f08

Please sign in to comment.