Skip to content

Commit 266eccf

Browse files
committed
0.3.1
1 parent 0f73d46 commit 266eccf

File tree

4 files changed

+47
-41
lines changed

4 files changed

+47
-41
lines changed

CHANGES.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
= 0.3.1 =
2+
Add support for Laird BL600 #71
3+
Add unsubscribe for iOS #66
4+
15
= 0.3.0 =
26
Add support for Adafruit Bluefruit LE http://adafru.it/1697
37
Use RedBear Lab BLE 2.0.1 - supports for v1 and v2 of the shield in addition to BLEmini
48
Show RSSI for discovered BLE devices, when available
59
Add readRSSI api (BLE only)
610

711
Fixes issues #4, #5, #23, #24, #25, #26, #38, #54
8-
9-

LICENSE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2013 Don Coleman
1+
Copyright 2013-4 Don Coleman
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
@@ -10,4 +10,4 @@ Unless required by applicable law or agreed to in writing, software
1010
distributed under the License is distributed on an "AS IS" BASIS,
1111
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
13-
limitations under the License.
13+
limitations under the License.

README.md

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@ Android uses Classic Bluetooth. iOS uses Bluetooth Low Energy.
77
## Supported Platforms
88

99
* Android
10-
* iOS with [BLEMini](http://redbearlab.com/blemini), [BLEShield](http://redbearlab.com/bleshield/) or [Adafruit Bluefruit LE](http://www.adafruit.com/products/1697)
11-
10+
* iOS with [RedBearLab](http://redbearlab.com) BLE hardware, [Adafruit Bluefruit LE](http://www.adafruit.com/products/1697), or [Laird BL600](http://www.lairdtech.com/Products/Embedded-Wireless-Solutions/Bluetooth-Radio-Modules/BL600-Series/#.VBI7AS5dUzI)
11+
1212
[Supporting other Bluetooth Low Energy hardware](#supporting-other-ble-hardware)
1313

1414
## Limitations
1515

1616
* The phone must initiate the Bluetooth connection
1717
* Data sent over the connection is assumed to be Strings
1818
* iOS Bluetooth Low Energy requires iPhone 4S, iPhone5, iPod 5, or iPad3+
19+
* Will *not* connect Android to Android
20+
* Will *not* connect iOS to iOS[*](https://github.com/don/BluetoothSerial/issues/75#issuecomment-52591397)
1921

20-
# Installing
22+
# Installing
2123

2224
Install with Cordova cli
2325

24-
$ cordova plugin add https://github.com/don/BluetoothSerial.git
25-
26-
This plugin is also available for [PhoneGap Build](https://build.phonegap.com/plugins/23)
26+
$ cordova plugin add com.megster.cordova.bluetoothSerial
27+
28+
This plugin is also available for [PhoneGap Build](https://build.phonegap.com/plugins/366)
2729

2830
# Examples
2931

@@ -66,8 +68,8 @@ For iOS, `connect` takes the UUID of the remote device. Optionally, you can pas
6668

6769
### Parameters
6870

69-
- __macAddress_or_uuid__: Identifier of the remote device.
70-
- __connectSuccess__: Success callback function that is invoked when the connection is successful.
71+
- __macAddress_or_uuid__: Identifier of the remote device.
72+
- __connectSuccess__: Success callback function that is invoked when the connection is successful.
7173
- __connectFailure__: Error callback function, invoked when error occurs or the connection disconnects.
7274

7375
## connectInsecure
@@ -88,8 +90,8 @@ For Android, `connectInsecure` takes a macAddress of the remote device.
8890

8991
### Parameters
9092

91-
- __macAddress__: Identifier of the remote device.
92-
- __connectSuccess__: Success callback function that is invoked when the connection is successful.
93+
- __macAddress__: Identifier of the remote device.
94+
- __connectSuccess__: Success callback function that is invoked when the connection is successful.
9395
- __connectFailure__: Error callback function, invoked when error occurs or the connection disconnects.
9496

9597

@@ -186,8 +188,8 @@ Function `readUntil` reads the data from the buffer until it reaches a delimiter
186188
bluetoothSerial.readUntil('\n', function (data) {
187189
console.log(data);
188190
}, failure);
189-
190-
## subscribe
191+
192+
## subscribe
191193

192194
Subscribe to be notified when data is received.
193195

@@ -249,7 +251,7 @@ Function `clear` removes any data from the receive buffer.
249251
Lists bonded devices
250252

251253
bluetoothSerial.list(success, failure);
252-
254+
253255
### Description
254256

255257
#### Android
@@ -260,32 +262,32 @@ Example list passed to success callback. See [BluetoothDevice](http://developer
260262

261263
[{
262264
"class": 276,
263-
"id": "10:BF:48:CB:00:00",
265+
"id": "10:BF:48:CB:00:00",
264266
"address": "10:BF:48:CB:00:00",
265267
"name": "Nexus 7"
266268
}, {
267269
"class": 7936,
268-
"id": "00:06:66:4D:00:00",
270+
"id": "00:06:66:4D:00:00",
269271
"address": "00:06:66:4D:00:00",
270272
"name": "RN42"
271273
}]
272-
274+
273275
#### iOS
274276

275277
Function `list` lists the discovered Bluetooth Low Energy peripheral. The success callback is called with a list of objects.
276278

277279
Example list passed to success callback for iOS.
278280

279281
[{
280-
"id": "CC410A23-2865-F03E-FC6A-4C17E858E11E",
282+
"id": "CC410A23-2865-F03E-FC6A-4C17E858E11E",
281283
"uuid": "CC410A23-2865-F03E-FC6A-4C17E858E11E",
282284
"name": "Biscuit",
283285
"rssi": -68
284286
}]
285-
287+
286288
The advertised RSSI **may** be included if available.
287289

288-
`id` is the generic name for `uuid` or [mac]`address` so that code can be platform independent.
290+
`id` is the generic name for `uuid` or [mac]`address` so that code can be platform independent.
289291

290292
### Parameters
291293

@@ -299,10 +301,10 @@ The advertised RSSI **may** be included if available.
299301
console.log(device.id);
300302
})
301303
}, failure);
302-
304+
303305
## isConnected
304306

305-
Reports the connection status.
307+
Reports the connection status.
306308

307309
bluetoothSerial.isConnected(success, failure);
308310

@@ -318,14 +320,14 @@ Function `isConnected` calls the success callback when connected to a peer and t
318320
### Quick Example
319321

320322
bluetoothSerial.isConnected(
321-
function() {
323+
function() {
322324
console.log("Bluetooth is connected");
323325
},
324-
function() {
326+
function() {
325327
console.log("Bluetooth is *not* connected");
326328
}
327-
);
328-
329+
);
330+
329331
## isEnabled
330332

331333
Reports if bluetooth is enabled.
@@ -344,13 +346,13 @@ Function `isEnabled` calls the success callback when bluetooth is enabled and th
344346
### Quick Example
345347

346348
bluetoothSerial.isEnabled(
347-
function() {
349+
function() {
348350
console.log("Bluetooth is enabled");
349351
},
350-
function() {
352+
function() {
351353
console.log("Bluetooth is *not* enabled");
352354
}
353-
);
355+
);
354356

355357
## readRSSI
356358

@@ -372,15 +374,15 @@ Function `readRSSI` calls the success callback with the rssi.
372374
### Quick Example
373375

374376
bluetoothSerial.readRSSI(
375-
function(rssi) {
377+
function(rssi) {
376378
console.log(rssi);
377379
}
378-
);
380+
);
379381

380382

381383
# Misc
382384

383-
## Where does this work?
385+
## Where does this work?
384386

385387
### Android
386388

@@ -396,7 +398,7 @@ Development Devices include
396398
On the Arduino side I test with [Sparkfun Mate Silver](https://www.sparkfun.com/products/10393) and the [Seeed Studio Bluetooth Shield](http://www.seeedstudio.com/depot/bluetooth-shield-p-866.html?cPath=19_21). The code should be generic and work with most hardware.
397399

398400
I highly recommend [Adafruit's Bluefruit EZ-Link](http://www.adafruit.com/products/1588).
399-
401+
400402
### iOS
401403

402404
**NOTE: Currently iOS only works with RedBear Labs Hardware and Adafruit Bluefruit LE**
@@ -409,7 +411,7 @@ Ensure that you have update the BLE Mini firmware to at least [Biscuit-UART_2013
409411

410412
For Bluetooth Low Energy, this plugin supports the RedBear Labs hardware by default, but can support any Bluetooth Low Energy hardware with a "serial like" service. This means a transmit characteristic that is writable and a receive characteristic that supports notification.
411413

412-
Edit [BLEdefines.h](src/ios/BLEDefines.h) and adjust the UUIDs for your service.
414+
Edit [BLEdefines.h](src/ios/BLEDefines.h) and adjust the UUIDs for your service.
413415

414416
## Props
415417

@@ -429,11 +431,13 @@ The API for available, read, readUntil was influenced by the [BtSerial Library f
429431

430432
If you don't need **serial** over Bluetooth, try the [PhoneGap Bluetooth Plugin for Android](https://github.com/phonegap/phonegap-plugins/tree/DEPRECATED/Android/Bluetooth/2.2.0) or perhaps [phonegap-plugin-bluetooth](https://github.com/tanelih/phonegap-bluetooth-plugin).
431433

432-
If you need generic Bluetooth Low Energy support checkout Rand Dusing's [BluetoothLE](https://github.com/randdusing/BluetoothLE).
434+
If you need generic Bluetooth Low Energy support checkout my [Cordova BLE Plugin](https://github.com/don/cordova-plugin-ble-central).
435+
436+
If you need BLE for RFduino checkout my [RFduino Plugin](https://github.com/don/cordova-plugin-rfduino).
433437

434438
## What format should the Mac Address be in?
435439
An example a properly formatted mac address is ``AA:BB:CC:DD:EE:FF``
436440

437441
## Feedback
438-
442+
439443
Try the code. If you find an problem or missing feature, file an issue or create a pull request.

plugin.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
xmlns="http://www.phonegap.com/ns/plugins/1.0"
44
xmlns:android="http://schemas.android.com/apk/res/android"
55
id="com.megster.cordova.bluetoothserial"
6-
version="0.3.0">
6+
version="0.3.1">
77

88
<name>Bluetooth Serial</name>
99
<description>Bluetooth Serial Communication Plugin</description>
1010
<license>Apache 2.0</license>
11-
<keywords>bluetooth, arduino</keywords>
11+
<keywords>bluetooth, BLE, arduino</keywords>
1212
<repo>https://github.com/don/BluetoothSerial.git</repo>
1313
<issue>https://github.com/don/BluetoothSerial/issues</issue>
1414

0 commit comments

Comments
 (0)