summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-09-24 16:55:29 +0200
committerSven Gothel <[email protected]>2020-09-24 16:55:29 +0200
commita173e5203ed7dcc183a84c7af888afec3656c267 (patch)
treecd5fbf49612d7cd898322ae4070fd1abdf7087ee /examples
parent148c4a901c1d69e47364ba78465e25386be5cf97 (diff)
GATTNumbers: Concluding review: API doc, better naming, have optional data and erroneous missing data handle nicely (no crash)
Diffstat (limited to 'examples')
-rw-r--r--examples/direct_bt_scanner00/dbt_scanner00.cpp6
-rw-r--r--examples/direct_bt_scanner01/dbt_scanner01.cpp6
-rw-r--r--examples/direct_bt_scanner10/dbt_scanner10.cpp6
3 files changed, 9 insertions, 9 deletions
diff --git a/examples/direct_bt_scanner00/dbt_scanner00.cpp b/examples/direct_bt_scanner00/dbt_scanner00.cpp
index 20a033d0..df37a103 100644
--- a/examples/direct_bt_scanner00/dbt_scanner00.cpp
+++ b/examples/direct_bt_scanner00/dbt_scanner00.cpp
@@ -130,7 +130,7 @@ class MyGATTEventListener : public AssociatedGATTCharacteristicListener {
if( nullptr != charDecl ) {
fprintf(stderr, "****** decl %s\n", charDecl->toString().c_str());
if( _TEMPERATURE_MEASUREMENT == *charDecl->value_type ) {
- std::shared_ptr<TemperatureMeasurementCharateristic> temp = TemperatureMeasurementCharateristic::get(*charValue);
+ std::shared_ptr<GattTemperatureMeasurement> temp = GattTemperatureMeasurement::get(*charValue);
if( nullptr != temp ) {
fprintf(stderr, "****** valu %s\n", temp->toString().c_str());
}
@@ -261,14 +261,14 @@ int main(int argc, char *argv[])
" total %" PRIu64 " ms\n\n",
td15, (t5 - device->getCreationTimestamp()), td05);
}
- std::shared_ptr<GenericAccess> ga = device->getGATTGenericAccess();
+ std::shared_ptr<GattGenericAccessSvc> ga = device->getGATTGenericAccess();
if( nullptr != ga ) {
fprintf(stderr, " GenericAccess: %s\n\n", ga->toString().c_str());
}
{
std::shared_ptr<GATTHandler> gatt = device->getGATTHandler();
if( nullptr != gatt && gatt->isConnected() ) {
- std::shared_ptr<DeviceInformation> di = gatt->getDeviceInformation(primServices);
+ std::shared_ptr<GattDeviceInformationSvc> 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 b3ffb78f..655ea4a0 100644
--- a/examples/direct_bt_scanner01/dbt_scanner01.cpp
+++ b/examples/direct_bt_scanner01/dbt_scanner01.cpp
@@ -124,7 +124,7 @@ class MyGATTEventListener : public GATTCharacteristicListener {
if( nullptr != charDecl ) {
fprintf(stderr, "****** decl %s\n", charDecl->toString().c_str());
if( _TEMPERATURE_MEASUREMENT == *charDecl->value_type ) {
- std::shared_ptr<TemperatureMeasurementCharateristic> temp = TemperatureMeasurementCharateristic::get(*charValue);
+ std::shared_ptr<GattTemperatureMeasurement> temp = GattTemperatureMeasurement::get(*charValue);
if( nullptr != temp ) {
fprintf(stderr, "****** valu %s\n", temp->toString().c_str());
}
@@ -273,12 +273,12 @@ int main(int argc, char *argv[])
" total %" PRIu64 " ms\n\n",
td45, (t5 - device->getCreationTimestamp()), td05);
}
- std::shared_ptr<GenericAccess> ga = device->getGATTGenericAccess();
+ std::shared_ptr<GattGenericAccessSvc> ga = device->getGATTGenericAccess();
if( nullptr != ga ) {
fprintf(stderr, " GenericAccess: %s\n\n", ga->toString().c_str());
}
if( nullptr != gatt && gatt->isConnected() ) {
- std::shared_ptr<DeviceInformation> di = gatt->getDeviceInformation(primServices);
+ std::shared_ptr<GattDeviceInformationSvc> di = gatt->getDeviceInformation(primServices);
if( nullptr != di ) {
fprintf(stderr, " DeviceInformation: %s\n\n", di->toString().c_str());
}
diff --git a/examples/direct_bt_scanner10/dbt_scanner10.cpp b/examples/direct_bt_scanner10/dbt_scanner10.cpp
index 52245207..370e712c 100644
--- a/examples/direct_bt_scanner10/dbt_scanner10.cpp
+++ b/examples/direct_bt_scanner10/dbt_scanner10.cpp
@@ -256,7 +256,7 @@ class MyGATTEventListener : public AssociatedGATTCharacteristicListener {
if( nullptr != charDecl ) {
fprintf(stderr, "****** decl %s\n", charDecl->toString().c_str());
if( _TEMPERATURE_MEASUREMENT == *charDecl->value_type ) {
- std::shared_ptr<TemperatureMeasurementCharateristic> temp = TemperatureMeasurementCharateristic::get(*charValue);
+ std::shared_ptr<GattTemperatureMeasurement> temp = GattTemperatureMeasurement::get(*charValue);
if( nullptr != temp ) {
fprintf(stderr, "****** valu %s\n", temp->toString().c_str());
}
@@ -348,14 +348,14 @@ static void processConnectedDevice(std::shared_ptr<DBTDevice> device) {
"PERF: adapter-init to gatt-complete %" PRIu64 " ms\n\n",
td01, td15, tdc5, (tdc5 - td15), td05);
}
- std::shared_ptr<GenericAccess> ga = device->getGATTGenericAccess();
+ std::shared_ptr<GattGenericAccessSvc> ga = device->getGATTGenericAccess();
if( nullptr != ga && !SILENT_GATT ) {
fprintf(stderr, " GenericAccess: %s\n\n", ga->toString().c_str());
}
{
std::shared_ptr<GATTHandler> gatt = device->getGATTHandler();
if( nullptr != gatt && gatt->isConnected() ) {
- std::shared_ptr<DeviceInformation> di = gatt->getDeviceInformation(primServices);
+ std::shared_ptr<GattDeviceInformationSvc> di = gatt->getDeviceInformation(primServices);
if( nullptr != di && !SILENT_GATT ) {
fprintf(stderr, " DeviceInformation: %s\n\n", di->toString().c_str());
}