Skip to content

Commit

Permalink
Merge pull request #1268 from dotintent/fix/1150
Browse files Browse the repository at this point in the history
fix: return serviceUUIDs from discoverAllServicesAndCharacteristicsFo…
  • Loading branch information
aliberski authored Jan 21, 2025
2 parents d6196f0 + 2f5a54b commit c34253a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/BleManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,15 @@ export class BleManager {
const nativeDevice = await this._callPromise(
BleModule.discoverAllServicesAndCharacteristicsForDevice(deviceIdentifier, transactionId)
)
return new Device(nativeDevice, this)
const services = await this._callPromise(BleModule.servicesForDevice(deviceIdentifier))
const serviceUUIDs = services.map(service => service.uuid)

// $FlowFixMe
const device = {
...nativeDevice,
serviceUUIDs
}
return new Device(device, this)
}

// Mark: Service and characteristic getters --------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/BleModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface NativeDevice {
rawScanRecord: Base64;

/**
* Map od service UUIDs with associated data.
* Map of service UUIDs with associated data.
* @private
*/
serviceData: ?{ [uuid: UUID]: Base64 };
Expand Down

0 comments on commit c34253a

Please sign in to comment.