Skip to content

Commit 68a598c

Browse files
committed
Fix lib name conflict: BLEPeripheral => BLEPeripheralObserver.
1 parent 29b4b6d commit 68a598c

42 files changed

Lines changed: 450 additions & 451 deletions

Some content is hidden

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

API.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# BLEPeripheral
1+
# BLEPeripheralObserver
22

33
## Constructor
4-
Creates the BLEPeripheral object. Pin Arguments are optional as pins are self detecting. See https://github.com/sandeepmistry/arduino-BLEPeripheral#pinouts
4+
Creates the BLEPeripheralObserver object. Pin Arguments are optional as pins are self detecting. See https://github.com/sandeepmistry/arduino-BLEPeripheral#pinouts
55

66
```c
7-
BLEPeripheral(unsigned char req = BLE_DEFAULT_REQ, unsigned char rdy = BLE_DEFAULT_RDY, unsigned char rst = BLE_DEFAULT_RST);
7+
BLEPeripheralObserver(unsigned char req = BLE_DEFAULT_REQ, unsigned char rdy = BLE_DEFAULT_RDY, unsigned char rst = BLE_DEFAULT_RST);
88
```
99
* req - REQ pin
1010
* rdy - RDY pin
@@ -45,7 +45,7 @@ void setAdvertisingInterval(unsigned short advertisingInterval);
4545
Sets the connection interval to use after a connection has been established.
4646
4747
```c
48-
void setConnectionInterval(unsigned short minimumConnectionInterval, unsigned short maximumConnectionInterval);
48+
void setConnectionInterval(unsigned short minimumConnectionInterval, unsigned short maximumConnectionInterval);
4949
```
5050

5151
* minimumConnectionInterval - minimum connection interval in 1.25 ms increments

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Arduino BLEPeripheral
1+
# Arduino BLEPeripheralObserver
22

