@@ -15,18 +15,17 @@ limitations under the License.
15
15
16
16
/*
17
17
* @author Rikard Lindstrom <rlindsrom@google.com>
18
+ *
18
19
*/
19
20
20
21
#define VERSION 5
21
22
#define FLOAT_BYTE_SIZE 4
22
23
23
- // #include <ArduinoBLE.h>
24
-
25
24
#include < Arduino.h>
26
25
#include < Adafruit_NeoPixel.h>
27
26
#include < bluefruit.h>
28
27
29
- // #include "ble_file_transfer.h"
28
+ #include " ble_file_transfer.h"
30
29
#include " model_tester.h"
31
30
#include " data_provider.h"
32
31
@@ -186,11 +185,7 @@ void updateLed()
186
185
case IDLE_DISCONNECTED:
187
186
case IDLE_CONNECTED:
188
187
default :
189
- #if 0
190
- if (BLE.connected())
191
- #else
192
- if (1 )
193
- #endif
188
+ if (Bluefruit.connected ())
194
189
{
195
190
rgbLedBlue ();
196
191
}
@@ -439,7 +434,7 @@ void setup()
439
434
}
440
435
441
436
Bluefruit.autoConnLed (true );
442
- Bluefruit.configUuid128Count (20 );
437
+ Bluefruit.configUuid128Count (25 );
443
438
Bluefruit.configPrphBandwidth (BANDWIDTH_MAX);
444
439
Bluefruit.begin ();
445
440
Bluefruit.setTxPower (4 );
@@ -479,7 +474,7 @@ void setup()
479
474
uint8_t mac[6 ];
480
475
char mac_str[20 ];
481
476
Bluefruit.getAddr (mac);
482
- sprintf (mac_str, " %02X:%02X:%02X:%02X:%02X:%02X " , mac[5 ], mac[4 ], mac[3 ], mac[2 ], mac[1 ], mac[0 ]);
477
+ sprintf (mac_str, " %02x:%02x:%02x:%02x:%02x:%02x " , mac[5 ], mac[4 ], mac[3 ], mac[2 ], mac[1 ], mac[0 ]);
483
478
484
479
String address (mac_str);
485
480
@@ -519,24 +514,18 @@ void setup()
519
514
Bluefruit.Advertising .setFastTimeout (30 ); // number of seconds in fast mode
520
515
Bluefruit.Advertising .start (0 ); // 0 = Don't stop advertising after n seconds
521
516
522
- #if 0
523
517
ble_file_transfer::setupBLEFileTransfer (service);
524
518
525
519
// Print out full UUID and MAC address.
526
520
Serial.println (" Peripheral advertising info: " );
527
521
Serial.print (" Name: " );
528
522
Serial.println (LOCAL_NAME);
529
523
Serial.print (" MAC: " );
530
- Serial.println(BLE.address() );
524
+ Serial.println (mac_str );
531
525
Serial.print (" Service UUID: " );
532
- Serial.println(service.uuid());
533
-
534
- // Start up the service itself.
535
- BLE.addService(service);
536
- BLE.advertise();
526
+ Serial.println (service.uuid .toString ());
537
527
538
528
Serial.println (" Bluetooth device active, waiting for connections..." );
539
- #endif
540
529
541
530
// Broadcast sketch version
542
531
versionTxChar.write8 (VERSION);
0 commit comments