Skip to content

Commit 93ae1de

Browse files
author
Paweł Janeczek
committed
5.1.1
1 parent 1db43f6 commit 93ae1de

Some content is hidden

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

68 files changed

+3132
-1332
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 5.1.1
2+
- Fixed `PeripheralManager` not public (#264)
3+
14
# 5.1.0
25
- Added support for `CBPeripheralManager`. Read `PeripheralManager` documentation for more info (#166)
36
- Deprecated `RestoredState` and `CentralManager.init(queue:options:onWillRestoreCentralManagerState:)`. From now on please use corresponding `CentralManagerRestoredState` and `CentralManager.init(queue:options:onWillRestoreCentralManagerState:)`

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.1.0"
3+
s.version = "5.1.1"
44
s.summary = "Bluetooth library for RxSwift"
55

66
s.description = <<-DESC

docs/Classes.html

Lines changed: 62 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> (78% documented)</p>
16+
<p><a href="index.html">RxBluetoothKit Docs</a> (80% 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>
@@ -42,6 +42,9 @@
4242
<li class="nav-group-task">
4343
<a href="Classes/Peripheral.html">Peripheral</a>
4444
</li>
45+
<li class="nav-group-task">
46+
<a href="Classes/PeripheralManager.html">PeripheralManager</a>
47+
</li>
4548
<li class="nav-group-task">
4649
<a href="Classes/RxBluetoothKitLog.html">RxBluetoothKitLog</a>
4750
</li>
@@ -73,9 +76,6 @@
7376
<li class="nav-group-name">
7477
<a href="Extensions.html">Extensions</a>
7578
<ul class="nav-group-tasks">
76-
<li class="nav-group-task">
77-
<a href="Extensions/PeripheralManager.html">PeripheralManager</a>
78-
</li>
7979
<li class="nav-group-task">
8080
<a href="Extensions/Reactive.html">Reactive</a>
8181
</li>
@@ -214,7 +214,7 @@ <h4>Declaration</h4>
214214
</div>
215215
</div>
216216
<div class="slightly-smaller">
217-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L27-L307">Show on GitHub</a>
217+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L27-L307">Show on GitHub</a>
218218
</div>
219219
</section>
220220
</div>
@@ -249,7 +249,7 @@ <h4>Declaration</h4>
249249
</div>
250250
</div>
251251
<div class="slightly-smaller">
252-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/Characteristic.swift#L6-L180">Show on GitHub</a>
252+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/Characteristic.swift#L6-L180">Show on GitHub</a>
253253
</div>
254254
</section>
255255
</div>
@@ -286,7 +286,7 @@ <h4>Declaration</h4>
286286
</div>
287287
</div>
288288
<div class="slightly-smaller">
289-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/Descriptor.swift#L8-L104">Show on GitHub</a>
289+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/Descriptor.swift#L8-L104">Show on GitHub</a>
290290
</div>
291291
</section>
292292
</div>
@@ -321,7 +321,7 @@ <h4>Declaration</h4>
321321
</div>
322322
</div>
323323
<div class="slightly-smaller">
324-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/Logging.swift#L6-L95">Show on GitHub</a>
324+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/Logging.swift#L6-L95">Show on GitHub</a>
325325
</div>
326326
</section>
327327
</div>
@@ -357,7 +357,57 @@ <h4>Declaration</h4>
357357
</div>
358358
</div>
359359
<div class="slightly-smaller">
360-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/Peripheral.swift#L10-L856">Show on GitHub</a>
360+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/Peripheral.swift#L10-L856">Show on GitHub</a>
361+
</div>
362+
</section>
363+
</div>
364+
</li>
365+
</ul>
366+
</div>
367+
<div class="task-group">
368+
<ul>
369+
<li class="item">
370+
<div>
371+
<code>
372+
<a name="/s:14RxBluetoothKit17PeripheralManagerC"></a>
373+
<a name="//apple_ref/swift/Class/PeripheralManager" class="dashAnchor"></a>
374+
<a class="token" href="#/s:14RxBluetoothKit17PeripheralManagerC">PeripheralManager</a>
375+
</code>
376+
</div>
377+
<div class="height-container">
378+
<div class="pointer-container"></div>
379+
<section class="section">
380+
<div class="pointer"></div>
381+
<div class="abstract">
382+
<p>PeripheralManager is a class implementing ReactiveX API which wraps all the Core Bluetooth Peripheral&rsquo;s functions, that allow to
383+
advertise, to publish L2CAP channels and more.
384+
You can start using this class by adding services and starting advertising.
385+
Before calling any public <code>PeripheralManager</code>&lsquo;s functions you should make sure that Bluetooth is turned on and powered on. It can be done
386+
by <code>observeState()</code>, observing it&rsquo;s value and then chaining it with <code>add(_:)</code> and <code>startAdvertising(_:)</code>:</p>
387+
<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>
388+
<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>
389+
<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>
390+
<span class="o">.</span><span class="nf">take</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
391+
<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">add</span><span class="p">(</span><span class="n">myService</span><span class="p">)</span> <span class="p">}</span>
392+
<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">startAdvertising</span><span class="p">(</span><span class="n">myAdvertisementData</span><span class="p">)</span> <span class="p">}</span>
393+
</code></pre>
394+
395+
<p>As a result, your peripheral will start advertising. To stop advertising simply dispose it:</p>
396+
<pre class="highlight swift"><code><span class="n">disposable</span><span class="o">.</span><span class="nf">dispose</span><span class="p">()</span>
397+
</code></pre>
398+
399+
<a href="Classes/PeripheralManager.html" class="slightly-smaller">See more</a>
400+
</div>
401+
<div class="declaration">
402+
<h4>Declaration</h4>
403+
<div class="language">
404+
<p class="aside-title">Swift</p>
405+
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">PeripheralManager</span><span class="p">:</span> <span class="kt"><a href="Protocols/ManagerType.html">ManagerType</a></span></code></pre>
406+
407+
</div>
408+
</div>
409+
<div class="slightly-smaller">
410+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/PeripheralManager.swift#L22-L376">Show on GitHub</a>
361411
</div>
362412
</section>
363413
</div>
@@ -393,7 +443,7 @@ <h4>Declaration</h4>
393443
</div>
394444
</div>
395445
<div class="slightly-smaller">
396-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/ScannedPeripheral.swift#L6-L22">Show on GitHub</a>
446+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/ScannedPeripheral.swift#L6-L22">Show on GitHub</a>
397447
</div>
398448
</section>
399449
</div>
@@ -428,7 +478,7 @@ <h4>Declaration</h4>
428478
</div>
429479
</div>
430480
<div class="slightly-smaller">
431-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/Service.swift#L6-L81">Show on GitHub</a>
481+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/Service.swift#L6-L81">Show on GitHub</a>
432482
</div>
433483
</section>
434484
</div>
@@ -438,7 +488,7 @@ <h4>Declaration</h4>
438488
</section>
439489
</section>
440490
<section id="footer">
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>
491+
<p>&copy; 2018 <a class="link" href="https://polidea.com" target="_blank" rel="external">Polidea</a>. All rights reserved. (Last updated: 2018-06-08)</p>
442492
<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>
443493
</section>
444494
</article>

docs/Classes/CentralManager.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<a title="CentralManager Class Reference"></a>
1515
<header>
1616
<div class="content-wrapper">
17-
<p><a href="../index.html">RxBluetoothKit Docs</a> (78% documented)</p>
17+
<p><a href="../index.html">RxBluetoothKit Docs</a> (80% documented)</p>
1818
<p class="header-right"><a href="https://github.com/Polidea/RxBluetoothKit"><img src="../img/gh.png"/>View on GitHub</a></p>
1919
</div>
2020
</header>
@@ -43,6 +43,9 @@
4343
<li class="nav-group-task">
4444
<a href="../Classes/Peripheral.html">Peripheral</a>
4545
</li>
46+
<li class="nav-group-task">
47+
<a href="../Classes/PeripheralManager.html">PeripheralManager</a>
48+
</li>
4649
<li class="nav-group-task">
4750
<a href="../Classes/RxBluetoothKitLog.html">RxBluetoothKitLog</a>
4851
</li>
@@ -74,9 +77,6 @@
7477
<li class="nav-group-name">
7578
<a href="../Extensions.html">Extensions</a>
7679
<ul class="nav-group-tasks">
77-
<li class="nav-group-task">
78-
<a href="../Extensions/PeripheralManager.html">PeripheralManager</a>
79-
</li>
8080
<li class="nav-group-task">
8181
<a href="../Extensions/Reactive.html">Reactive</a>
8282
</li>
@@ -220,7 +220,7 @@ <h4>Declaration</h4>
220220
</div>
221221
</div>
222222
<div class="slightly-smaller">
223-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L30">Show on GitHub</a>
223+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L30">Show on GitHub</a>
224224
</div>
225225
</section>
226226
</div>
@@ -250,7 +250,7 @@ <h4>Declaration</h4>
250250
</div>
251251
</div>
252252
<div class="slightly-smaller">
253-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L">Show on GitHub</a>
253+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L">Show on GitHub</a>
254254
</div>
255255
</section>
256256
</div>
@@ -329,7 +329,7 @@ <h4>Parameters</h4>
329329
</table>
330330
</div>
331331
<div class="slightly-smaller">
332-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L73-L83">Show on GitHub</a>
332+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L73-L83">Show on GitHub</a>
333333
</div>
334334
</section>
335335
</div>
@@ -361,7 +361,7 @@ <h4>Declaration</h4>
361361
</div>
362362
</div>
363363
<div class="slightly-smaller">
364-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L88-L90">Show on GitHub</a>
364+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L88-L90">Show on GitHub</a>
365365
</div>
366366
</section>
367367
</div>
@@ -401,7 +401,7 @@ <h4>Declaration</h4>
401401
</div>
402402
</div>
403403
<div class="slightly-smaller">
404-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L94-L96">Show on GitHub</a>
404+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L94-L96">Show on GitHub</a>
405405
</div>
406406
</section>
407407
</div>
@@ -430,7 +430,7 @@ <h4>Declaration</h4>
430430
</div>
431431
</div>
432432
<div class="slightly-smaller">
433-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L98-L100">Show on GitHub</a>
433+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L98-L100">Show on GitHub</a>
434434
</div>
435435
</section>
436436
</div>
@@ -540,7 +540,7 @@ <h4>Return Value</h4>
540540
<p>Infinite stream of scanned peripherals.</p>
541541
</div>
542542
<div class="slightly-smaller">
543-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L137-L175">Show on GitHub</a>
543+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L137-L175">Show on GitHub</a>
544544
</div>
545545
</section>
546546
</div>
@@ -635,7 +635,7 @@ <h4>Return Value</h4>
635635
<p><code>Observable</code> which emits next event after connection is established.</p>
636636
</div>
637637
<div class="slightly-smaller">
638-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L200-L203">Show on GitHub</a>
638+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L200-L203">Show on GitHub</a>
639639
</div>
640640
</section>
641641
</div>
@@ -701,7 +701,7 @@ <h4>Return Value</h4>
701701
<code><a href="../Classes/Service.html">Service</a></code>s with UUIDs specified in the <code>serviceUUIDs</code> parameter.</p>
702702
</div>
703703
<div class="slightly-smaller">
704-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L213-L216">Show on GitHub</a>
704+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L213-L216">Show on GitHub</a>
705705
</div>
706706
</section>
707707
</div>
@@ -754,7 +754,7 @@ <h4>Return Value</h4>
754754
<p>Retrieved <code><a href="../Classes/Peripheral.html">Peripheral</a></code>s.</p>
755755
</div>
756756
<div class="slightly-smaller">
757-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L222-L225">Show on GitHub</a>
757+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L222-L225">Show on GitHub</a>
758758
</div>
759759
</section>
760760
</div>
@@ -831,7 +831,7 @@ <h4>Return Value</h4>
831831
<p>Observable which emits next events when <code>peripheral</code> was connected.</p>
832832
</div>
833833
<div class="slightly-smaller">
834-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L243-L251">Show on GitHub</a>
834+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L243-L251">Show on GitHub</a>
835835
</div>
836836
</section>
837837
</div>
@@ -899,7 +899,7 @@ <h4>Return Value</h4>
899899
if it wasn&rsquo;t the <code>cancelPeripheralConnection</code> call.</p>
900900
</div>
901901
<div class="slightly-smaller">
902-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager.swift#L268-L284">Show on GitHub</a>
902+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager.swift#L268-L284">Show on GitHub</a>
903903
</div>
904904
</section>
905905
</div>
@@ -942,7 +942,7 @@ <h4>Declaration</h4>
942942
</div>
943943
</div>
944944
<div class="slightly-smaller">
945-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager+RestoredState.swift#L16-L23">Show on GitHub</a>
945+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager+RestoredState.swift#L16-L23">Show on GitHub</a>
946946
</div>
947947
</section>
948948
</div>
@@ -1030,7 +1030,7 @@ <h4>Parameters</h4>
10301030
</table>
10311031
</div>
10321032
<div class="slightly-smaller">
1033-
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.0/Source/CentralManager+RestoredState.swift#L35-L42">Show on GitHub</a>
1033+
<a href="https://github.com/Polidea/RxBluetoothKit/tree/5.1.1/Source/CentralManager+RestoredState.swift#L35-L42">Show on GitHub</a>
10341034
</div>
10351035
</section>
10361036
</div>
@@ -1040,7 +1040,7 @@ <h4>Parameters</h4>
10401040
</section>
10411041
</section>
10421042
<section id="footer">
1043-
<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>
1043+
<p>&copy; 2018 <a class="link" href="https://polidea.com" target="_blank" rel="external">Polidea</a>. All rights reserved. (Last updated: 2018-06-08)</p>
10441044
<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>
10451045
</section>
10461046
</article>

0 commit comments

Comments
 (0)