Skip to content

Commit 419776e

Browse files
author
Kamil Kosowski
authored
Merge pull request #261 from Polidea/5.1.0
5.1.0
2 parents ac18350 + aa442a3 commit 419776e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+6230
-639
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 5.1.0
2+
- Added support for `CBPeripheralManager`. Read `PeripheralManager` documentation for more info (#166)
3+
- Deprecated `RestoredState` and `CentralManager.init(queue:options:onWillRestoreCentralManagerState:)`. From now on please use corresponding `CentralManagerRestoredState` and `CentralManager.init(queue:options:onWillRestoreCentralManagerState:)`
4+
15
# 5.0.2
26
- Changed error name from `BluetoothError.peripheralIsConnectingOrAlreadyConnected` to `BluetoothError.peripheralIsAlreadyObservingConnection` - old error has been deprecated (#245)
37
- To each method, that returns observable, added documentation with a list of errors that this observable can return (#225)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ For support head to [StackOverflow](http://stackoverflow.com/questions/tagged/rx
2222
Follow [Polidea's Blog](https://www.polidea.com/blog/RxBluetoothKit_The_most_simple_way_to_code_BLE_devices/) blog to get all the news and updates!
2323

2424
## Features
25-
- [x] CBCentralManger RxSwift support
26-
- [x] CBPeripheralManger RxSwift support
25+
- [x] CBCentralManager RxSwift support
26+
- [x] CBPeripheralManager RxSwift support
2727
- [x] CBPeripheral RxSwift support
2828
- [x] Scan sharing
2929
- [x] Scan queueing

RxBluetoothKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "RxBluetoothKit"
3-
s.version = "5.0.2"
3+
s.version = "5.1.0"
44
s.summary = "Bluetooth library for RxSwift"
55

66
s.description = <<-DESC

docs/Classes.html

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<a title="Classes Reference"></a>
1414
<header>
1515
<div class="content-wrapper">
16-
<p><a href="index.html">RxBluetoothKit Docs</a> (82% documented)</p>
16+
<p><a href="index.html">RxBluetoothKit Docs</a> (78% documented)</p>
1717
<p class="header-right"><a href="https://github.com/Polidea/RxBluetoothKit"><img src="img/gh.png"/>View on GitHub</a></p>
1818
</div>
1919
</header>
@@ -65,11 +65,17 @@
6565
<li class="nav-group-task">
6666
<a href="Enums/BluetoothState.html">BluetoothState</a>
6767
</li>
68+
<li class="nav-group-task">
69+
<a href="Enums/StartAdvertisingResult.html">StartAdvertisingResult</a>
70+
</li>
6871
</ul>
6972
</li>
7073
<li class="nav-group-name">
7174
<a href="Extensions.html">Extensions</a>
7275
<ul class="nav-group-tasks">
76+
<li class="nav-group-task">
77+
<a href="Extensions/PeripheralManager.html">PeripheralManager</a>
78+
</li>
7379
<li class="nav-group-task">
7480
<a href="Extensions/Reactive.html">Reactive</a>
7581
</li>
@@ -104,6 +110,9 @@
104110
<li class="nav-group-task">
105111
<a href="Protocols/DescriptorIdentifier.html">DescriptorIdentifier</a>
106112
</li>
113+
<li class="nav-group-task">
114+
<a href="Protocols/ManagerType.html">ManagerType</a>
115+
</li>
107116
<li class="nav-group-task">
108117
<a href="Protocols/ServiceIdentifier.html">ServiceIdentifier</a>
109118
</li>
@@ -115,6 +124,12 @@
115124
<li class="nav-group-task">
116125
<a href="Structs/AdvertisementData.html">AdvertisementData</a>
117126
</li>
127+
<li class="nav-group-task">
128+
<a href="Structs/CentralManagerRestoredState.html">CentralManagerRestoredState</a>
129+
</li>
130+
<li class="nav-group-task">
131+
<a href="Structs/PeripheralManagerRestoredState.html">PeripheralManagerRestoredState</a>
132+
</li>
118133
<li class="nav-group-task">
119134
<a href="Structs/RestoredState.html">RestoredState</a>
120135
</li>
@@ -126,9 +141,18 @@
126141
<li class="nav-group-task">
127142
<a href="Typealiases.html#/s:14RxBluetoothKit19DisconnectionReasona">DisconnectionReason</a>
128143
</li>
144+
<li class="nav-group-task">
145+
<a href="Typealiases.html#/s:14RxBluetoothKit32OnWillRestoreCentralManagerStatea">OnWillRestoreCentralManagerState</a>
146+
</li>
147+
<li class="nav-group-task">
148+
<a href="Typealiases.html#/s:14RxBluetoothKit35OnWillRestorePeripheralManagerStatea">OnWillRestorePeripheralManagerState</a>
149+
</li>
129150
<li class="nav-group-task">
130151
<a href="Typealiases.html#/s:14RxBluetoothKit18OnWillRestoreStatea">OnWillRestoreState</a>
131152
</li>
153+
<li class="nav-group-task">
154+
<a href="Typealiases.html#/s:14RxBluetoothKit25RestoredAdvertisementDataa">RestoredAdvertisementData</a>
155+
</li>
132156
</ul>
133157
</li>
134158
</ul>
@@ -161,15 +185,18 @@ <h1>Classes</h1>
161185
You can start using this class by discovering available services of nearby peripherals. Before calling any
162186
public <code>CentralManager</code>&lsquo;s functions you should make sure that Bluetooth is turned on and powered on. It can be done
163187
by calling and observing returned value of <code>observeState()</code> and then chaining it with <code>scanForPeripherals(_:options:)</code>:</p>
164-
<pre class="highlight swift"><code><span class="n">centralManager</span><span class="o">.</span><span class="n">observeState</span>
188+
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">disposable</span> <span class="o">=</span> <span class="n">centralManager</span><span class="o">.</span><span class="n">observeState</span>
165189
<span class="o">.</span><span class="nf">startWith</span><span class="p">(</span><span class="n">centralManager</span><span class="o">.</span><span class="n">state</span><span class="p">)</span>
166190
<span class="o">.</span><span class="n">filter</span> <span class="p">{</span> <span class="nv">$0</span> <span class="o">==</span> <span class="o">.</span><span class="n">poweredOn</span> <span class="p">}</span>
167191
<span class="o">.</span><span class="nf">take</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
168192
<span class="o">.</span><span class="n">flatMap</span> <span class="p">{</span> <span class="n">centralManager</span><span class="o">.</span><span class="nf">scanForPeripherals</span><span class="p">(</span><span class="kc">nil</span><span class="p">)</span> <span class="p">}</span>
169193
</code></pre>
170194

171195
<p>As a result you will receive <code><a href="Classes/ScannedPeripheral.html">ScannedPeripheral</a></code> which contains <code><a href="Classes/Peripheral.html">Peripheral</a></code> object, <code><a href="Structs/AdvertisementData.html">AdvertisementData</a></code> and
172-
peripheral&rsquo;s RSSI registered during discovery. You can then <code>establishConnection(_:options:)</code> and do other operations.</p>
196+
peripheral&rsquo;s RSSI registered during discovery. You can then <code>establishConnection(_:options:)</code> and do other operations.
197+
You can also simply stop scanning with just disposing it:</p>
198+
<pre class="highlight swift"><code><span class="n">disposable</span><span class="o">.</span><span class="nf">dispose</span><span class="p">()</span>
199+
</code></pre>
173200
<div class="aside aside-seealso">
174201
<p class="aside-title">Seealso</p>
175202
<code><a href="Classes/Peripheral.html">Peripheral</a></code>
@@ -182,12 +209,12 @@ <h1>Classes</h1>
182209
<h4>Declaration</h4>
183210
<div class="language">
184211
<p class="aside-title">Swift</p>
185-
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CentralManager</span></code></pre>
212+
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CentralManager</span><span class="p">:</span> <span class="kt"><a href="Protocols/ManagerType.html">ManagerType</a></span></code></pre>
186213

187214
</div>
188215
</div>
189216
<div class="slightly-smaller">
190-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.0.2/Source/CentralManager.swift#L25-L326">Show on GitHub</a>
217+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L27-L307">Show on GitHub</a>
191218
</div>
192219
</section>
193220
</div>
@@ -222,7 +249,7 @@ <h4>Declaration</h4>
222249
</div>
223250
</div>
224251
<div class="slightly-smaller">
225-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.0.2/Source/Characteristic.swift#L8-L182">Show on GitHub</a>
252+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/Characteristic.swift#L6-L180">Show on GitHub</a>
226253
</div>
227254
</section>
228255
</div>
@@ -259,7 +286,7 @@ <h4>Declaration</h4>
259286
</div>
260287
</div>
261288
<div class="slightly-smaller">
262-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.0.2/Source/Descriptor.swift#L8-L104">Show on GitHub</a>
289+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/Descriptor.swift#L8-L104">Show on GitHub</a>
263290
</div>
264291
</section>
265292
</div>
@@ -294,7 +321,7 @@ <h4>Declaration</h4>
294321
</div>
295322
</div>
296323
<div class="slightly-smaller">
297-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.0.2/Source/Logging.swift#L6-L95">Show on GitHub</a>
324+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/Logging.swift#L6-L95">Show on GitHub</a>
298325
</div>
299326
</section>
300327
</div>
@@ -330,7 +357,7 @@ <h4>Declaration</h4>
330357
</div>
331358
</div>
332359
<div class="slightly-smaller">
333-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.0.2/Source/Peripheral.swift#L10-L856">Show on GitHub</a>
360+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/Peripheral.swift#L10-L856">Show on GitHub</a>
334361
</div>
335362
</section>
336363
</div>
@@ -366,7 +393,7 @@ <h4>Declaration</h4>
366393
</div>
367394
</div>
368395
<div class="slightly-smaller">
369-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.0.2/Source/ScannedPeripheral.swift#L6-L22">Show on GitHub</a>
396+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/ScannedPeripheral.swift#L6-L22">Show on GitHub</a>
370397
</div>
371398
</section>
372399
</div>
@@ -401,7 +428,7 @@ <h4>Declaration</h4>
401428
</div>
402429
</div>
403430
<div class="slightly-smaller">
404-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.0.2/Source/Service.swift#L7-L82">Show on GitHub</a>
431+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/Service.swift#L6-L81">Show on GitHub</a>
405432
</div>
406433
</section>
407434
</div>
@@ -411,7 +438,7 @@ <h4>Declaration</h4>
411438
</section>
412439
</section>
413440
<section id="footer">
414-
<p>&copy; 2018 <a class="link" href="https://polidea.com" target="_blank" rel="external">Polidea</a>. All rights reserved. (Last updated: 2018-05-07)</p>
441+
<p>&copy; 2018 <a class="link" href="https://polidea.com" target="_blank" rel="external">Polidea</a>. All rights reserved. (Last updated: 2018-05-25)</p>
415442
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
416443
</section>
417444
</article>

0 commit comments

Comments
 (0)