33
[![Build Status](https://travis-ci.org/sandeepmistry/arduino-BLEPeripheral.svg?branch=master)](https://travis-ci.org/sandeepmistry/arduino-BLEPeripheral) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sandeepmistry/arduino-BLEPeripheral?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44

@@ -15,7 +15,7 @@ This is heavily based on @sandeepmistry's [arduino-BLEPeripheral](https://github
1515
* [nRF51822](http://redbearlab.com/redbearlab-nrf51822)
1616
* [BLE Nano](http://redbearlab.com/blenano/)
1717
* [RFduino](http://www.rfduino.com) with [Arduino Add-on](https://github.com/RFduino/RFduino)
18-
18+
1919
**WARNING**: Adafruit nRF51 boards are **NOT** compatible with this library, this includes the [Bluefruit LE UART Friend](https://www.adafruit.com/products/2479), [Bluefruit LE SPI Friend](https://www.adafruit.com/products/2633), [Bluefruit LE Shield](https://www.adafruit.com/products/2746), [Flora Wearable Bluefruit LE Module](https://www.adafruit.com/products/2487), [Feather 32u4 Bluefruit LE](https://www.adafruit.com/products/2829), and [Feather M0 Bluefruit LE](https://www.adafruit.com/products/2995).
2020

2121
### Nordic Semiconductor nRF51 or nRF52 based boards

examples/HID/HID_joystick_mouse/HID_joystick_mouse.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Sandeep Mistry. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
// Import libraries (BLEPeripheral depends on SPI)
4+
// Import libraries (BLEPeripheralObserver depends on SPI)
55
#include <SPI.h>
66
#include <BLEHIDPeripheral.h>
77
#include <BLEMouse.h>

examples/HID/HID_keyboard/HID_keyboard.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Sandeep Mistry. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
// Import libraries (BLEPeripheral depends on SPI)
4+
// Import libraries (BLEPeripheralObserver depends on SPI)
55
#include <SPI.h>
66
#include <BLEHIDPeripheral.h>
77
#include <BLEKeyboard.h>

examples/HID/HID_keypad/HID_keypad.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Sandeep Mistry. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
// Import libraries (BLEPeripheral depends on SPI)
4+
// Import libraries (BLEPeripheralObserver depends on SPI)
55
#include <SPI.h>
66
#include <BLEHIDPeripheral.h>
77
#include <BLEKeyboard.h>

examples/HID/HID_test/HID_test.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Sandeep Mistry. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
// Import libraries (BLEPeripheral depends on SPI)
4+
// Import libraries (BLEPeripheralObserver depends on SPI)
55
#include <SPI.h>
66
#include <BLEHIDPeripheral.h>
77
#include <BLEMouse.h>

examples/HID/HID_volume/HID_volume.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Sandeep Mistry. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
// Import libraries (BLEPeripheral depends on SPI)
4+
// Import libraries (BLEPeripheralObserver depends on SPI)
55
#include <SPI.h>
66
#include <BLEHIDPeripheral.h>
77
#include <BLEMultimedia.h>

examples/ancs/ancs.ino

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Copyright (c) Sandeep Mistry. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
// Import libraries (BLEPeripheral depends on SPI)
4+
// Import libraries (BLEPeripheralObserver depends on SPI)
55
#include <SPI.h>
6-
#include <BLEPeripheral.h>
6+
#include <BLEPeripheralObserver.h>
77

88
#include <BLEUtil.h>
99

10-
//custom boards may override default pin definitions with BLEPeripheral(PIN_REQ, PIN_RDY, PIN_RST)
11-
BLEPeripheral blePeripheral = BLEPeripheral();
10+
//custom boards may override default pin definitions with BLEPeripheralObserver(PIN_REQ, PIN_RDY, PIN_RST)
11+
BLEPeripheralObserver blePeriphObserv = BLEPeripheralObserver();
1212
BLEBondStore bleBondStore;
1313

1414
// remote services
@@ -29,38 +29,38 @@ void setup() {
2929
// clears bond data on every boot
3030
bleBondStore.clearData();
3131

32-
blePeripheral.setBondStore(bleBondStore);
32+
blePeriphObserv.setBondStore(bleBondStore);
3333

34-
blePeripheral.setServiceSolicitationUuid(ancsService.uuid());
35-
blePeripheral.setLocalName("ANCS");
34+
blePeriphObserv.setServiceSolicitationUuid(ancsService.uuid());
35+
blePeriphObserv.setLocalName("ANCS");
3636

3737
// set device name and appearance
38-
blePeripheral.setDeviceName("Arduino ANCS");
39-
blePeripheral.setAppearance(0x0080);
38+
blePeriphObserv.setDeviceName("Arduino ANCS");
39+
blePeriphObserv.setAppearance(0x0080);
4040

41-
blePeripheral.addRemoteAttribute(ancsService);
42-
blePeripheral.addRemoteAttribute(ancsNotificationSourceCharacteristic);
43-
// blePeripheral.addRemoteAttribute(ancsControlPointCharacteristic);
44-
// blePeripheral.addRemoteAttribute(ancsDataSourceCharacteristic);
41+
blePeriphObserv.addRemoteAttribute(ancsService);
42+
blePeriphObserv.addRemoteAttribute(ancsNotificationSourceCharacteristic);
43+
// blePeriphObserv.addRemoteAttribute(ancsControlPointCharacteristic);
44+
// blePeriphObserv.addRemoteAttribute(ancsDataSourceCharacteristic);
4545

4646
// assign event handlers for connected, disconnected to peripheral
47-
blePeripheral.setEventHandler(BLEConnected, blePeripheralConnectHandler);
48-
blePeripheral.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);
49-
blePeripheral.setEventHandler(BLEBonded, blePeripheralBondedHandler);
50-
blePeripheral.setEventHandler(BLERemoteServicesDiscovered, blePeripheralRemoteServicesDiscoveredHandler);
47+
blePeriphObserv.setEventHandler(BLEConnected, blePeripheralConnectHandler);
48+
blePeriphObserv.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);
49+
blePeriphObserv.setEventHandler(BLEBonded, blePeripheralBondedHandler);
50+
blePeriphObserv.setEventHandler(BLERemoteServicesDiscovered, blePeripheralRemoteServicesDiscoveredHandler);
5151

5252
// assign event handlers for characteristic
5353
ancsNotificationSourceCharacteristic.setEventHandler(BLEValueUpdated, ancsNotificationSourceCharacteristicValueUpdated);
5454
// ancsDataSourceCharacteristic.setEventHandler(BLEValueUpdated, ancsDataSourceCharacteristicCharacteristicValueUpdated);
5555

5656
// begin initialization
57-
blePeripheral.begin();
57+
blePeriphObserv.begin();
5858

5959
Serial.println(F("BLE Peripheral - ANCS"));
6060
}
6161

6262
void loop() {
63-
blePeripheral.poll();
63+
blePeriphObserv.poll();
6464
}
6565

6666
void blePeripheralConnectHandler(BLECentral& central) {

examples/iBeacon/iBeacon.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Sandeep Mistry. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
#include <BLEPeripheral.h>
4+
#include <BLEPeripheralObserver.h>
55
#include <iBeacon.h>
66

77
#if !defined(NRF51) && !defined(NRF52) && !defined(__RFduino__)

examples/ir_bridge/ir_bridge.ino

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Sandeep Mistry. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
// Import libraries (BLEPeripheral depends on SPI)
4+
// Import libraries (BLEPeripheralObserver depends on SPI)
55
#include <SPI.h>
6-
#include <BLEPeripheral.h>
6+
#include <BLEPeripheralObserver.h>
77

88
// https://github.com/shirriff/Arduino-IRremote
99
#include <IRremote.h>
@@ -25,8 +25,8 @@ IRsend irSend = IRsend(/*IR_SEND_
2525
IRrecv irRecv = IRrecv(IR_RECV_PIN);
2626
IRValue irValue;
2727

28-
//custom boards may override default pin definitions with BLEPeripheral(PIN_REQ, PIN_RDY, PIN_RST)
29-
BLEPeripheral blePeripheral = BLEPeripheral();
28+
//custom boards may override default pin definitions with BLEPeripheralObserver(PIN_REQ, PIN_RDY, PIN_RST)
29+
BLEPeripheralObserver blePeriphObserv = BLEPeripheralObserver();
3030

3131
// create service and characteristics
3232
BLEService irService = BLEService("00004952-0000-bbbb-0123-456789abcdef");
@@ -38,20 +38,20 @@ void setup() {
3838
Serial.begin(115200);
3939

4040
// set advertised local name and service UUID
41-
blePeripheral.setLocalName("IR");
42-
blePeripheral.setAdvertisedServiceUuid(irService.uuid());
41+
blePeriphObserv.setLocalName("IR");
42+
blePeriphObserv.setAdvertisedServiceUuid(irService.uuid());
4343

4444
// add service and characteristics
45-
blePeripheral.addAttribute(irService);
46-
blePeripheral.addAttribute(irOutputCharacteristic);
47-
blePeripheral.addAttribute(irInputCharacteristic);
45+
blePeriphObserv.addAttribute(irService);
46+
blePeriphObserv.addAttribute(irOutputCharacteristic);
47+
blePeriphObserv.addAttribute(irInputCharacteristic);
4848

4949
// assign event handlers for connected, disconnected to peripheral
50-
blePeripheral.setEventHandler(BLEConnected, blePeripheralConnectHandler);
51-
blePeripheral.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);
50+
blePeriphObserv.setEventHandler(BLEConnected, blePeripheralConnectHandler);
51+
blePeriphObserv.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);
5252

5353
// begin initialization
54-
blePeripheral.begin();
54+
blePeriphObserv.begin();
5555

5656
Serial.println(F("BLE IR Peripheral"));
5757

@@ -63,7 +63,7 @@ void setup() {
6363

6464
void loop() {
6565
// poll peripheral
66-
blePeripheral.poll();
66+
blePeriphObserv.poll();
6767

6868
// poll the ouput characteristic
6969
pollIrOutput();

0 commit comments

Comments
 (0)