Skip to content

Commit

Permalink
Merge pull request #7 from schoolpost/libraryfix
Browse files Browse the repository at this point in the history
arduino esp32 1.0.5 library fix
  • Loading branch information
schoolpost authored Mar 6, 2021
2 parents f3947f4 + 7015aa8 commit 99d89f7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"*.yaml": "home-assistant"
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BlueMagic32

![](https://img.shields.io/badge/Version-1.0.1-green.svg) ![](https://img.shields.io/badge/BlackmagicCameraControl-1.3-green.svg)
![](https://img.shields.io/badge/Version-1.0.2-green.svg) ![](https://img.shields.io/badge/BlackmagicCameraControl-1.3-green.svg) ![](https://img.shields.io/badge/arduino--esp32-1.0.5-green.svg)

Arduino ESP32 Library for connecting to Blackmagic Cameras using Bluetooth Low Energy.

Expand Down
13 changes: 7 additions & 6 deletions src/BlueMagicCameraConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,6 @@ class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks
{
advertisedDevice.getScan()->stop();
}
else
{
advertisedDevice.getScan()->erase(advertisedDevice.getAddress());
}
}
};

Expand Down Expand Up @@ -405,8 +401,13 @@ BlueMagicCameraController *BlueMagicCameraConnection::connect(uint8_t index)

if (scanned)
{
address = _bleScan->getResults().getDevice(index).getAddress();
ok = connectToServer(address);
int count = _bleScan->getResults().getCount();
if (count > 0)
{
int foundIndex = count - 1;
address = _bleScan->getResults().getDevice(foundIndex).getAddress();
ok = connectToServer(address);
}
}
else
{
Expand Down

0 comments on commit 99d89f7

Please sign in to comment.