Skip to content

Commit

Permalink
chore: 3.2.0 (#1207)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-czupryna-withintent authored May 31, 2024
1 parent 2c8c138 commit 8893a5e
Show file tree
Hide file tree
Showing 10 changed files with 28,011 additions and 13,436 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

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

## [3.2.0] - 2024-05-31

### Added

- Android Instance will be checked before calling its method, an error will be visible on the RN side
- Added information related to Android 14 to the documentation.

### Changed

- Changed destroyClient, cancelTransaction, setLogLevel, startDeviceScan, stopDeviceScan calls to promises to allow error reporting if it occurs.

### Fixed

- Fixed one of the functions calls that clean up the BLE instance after it is destroyed.

## [3.1.2] - 2023-10-26

### Added
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ For old RN versions (<0.60) please check [old README](./docs/README_V1.md) (1.x)
for the old instructions or [migration guide](./docs/MIGRATION_V1.md).

| React Native | 3.1.2 |
| ------------ | ------------------ |
| 0.72.6 | :white_check_mark: |
| 0.71.13 | :white_check_mark: |
| 0.70.13 | :white_check_mark: |
| Expo 49 | :white_check_mark: |
|--------------| ------------------ |
| 0.74.1 | :white_check_mark: |
| 0.69.6 | :white_check_mark: |
| Expo 51 | :white_check_mark: |

## Recent Changes

**3.1.2**
**3.2.0**

- Added rawScanRecord to advertising data
- Fixed onDisconnected event
- Fixed missing advertising data fields on iOS
- Added Android Instance checking before calling its method, an error will be visible on the RN side
- Added information related to Android 14 to the documentation.
- Changed destroyClient, cancelTransaction, setLogLevel, startDeviceScan, stopDeviceScan calls to promises to allow error reporting if it occurs.
- Fixed one of the functions calls that clean up the BLE instance after it is destroyed.

[Current version changes](CHANGELOG.md)
[All previous changes](CHANGELOG-pre-3.0.0.md)
Expand Down
98 changes: 74 additions & 24 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset='utf-8'>
<title>react-native-ble-plx 3.1.2 | Documentation</title>
<title>react-native-ble-plx 3.2.0 | Documentation</title>
<meta name='description' content='React Native Bluetooth Low Energy library'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<link href='assets/bass.css' rel='stylesheet'>
Expand All @@ -15,7 +15,7 @@
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
<div class='py1 px2'>
<h3 class='mb0 no-anchor'>react-native-ble-plx</h3>
<div class='mb1'><code>3.1.2</code></div>
<div class='mb1'><code>3.2.0</code></div>
<input
placeholder='Filter'
id='filter-input'
Expand Down Expand Up @@ -2189,7 +2189,7 @@ <h3 class='fl m0' id='blemanager'>
<div class="clearfix small pointer toggle-sibling">
<div class="py1 contain">
<a class='icon pin-right py1 dark-link caret-right'></a>
<span class='code strong strong truncate'>destroy()</span>
<span class='code strong strong truncate'>destroy</span>
</div>
</div>
<div class="clearfix display-none toggle-target">
Expand All @@ -2198,10 +2198,9 @@ <h3 class='fl m0' id='blemanager'>


<p>Destroys <a href="#blemanager">BleManager</a> instance. A new instance needs to be created to continue working with
this library. All operations which were in progress completes with
<a href="#bleerrorcodebluetoothmanagerdestroyed">BluetoothManagerDestroyed</a> error code.</p>
this library. All operations which were in progress completes with</p>

<div class='pre p1 fill-light mt0'>destroy()</div>
<div class='pre p1 fill-light mt0'>destroy</div>



Expand All @@ -2217,6 +2216,17 @@ <h3 class='fl m0' id='blemanager'>




<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;void></code>:
Promise may return an error when the function cannot be called.

<a href="#bleerrorcodebluetoothmanagerdestroyed">BluetoothManagerDestroyed</a>
error code.







Expand Down Expand Up @@ -2250,7 +2260,7 @@ <h3 class='fl m0' id='blemanager'>

<p>Sets new log level for native module's logging mechanism.</p>

<div class='pre p1 fill-light mt0'>setLogLevel(logLevel: <a href="#loglevel">LogLevel</a>)</div>
<div class='pre p1 fill-light mt0'>setLogLevel(logLevel: <a href="#loglevel">LogLevel</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;<a href="#loglevel">LogLevel</a>></div>



Expand Down Expand Up @@ -2280,6 +2290,14 @@ <h3 class='fl m0' id='blemanager'>




<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;<a href="#loglevel">LogLevel</a>></code>:
Current log level.







Expand Down Expand Up @@ -2375,7 +2393,7 @@ <h3 class='fl m0' id='blemanager'>
<a href="#bleerrorcodeoperationcancelled">OperationCancelled</a> will be emitted in that case. Cancelling transaction
which doesn't exist is ignored.</p>

<div class='pre p1 fill-light mt0'>cancelTransaction(transactionId: <a href="#transactionid">TransactionId</a>)</div>
<div class='pre p1 fill-light mt0'>cancelTransaction(transactionId: <a href="#transactionid">TransactionId</a>): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;void></div>



Expand Down Expand Up @@ -2405,6 +2423,14 @@ <h3 class='fl m0' id='blemanager'>




<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;void></code>:








Expand Down Expand Up @@ -2587,7 +2613,7 @@ <h3 class='fl m0' id='blemanager'>
<div class="clearfix small pointer toggle-sibling">
<div class="py1 contain">
<a class='icon pin-right py1 dark-link caret-right'></a>
<span class='code strong strong truncate'>state()</span>
<span class='code strong strong truncate'>state</span>
</div>
</div>
<div class="clearfix display-none toggle-target">
Expand All @@ -2598,7 +2624,7 @@ <h3 class='fl m0' id='blemanager'>
<p>Current, global <a href="#state">State</a> of a <a href="#blemanager">BleManager</a>. All APIs are working only when active state
is "PoweredOn".</p>

<div class='pre p1 fill-light mt0'>state(): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;<a href="#state">State</a>></div>
<div class='pre p1 fill-light mt0'>state</div>



Expand Down Expand Up @@ -2645,7 +2671,7 @@ <h3 class='fl m0' id='blemanager'>
<div class="clearfix small pointer toggle-sibling">
<div class="py1 contain">
<a class='icon pin-right py1 dark-link caret-right'></a>
<span class='code strong strong truncate'>onStateChange(listener, emitCurrentState)</span>
<span class='code strong strong truncate'>onStateChange</span>
</div>
</div>
<div class="clearfix display-none toggle-target">
Expand All @@ -2655,7 +2681,7 @@ <h3 class='fl m0' id='blemanager'>

<p>Notifies about <a href="#state">State</a> changes of a <a href="#blemanager">BleManager</a>.</p>

<div class='pre p1 fill-light mt0'>onStateChange(listener: function (newState: <a href="#state">State</a>), emitCurrentState: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>): <a href="#subscription">Subscription</a></div>
<div class='pre p1 fill-light mt0'>onStateChange</div>



Expand Down Expand Up @@ -2752,7 +2778,7 @@ <h3 class='fl m0' id='blemanager'>

<p>Starts device scanning. When previous scan is in progress it will be stopped before executing this command.</p>

<div class='pre p1 fill-light mt0'>startDeviceScan(UUIDs: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&#x3C;<a href="#uuid">UUID</a>>?, options: <a href="#scanoptions">ScanOptions</a>?, listener: function (error: <a href="#bleerror">BleError</a>?, scannedDevice: <a href="#device">Device</a>?))</div>
<div class='pre p1 fill-light mt0'>startDeviceScan(UUIDs: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&#x3C;<a href="#uuid">UUID</a>>?, options: <a href="#scanoptions">ScanOptions</a>?, listener: function (error: <a href="#bleerror">BleError</a>?, scannedDevice: <a href="#device">Device</a>?)): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;void></div>



Expand Down Expand Up @@ -2801,6 +2827,21 @@ <h3 class='fl m0' id='blemanager'>
<span class='code bold'>listener</span> <code class='quiet'>(function (error: <a href="#bleerror">BleError</a>?, scannedDevice: <a href="#device">Device</a>?))</code>
Function which will be called for every scanned

</div>

</div>

</div>






<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;void></code>:
Promise may return an error when the function cannot be called.

<a href="#device">Device</a>
(devices may be scanned multiple times). It's first argument is potential
<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>
Expand All @@ -2812,15 +2853,14 @@ <h3 class='fl m0' id='blemanager'>
<a href="#device">Device</a>
.

</div>

</div>

</div>




<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;void></code>:
the promise may be rejected if the operation is impossible to perform.






Expand All @@ -2845,7 +2885,7 @@ <h3 class='fl m0' id='blemanager'>
<div class="clearfix small pointer toggle-sibling">
<div class="py1 contain">
<a class='icon pin-right py1 dark-link caret-right'></a>
<span class='code strong strong truncate'>stopDeviceScan()</span>
<span class='code strong strong truncate'>stopDeviceScan</span>
</div>
</div>
<div class="clearfix display-none toggle-target">
Expand All @@ -2855,7 +2895,7 @@ <h3 class='fl m0' id='blemanager'>

<p>Stops <a href="#device">Device</a> scan if in progress.</p>

<div class='pre p1 fill-light mt0'>stopDeviceScan()</div>
<div class='pre p1 fill-light mt0'>stopDeviceScan</div>



Expand All @@ -2871,6 +2911,14 @@ <h3 class='fl m0' id='blemanager'>




<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;void></code>:
the promise may be rejected if the operation is impossible to perform.







Expand Down Expand Up @@ -3073,7 +3121,9 @@ <h3 class='fl m0' id='blemanager'>


<p>Request new MTU value for this device. This function currently is not doing anything
on iOS platform as MTU exchange is done automatically.</p>
on iOS platform as MTU exchange is done automatically. Since Android 14,
mtu management has been changed, more information can be found at the link:
<a href="https://developer.android.com/about/versions/14/behavior-changes-all#mtu-set-to-517">https://developer.android.com/about/versions/14/behavior-changes-all#mtu-set-to-517</a></p>

<div class='pre p1 fill-light mt0'>requestMTUForDevice(deviceIdentifier: <a href="#deviceid">DeviceId</a>, mtu: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, transactionId: <a href="#transactionid">TransactionId</a>?): <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;<a href="#device">Device</a>></div>

Expand Down Expand Up @@ -3126,7 +3176,7 @@ <h3 class='fl m0' id='blemanager'>

<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&#x3C;<a href="#device">Device</a>></code>:
Device with updated MTU size. Default value is 23.
Device with updated MTU size. Default value is 23 (517 since Android 14)..



Expand Down
14 changes: 4 additions & 10 deletions example/ios/BlePlxExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 457FBQ4469;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = BlePlxExample/Info.plist;
Expand Down Expand Up @@ -501,7 +501,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 457FBQ4469;
INFOPLIST_FILE = BlePlxExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -596,10 +596,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down Expand Up @@ -676,10 +673,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
OTHER_LDFLAGS = (
"$(inherited)",
" ",
);
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
Expand Down
Loading

0 comments on commit 8893a5e

Please sign in to comment.