Skip to content

Commit 45bddd8

Browse files
committed
Corrected the MIDIBLE example so it advertises correctly
1 parent 6219491 commit 45bddd8

File tree

1 file changed

+6
-5
lines changed
  • libraries/CurieBLE/examples/peripheral/MIDIBLE

1 file changed

+6
-5
lines changed

libraries/CurieBLE/examples/peripheral/MIDIBLE/MIDIBLE.ino

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,17 @@ void noteOff(char chan, char note) //channel 1
8989
BLEService midiSvc("03B80E5A-EDE8-4B33-A751-6CE34EC4C700"); // create service
9090

9191
// create switch characteristic and allow remote device to read and write
92-
BLECharacteristic midiChar("7772E5DB-3868-4112-A1A9-F2669D106BF3", BLEWrite | BLEWriteWithoutResponse | BLENotify | BLERead,5);
92+
BLECharacteristic midiChar("7772E5DB-3868-4112-A1A9-F2669D106BF3", BLEWrite | BLEWriteWithoutResponse | BLENotify | BLERead, 5);
9393

9494
void setup() {
9595
Serial.begin(9600);
9696

9797
BLESetup();
98-
// advertise the service
9998

99+
// advertise the service
100+
BLE.advertise();
100101
Serial.println(("Bluetooth device active, waiting for connections..."));
102+
101103
}
102104

103105
void BLESetup()
@@ -110,7 +112,7 @@ void BLESetup()
110112
BLE.setAdvertisedServiceUuid(midiSvc.uuid());
111113

112114
// add service and characteristic
113-
115+
114116
midiSvc.addCharacteristic(midiChar);
115117
BLE.addService(midiSvc);
116118

@@ -123,7 +125,6 @@ void BLESetup()
123125
// set an initial value for the characteristic
124126
midiChar.setValue(midiData, 5);
125127

126-
127128
}
128129

129130
void loop() {
@@ -158,4 +159,4 @@ void midiDeviceDisconnectHandler(BLEDevice central) {
158159
void midiCharacteristicWritten(BLEDevice central, BLECharacteristic characteristic) {
159160
// central wrote new value to characteristic, update LED
160161
Serial.print("Characteristic event, written: ");
161-
}
162+
}

0 commit comments

Comments
 (0)