Skip to content

Commit

Permalink
Merge pull request #1274 from dotintent/release/3.5.0
Browse files Browse the repository at this point in the history
chore: update changelog 3.5.0
  • Loading branch information
aliberski authored Feb 27, 2025
2 parents 4d6bc3e + 76553d0 commit ad219c7
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 38 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [3.5.0] - 2025-02-07

### Changed

- upgraded react native to 0.77.0
- added `subscriptionType` param to monitor characteristic methods ( [#1266](https://github.com/dotintent/react-native-ble-plx/issues/1266))

### Fixed

- return `serviceUUIDs` from `discoverAllServicesAndCharacteristicsForDevice` ([#1150](https://github.com/dotintent/react-native-ble-plx/issues/1150))

## [3.4.0] - 2024-12-20

### Changed
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ PODS:
- React-jsiexecutor
- React-RCTFBReactNativeSpec
- ReactCommon/turbomodule/core
- react-native-ble-plx (3.4.0):
- react-native-ble-plx (3.5.0):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1917,7 +1917,7 @@ SPEC CHECKSUMS:
React-logger: 9a0c4e1e41cd640ac49d69aacadab783f7e0096b
React-Mapbuffer: 6993c785c22a170c02489bc78ed207814cbd700f
React-microtasksnativemodule: 19230cd0933df6f6dc1336c9a9edc382d62638ae
react-native-ble-plx: f633f4cbdccb13cfebba990ec98dd2a908577e99
react-native-ble-plx: a9a719a39e5f286b2ea787698ffe3209e263c20a
react-native-safe-area-context: 6b85173d2cee963d5232ac2fd260e8ebd63273dc
React-nativeconfig: cd0fbb40987a9658c24dab5812c14e5522a64929
React-NativeModulesApple: 45187d13c68d47250a7416b18ff082c7cc07bff7
Expand Down Expand Up @@ -1955,4 +1955,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 1f6b8dae8c618b21f01439456de8661dd328d9b9

COCOAPODS: 1.14.3
COCOAPODS: 1.15.2
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-ble-plx",
"version": "3.4.0",
"version": "3.5.0",
"packageManager": "yarn@1.22.22",
"description": "React Native Bluetooth Low Energy library",
"main": "src/index",
Expand Down
31 changes: 13 additions & 18 deletions src/BleManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type {
ConnectionOptions,
BleManagerOptions
} from './TypeDefinition'
import { isIOS } from './Utils'
import { Platform } from 'react-native'

const enableDisableDeprecatedMessage =
Expand Down Expand Up @@ -963,14 +964,11 @@ export class BleManager {
subscriptionType: ?CharacteristicSubscriptionType
): Subscription {
const filledTransactionId = transactionId || this._nextUniqueID()
const commonArgs = [deviceIdentifier, serviceUUID, characteristicUUID, filledTransactionId]
const args = isIOS ? commonArgs : [...commonArgs, subscriptionType]

return this._handleMonitorCharacteristic(
BleModule.monitorCharacteristicForDevice(
deviceIdentifier,
serviceUUID,
characteristicUUID,
filledTransactionId,
subscriptionType
),
BleModule.monitorCharacteristicForDevice(...args),
filledTransactionId,
listener
)
Expand All @@ -997,13 +995,11 @@ export class BleManager {
subscriptionType: ?CharacteristicSubscriptionType
): Subscription {
const filledTransactionId = transactionId || this._nextUniqueID()
const commonArgs = [serviceIdentifier, characteristicUUID, filledTransactionId]
const args = isIOS ? commonArgs : [...commonArgs, subscriptionType]

return this._handleMonitorCharacteristic(
BleModule.monitorCharacteristicForService(
serviceIdentifier,
characteristicUUID,
filledTransactionId,
subscriptionType
),
BleModule.monitorCharacteristicForService(...args),
filledTransactionId,
listener
)
Expand All @@ -1029,11 +1025,10 @@ export class BleManager {
subscriptionType: ?CharacteristicSubscriptionType
): Subscription {
const filledTransactionId = transactionId || this._nextUniqueID()
return this._handleMonitorCharacteristic(
BleModule.monitorCharacteristic(characteristicIdentifier, filledTransactionId, subscriptionType),
filledTransactionId,
listener
)
const commonArgs = [characteristicIdentifier, filledTransactionId]
const args = isIOS ? commonArgs : [...commonArgs, subscriptionType]

return this._handleMonitorCharacteristic(BleModule.monitorCharacteristic(...args), filledTransactionId, listener)
}

/**
Expand Down
5 changes: 4 additions & 1 deletion src/Characteristic.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {
Base64,
Subscription
} from './TypeDefinition'
import { isIOS } from './Utils'

/**
* Characteristic object.
Expand Down Expand Up @@ -147,7 +148,9 @@ export class Characteristic implements NativeCharacteristic {
transactionId: ?TransactionId,
subscriptionType: ?CharacteristicSubscriptionType
): Subscription {
return this._manager._monitorCharacteristic(this.id, listener, transactionId, subscriptionType)
const commonArgs = [this.id, listener, transactionId]
const args = isIOS ? commonArgs : [...commonArgs, subscriptionType]
return this._manager._monitorCharacteristic(...args)
}

/**
Expand Down
13 changes: 5 additions & 8 deletions src/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type {
CharacteristicSubscriptionType,
ConnectionOptions
} from './TypeDefinition'
import { isIOS } from './Utils'

/**
* Device instance which can be retrieved only by calling
Expand Down Expand Up @@ -317,14 +318,10 @@ export class Device implements NativeDevice {
transactionId: ?TransactionId,
subscriptionType?: CharacteristicSubscriptionType
): Subscription {
return this._manager.monitorCharacteristicForDevice(
this.id,
serviceUUID,
characteristicUUID,
listener,
transactionId,
subscriptionType
)
const commonArgs = [this.id, serviceUUID, characteristicUUID, listener, transactionId]
const args = isIOS ? commonArgs : [...commonArgs, subscriptionType]

return this._manager.monitorCharacteristicForDevice(...args)
}

/**
Expand Down
12 changes: 5 additions & 7 deletions src/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
TransactionId,
CharacteristicSubscriptionType
} from './TypeDefinition'
import { isIOS } from './Utils'

/**
* Service object.
Expand Down Expand Up @@ -152,13 +153,10 @@ export class Service implements NativeService {
transactionId: ?TransactionId,
subscriptionType: ?CharacteristicSubscriptionType
): Subscription {
return this._manager._monitorCharacteristicForService(
this.id,
characteristicUUID,
listener,
transactionId,
subscriptionType
)
const commonArgs = [this.id, characteristicUUID, listener, transactionId]
const args = isIOS ? commonArgs : [...commonArgs, subscriptionType]

return this._manager._monitorCharacteristicForService(...args)
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/Utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @flow
'use strict'

import { Platform } from 'react-native'
import type { UUID } from './TypeDefinition'

/**
Expand All @@ -24,3 +25,5 @@ export function fillStringWithArguments(value: string, object: Object): string {
return object[arg] || '?'
})
}

export const isIOS = Platform.OS === 'ios'

0 comments on commit ad219c7

Please sign in to comment.