-
Notifications
You must be signed in to change notification settings - Fork 375
/
Copy pathindex.html
314 lines (289 loc) · 17.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
<html lang="en">
<head>
<title>RxBluetoothKit Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a title="RxBluetoothKit Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">RxBluetoothKit 6.0.0 Docs</a> (82% documented)</p>
<p class="header-right"><a href="https://github.com/Polidea/RxBluetoothKit"><img src="img/gh.png"/>View on GitHub</a></p>
<p class="header-right">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">RxBluetoothKit Reference</a>
<img id="carat" src="img/carat.png" />
RxBluetoothKit Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/CentralManager.html">CentralManager</a>
</li>
<li class="nav-group-task">
<a href="Classes/Characteristic.html">Characteristic</a>
</li>
<li class="nav-group-task">
<a href="Classes/Descriptor.html">Descriptor</a>
</li>
<li class="nav-group-task">
<a href="Classes/Peripheral.html">Peripheral</a>
</li>
<li class="nav-group-task">
<a href="Classes/PeripheralManager.html">PeripheralManager</a>
</li>
<li class="nav-group-task">
<a href="Classes/RxBluetoothKitLog.html">RxBluetoothKitLog</a>
</li>
<li class="nav-group-task">
<a href="Classes/RxBluetoothKitLog/LogLevel.html">– LogLevel</a>
</li>
<li class="nav-group-task">
<a href="Classes/ScannedPeripheral.html">ScannedPeripheral</a>
</li>
<li class="nav-group-task">
<a href="Classes/Service.html">Service</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Enums/BluetoothError.html">BluetoothError</a>
</li>
<li class="nav-group-task">
<a href="Enums/BluetoothState.html">BluetoothState</a>
</li>
<li class="nav-group-task">
<a href="Enums/RxBluetoothKitLogger.html">RxBluetoothKitLogger</a>
</li>
<li class="nav-group-task">
<a href="Enums/StartAdvertisingResult.html">StartAdvertisingResult</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Extensions/Reactive.html">Reactive</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Functions.html">Functions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Functions.html#/s:14RxBluetoothKit2eeoiySbAA0B5ErrorO_ADtF">==(_:_:)</a>
</li>
<li class="nav-group-task">
<a href="Functions.html#/s:14RxBluetoothKit2eeoiySbAA10DescriptorC_ADtF">==(_:_:)</a>
</li>
<li class="nav-group-task">
<a href="Functions.html#/s:14RxBluetoothKit2eeoiySbAA10PeripheralC_ADtF">==(_:_:)</a>
</li>
<li class="nav-group-task">
<a href="Functions.html#/s:14RxBluetoothKit2eeoiySbAA14CharacteristicC_ADtF">==(_:_:)</a>
</li>
<li class="nav-group-task">
<a href="Functions.html#/s:14RxBluetoothKit2eeoiySbAA7ServiceC_ADtF">==(_:_:)</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Protocols/CharacteristicIdentifier.html">CharacteristicIdentifier</a>
</li>
<li class="nav-group-task">
<a href="Protocols/DescriptorIdentifier.html">DescriptorIdentifier</a>
</li>
<li class="nav-group-task">
<a href="Protocols/Logger.html">Logger</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ManagerType.html">ManagerType</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ServiceIdentifier.html">ServiceIdentifier</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Structs/AdvertisementData.html">AdvertisementData</a>
</li>
<li class="nav-group-task">
<a href="Structs/CentralManagerRestoredState.html">CentralManagerRestoredState</a>
</li>
<li class="nav-group-task">
<a href="Structs/PeripheralManagerRestoredState.html">PeripheralManagerRestoredState</a>
</li>
<li class="nav-group-task">
<a href="Structs/RestoredState.html">RestoredState</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Typealiases.html#/s:14RxBluetoothKit19DisconnectionReasona">DisconnectionReason</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:14RxBluetoothKit32OnWillRestoreCentralManagerStatea">OnWillRestoreCentralManagerState</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:14RxBluetoothKit35OnWillRestorePeripheralManagerStatea">OnWillRestorePeripheralManagerState</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:14RxBluetoothKit18OnWillRestoreStatea">OnWillRestoreState</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:14RxBluetoothKit25RestoredAdvertisementDataa">RestoredAdvertisementData</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<p align="center">
<img
alt="RxBluetoothKit library logo"
src="site/rxbluetoothkit-logo.png"
height="300"
style="margin-top: 20px; margin-bottom: 20px;"
/>
</p>
<p><a href="https://travis-ci.org/Polidea/RxBluetoothKit"><img src="http://img.shields.io/travis/Polidea/RxBluetoothKit.svg?style=flat" alt="CI Status"></a>
<a href="http://cocoapods.org/pods/RxBluetoothKit"><img src="https://img.shields.io/cocoapods/p/RxBluetoothKit.svg?style=flat" alt="Platform"></a>
<a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage Compatible"></a></p>
<p>RxBluetoothKit is a Bluetooth library that makes interaction with BLE devices much more pleasant. It’s backed by RxSwift and CoreBluetooth and it provides nice API, for both Central and Peripheral modes. All to work with and make your code more readable, reliable and easier to maintain. </p>
<p>Here is a sneak peek of what you can do with RxBluetoothKit:</p>
<pre class="highlight swift"><code><span class="n">manager</span><span class="o">.</span><span class="nf">scanForPeripherals</span><span class="p">(</span><span class="nv">withServices</span><span class="p">:</span> <span class="p">[</span><span class="n">serviceId</span><span class="p">])</span>
<span class="o">.</span><span class="nf">take</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="o">.</span><span class="n">flatMap</span> <span class="p">{</span> <span class="nv">$0</span><span class="o">.</span><span class="n">peripheral</span><span class="o">.</span><span class="nf">establishConnection</span><span class="p">()</span> <span class="p">}</span>
<span class="o">.</span><span class="n">flatMap</span> <span class="p">{</span> <span class="nv">$0</span><span class="o">.</span><span class="nf">discoverServices</span><span class="p">([</span><span class="n">serviceId</span><span class="p">])</span> <span class="p">}</span>
<span class="o">.</span><span class="n">flatMap</span> <span class="p">{</span> <span class="kt">Observable</span><span class="o">.</span><span class="nf">from</span><span class="p">(</span><span class="nv">$0</span><span class="p">)</span> <span class="p">}</span>
<span class="o">.</span><span class="n">flatMap</span> <span class="p">{</span> <span class="nv">$0</span><span class="o">.</span><span class="nf">discoverCharacteristics</span><span class="p">([</span><span class="n">characteristicId</span><span class="p">])</span> <span class="p">}</span>
<span class="o">.</span><span class="n">flatMap</span> <span class="p">{</span> <span class="kt">Observable</span><span class="o">.</span><span class="nf">from</span><span class="p">(</span><span class="nv">$0</span><span class="p">)</span> <span class="p">}</span>
<span class="o">.</span><span class="n">flatMap</span> <span class="p">{</span> <span class="nv">$0</span><span class="o">.</span><span class="nf">readValue</span><span class="p">()</span> <span class="p">}</span>
<span class="o">.</span><span class="nf">subscribe</span><span class="p">(</span><span class="nv">onNext</span><span class="p">:</span> <span class="p">{</span> <span class="nf">print</span><span class="p">(</span><span class="s">"Value: </span><span class="se">\(</span><span class="nv">$0</span><span class="o">.</span><span class="n">value</span><span class="se">)</span><span class="s">"</span><span class="p">)</span> <span class="p">})</span>
</code></pre>
<p>With just 9 lines it started scanning, connecting to the peripheral, discovering service and characteristics and read charecteristic’s value!</p>
<h2 id='central-mode-features' class='heading'>Central mode features</h2>
<ul>
<li><a href="https://github.com/Polidea/RxBluetoothKit/wiki/2.-Manager-State">Observing manager states</a></li>
<li><a href="https://github.com/Polidea/RxBluetoothKit/wiki/3.-Scanning-peripherals">Scanning for peripherals</a></li>
<li><a href="https://github.com/Polidea/RxBluetoothKit/wiki/4.-Connecting-to-peripheral">Connecting to peripheral</a></li>
<li><a href="https://github.com/Polidea/RxBluetoothKit/wiki/5.-Discovering-services-&-characteristics">Discovering peripheral’s services and characteristics</a></li>
<li><a href="https://github.com/Polidea/RxBluetoothKit/wiki/6.-Reading-&-Writing-to-characteristic-value">Reading & Writing to characteristic’s value</a></li>
<li><a href="https://github.com/Polidea/RxBluetoothKit/wiki/7.-Monitoring-characteristic-value-change">Monitoring characteristic value change</a></li>
<li>Opening L2CAP channels</li>
<li><a href="https://github.com/Polidea/RxBluetoothKit/wiki/8.-Convenience-helper-methods">Convenience helper methods</a></li>
<li><a href="https://github.com/Polidea/RxBluetoothKit/wiki/9.-Other-functionalities">And a lot more!</a></li>
</ul>
<h2 id='peripheral-mode-features' class='heading'>Peripheral mode features</h2>
<ul>
<li><a href="https://github.com/Polidea/RxBluetoothKit/wiki/2.-Manager-State">Observing manager states</a></li>
<li>Advertising</li>
<li>Observing read & writes</li>
<li>Observing subscribe</li>
<li>Publishing L2CAP channels</li>
<li>And a lot more!</li>
</ul>
<h1 id='recent-changes' class='heading'>Recent Changes</h1>
<p><strong>6.0.0</strong></p>
<ul>
<li>Increased deployment target for iOS to 9.0 and for osx to 10.13 (#379, #380)</li>
<li>Added support for observing ancsAuthorized property on peripheral. (#370)</li>
<li>Added Bluetooth usage description to Info.plist in Example project (#369)</li>
<li>Added initial state improvement & a minor fix for BluetoothState methods. (#371)</li>
<li>Fixed problems with SPM support (#358, #368)</li>
<li>Updated RxSwift version to 5.1 (#376)</li>
<li>Updated project configurations to decrease build time on TravisCI (#376)</li>
<li>Updated scripts to fixed problems with generating mocks (#378)</li>
</ul>
<p><a href="CHANGELOG.md">All previous changes</a></p>
<p>Want to migrate from 4.x to 5.x? Check guidelines <a href="https://github.com/Polidea/RxBluetoothKit/wiki/Migrating-to-5.x">here</a>.</p>
<h1 id='installation' class='heading'>Installation</h1>
<h2 id='cocoapods' class='heading'>CocoaPods</h2>
<p><a href="http://cocoapods.org">CocoaPods</a> is a dependency manager for CocoaProjects.
To integrate RxBluetoothKit into your Xcode project using CocoaPods specify it in your <code>Podfile</code>:</p>
<pre class="highlight ruby"><code><span class="n">pod</span> <span class="s1">'RxBluetoothKit'</span>
</code></pre>
<p>Then, run the following command:
<code>$ pod install</code></p>
<h2 id='carthage' class='heading'>Carthage</h2>
<p><a href="https://github.com/Carthage/Carthage">Carthage</a> is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
To integrate RxBluetoothKit into your Xcode project using Carthage specify it in your <code>Cartfile</code>:</p>
<pre class="highlight swift"><code><span class="n">github</span> <span class="s">"Polidea/RxBluetoothKit"</span>
</code></pre>
<p>Then, run <code>carthage update</code> to build framework and drag <code>RxBluetoothKit.framework</code> into your Xcode project.</p>
<h2 id='swift-package-manager' class='heading'>Swift Package Manager</h2>
<p>Versions >= 4.0 of the library integrate with the Swift Package Manager. In order to do that please specify our project as one of your dependencies in <code>Package.swift</code> file.</p>
<h1 id='getting-started' class='heading'>Getting Started</h1>
<p>Check <a href="https://github.com/Polidea/RxBluetoothKit/wiki">our Wiki</a> with guidelines to (almost) all library functionalites.</p>
<h1 id='documentation-amp-support' class='heading'>Documentation & Support</h1>
<ul>
<li><a href="https://polidea.github.io/RxBluetoothKit/">Api reference</a></li>
<li><a href="https://github.com/Polidea/RxBluetoothKit/tree/master/ExampleApp">Sample App</a></li>
<li><a href="https://gitter.im/RxBLELibraries/RxBluetoothKit?utm_source=share-link&utm_medium=link&utm_campaign=share-link">Gitter channel</a> if you want to talk about it, ask questions or give feedback.</li>
<li><a href="http://stackoverflow.com/questions/tagged/rxiosble?sort=active">StackOverflow</a> if you have a problem</li>
<li>Or open <a href="https://github.com/Polidea/RxBluetoothKit/issues/new">an issue</a> on GitHub</li>
</ul>
<p>Remember to follow <a href="https://www.polidea.com/blog/RxBluetoothKit_The_most_simple_way_to_code_BLE_devices/?utm_source=Github&utm_medium=Npaid&utm_campaign=Blog&utm_term=Article&utm_content=GH_NOP_BLG_ART_BLD01">Polidea’s Blog</a> blog to get all the news and updates!</p>
<p><a href="https://www.polidea.com/project/?utm_source=Github&utm_medium=Npaid&utm_campaign=Kontakt&utm_term=Code&utm_content=GH_NOP_KKT_COD_RBK001">Contact us</a></p>
<p>Learn more about Polidea’s BLE services <a href="https://www.polidea.com/services/ble/?utm_source=Github&utm_medium=Npaid&utm_campaign=Tech_BLE&utm_term=Code&utm_content=GH_NOP_BLE_COD_RBK001">here</a>.</p>
<h1 id='requirements' class='heading'>Requirements</h1>
<ul>
<li>iOS 9.0+</li>
<li>OSX 10.13+</li>
<li>watchOS 4.0+</li>
<li>tvOS 11.0+</li>
<li>Xcode 11.4+</li>
</ul>
<h2 id='swift-versions' class='heading'>Swift versions</h2>
<ul>
<li>3.0 version supports Swift 3.0 and 3.1</li>
<li>5.0 version supports Swift 3.2 and 4.0</li>
<li>5.1.2 version supports Swift 4.1</li>
<li>5.2 version supports Swift 5.0 and 4.2</li>
</ul>
</section>
</section>
<section id="footer">
<p>© 2020 <a class="link" href="https://polidea.com" target="_blank" rel="external">Polidea</a>. All rights reserved. (Last updated: 2020-09-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.5</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>