tidy
This commit is contained in:
parent
02ec97d557
commit
451b71758a
@ -15,7 +15,6 @@ typedef struct
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
BLEDevice::init(""); // Initialize BLE device
|
||||
Serial.println("Scanning...");
|
||||
}
|
||||
|
||||
char currentName[128];
|
||||
@ -23,11 +22,14 @@ bool gotBasicInfo;
|
||||
bool gotCellInfo;
|
||||
|
||||
void loop() {
|
||||
Serial.printf("\r\n\r\n===============================\r\n\r\n");
|
||||
|
||||
Serial.println("Scanning...");
|
||||
|
||||
BLEScan* pBLEScan = BLEDevice::getScan(); // Create new scan
|
||||
pBLEScan->setActiveScan(true); // Active scan uses more power, but get results faster
|
||||
BLEScanResults foundDevices = pBLEScan->start(10); //seconds
|
||||
|
||||
Serial.println("Scanning completed");
|
||||
Serial.println("Devices found: " + String(foundDevices.getCount()));
|
||||
|
||||
for (int i = 0; i < foundDevices.getCount(); i++) {
|
||||
@ -42,7 +44,7 @@ void loop() {
|
||||
}
|
||||
|
||||
BLEClient* pClient = BLEDevice::createClient();
|
||||
Serial.println("Connecting to: " + String(advertisedDevice.getAddress().toString().c_str()));
|
||||
Serial.println("Connecting to: " + String(advertisedDevice.getName().c_str()));
|
||||
|
||||
if(!pClient->connect(&advertisedDevice)) {
|
||||
Serial.println("Failed to connect.");
|
||||
|
Loading…
Reference in New Issue
Block a user