Skip to content

Commit

Permalink
Merge pull request #29 from OpenEarable/1.3.0
Browse files Browse the repository at this point in the history
filter based on device prefix
  • Loading branch information
TobiasRoeddiger authored Oct 9, 2023
2 parents 02ba79b + 700e8bb commit cc799b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion assets/js/OpenEarable.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,16 @@ class BLEManager {
this._executeNextOperation();
});
}

async connect() {
return this._enqueueOperation(async () => {
const optionalServiceUUIDs = Object.keys(SERVICES).map((service) => SERVICES[service].UUID);

this.device = await navigator.bluetooth.requestDevice({
acceptAllDevices: true,
filters: [
{ namePrefix: "OpenEarable" }
],
acceptAllDevices: false,
optionalServices: optionalServiceUUIDs
});
this.gattServer = await this.device.gatt.connect();
Expand Down
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ <h5 class="card-title">Audio Control </h5>
<option value="4">saw (4)</option>
</select>
</div>

</div>


Expand Down

0 comments on commit cc799b4

Please sign in to comment.