@@ -15,18 +15,17 @@ limitations under the License.
1515
1616/*
1717* @author Rikard Lindstrom <[email protected] > 18+ *
1819*/
1920
2021#define VERSION 5
2122#define FLOAT_BYTE_SIZE 4
2223
23- // #include <ArduinoBLE.h>
24-
2524#include < Arduino.h>
2625#include < Adafruit_NeoPixel.h>
2726#include < bluefruit.h>
2827
29- // #include "ble_file_transfer.h"
28+ #include " ble_file_transfer.h"
3029#include " model_tester.h"
3130#include " data_provider.h"
3231
@@ -186,11 +185,7 @@ void updateLed()
186185 case IDLE_DISCONNECTED:
187186 case IDLE_CONNECTED:
188187 default :
189- #if 0
190- if (BLE.connected())
191- #else
192- if (1 )
193- #endif
188+ if (Bluefruit.connected ())
194189 {
195190 rgbLedBlue ();
196191 }
@@ -439,7 +434,7 @@ void setup()
439434 }
440435
441436 Bluefruit.autoConnLed (true );
442- Bluefruit.configUuid128Count (20 );
437+ Bluefruit.configUuid128Count (25 );
443438 Bluefruit.configPrphBandwidth (BANDWIDTH_MAX);
444439 Bluefruit.begin ();
445440 Bluefruit.setTxPower (4 );
@@ -479,7 +474,7 @@ void setup()
479474 uint8_t mac[6 ];
480475 char mac_str[20 ];
481476 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 ]);
483478
484479 String address (mac_str);
485480
@@ -519,24 +514,18 @@ void setup()
519514 Bluefruit.Advertising .setFastTimeout (30 ); // number of seconds in fast mode
520515 Bluefruit.Advertising .start (0 ); // 0 = Don't stop advertising after n seconds
521516
522- #if 0
523517 ble_file_transfer::setupBLEFileTransfer (service);
524518
525519 // Print out full UUID and MAC address.
526520 Serial.println (" Peripheral advertising info: " );
527521 Serial.print (" Name: " );
528522 Serial.println (LOCAL_NAME);
529523 Serial.print (" MAC: " );
530- Serial.println(BLE.address() );
524+ Serial.println (mac_str );
531525 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 ());
537527
538528 Serial.println (" Bluetooth device active, waiting for connections..." );
539- #endif
540529
541530 // Broadcast sketch version
542531 versionTxChar.write8 (VERSION);
0 commit comments