aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/direct_bt_scanner00/dbt_scanner00.cpp2
-rw-r--r--examples/direct_bt_scanner01/dbt_scanner01.cpp7
-rw-r--r--examples/direct_bt_scanner10/dbt_scanner10.cpp2
3 files changed, 5 insertions, 6 deletions
diff --git a/examples/direct_bt_scanner00/dbt_scanner00.cpp b/examples/direct_bt_scanner00/dbt_scanner00.cpp
index 63eb61c4..5cf9f996 100644
--- a/examples/direct_bt_scanner00/dbt_scanner00.cpp
+++ b/examples/direct_bt_scanner00/dbt_scanner00.cpp
@@ -267,7 +267,7 @@ int main(int argc, char *argv[])
}
{
std::shared_ptr<GATTHandler> gatt = device->getGATTHandler();
- if( nullptr != gatt && gatt->isOpen() ) {
+ if( nullptr != gatt && gatt->getIsConnected() ) {
std::shared_ptr<DeviceInformation> di = gatt->getDeviceInformation(primServices);
if( nullptr != di ) {
fprintf(stderr, " DeviceInformation: %s\n\n", di->toString().c_str());
diff --git a/examples/direct_bt_scanner01/dbt_scanner01.cpp b/examples/direct_bt_scanner01/dbt_scanner01.cpp
index 653e5eab..4d791050 100644
--- a/examples/direct_bt_scanner01/dbt_scanner01.cpp
+++ b/examples/direct_bt_scanner01/dbt_scanner01.cpp
@@ -277,19 +277,19 @@ int main(int argc, char *argv[])
if( nullptr != ga ) {
fprintf(stderr, " GenericAccess: %s\n\n", ga->toString().c_str());
}
- if( nullptr != gatt && gatt->isOpen() ) {
+ if( nullptr != gatt && gatt->getIsConnected() ) {
std::shared_ptr<DeviceInformation> di = gatt->getDeviceInformation(primServices);
if( nullptr != di ) {
fprintf(stderr, " DeviceInformation: %s\n\n", di->toString().c_str());
}
}
- for(size_t i=0; i<primServices.size() && gatt->isOpen(); i++) {
+ for(size_t i=0; i<primServices.size() && gatt->getIsConnected(); i++) {
GATTService & primService = *primServices.at(i);
fprintf(stderr, " [%2.2d] Service %s\n", (int)i, primService.toString().c_str());
fprintf(stderr, " [%2.2d] Service Characteristics\n", (int)i);
std::vector<GATTCharacteristicRef> & serviceCharacteristics = primService.characteristicList;
- for(size_t j=0; j<serviceCharacteristics.size() && gatt->isOpen(); j++) {
+ for(size_t j=0; j<serviceCharacteristics.size() && gatt->getIsConnected(); j++) {
GATTCharacteristic & serviceChar = *serviceCharacteristics.at(j);
fprintf(stderr, " [%2.2d.%2.2d] Decla: %s\n", (int)i, (int)j, serviceChar.toString().c_str());
if( serviceChar.hasProperties(GATTCharacteristic::PropertyBitVal::Read) ) {
@@ -312,7 +312,6 @@ int main(int argc, char *argv[])
}
// FIXME sleep 1s for potential callbacks ..
sleep(1);
- device->disconnectGATT(); // redundant: also done at gatt->disconnect()
} else {
fprintf(stderr, "GATT connect failed: %s\n", gatt->getStateString().c_str());
}
diff --git a/examples/direct_bt_scanner10/dbt_scanner10.cpp b/examples/direct_bt_scanner10/dbt_scanner10.cpp
index 1a0bbf5a..20a0c7ee 100644
--- a/examples/direct_bt_scanner10/dbt_scanner10.cpp
+++ b/examples/direct_bt_scanner10/dbt_scanner10.cpp
@@ -307,7 +307,7 @@ static void processConnectedDevice(std::shared_ptr<DBTDevice> device) {
}
{
std::shared_ptr<GATTHandler> gatt = device->getGATTHandler();
- if( nullptr != gatt && gatt->isOpen() ) {
+ if( nullptr != gatt && gatt->getIsConnected() ) {
std::shared_ptr<DeviceInformation> di = gatt->getDeviceInformation(primServices);
if( nullptr != di && !SILENT_GATT ) {
fprintf(stderr, " DeviceInformation: %s\n\n", di->toString().c_str());