diff options
author | Sven Gothel <[email protected]> | 2020-07-26 08:02:00 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-07-26 08:02:00 +0200 |
commit | a248a7671a0189175070fa1d46c329dc48bf5877 (patch) | |
tree | 7a6c109053af2f7b20b0a6ec650f59208bbd8756 /src | |
parent | aac1c44171b525283d75874ca231e6d3e165350f (diff) |
GATTCharacteristic::toSafeString(): Remove further dereferencing to service...
Diffstat (limited to 'src')
-rw-r--r-- | src/direct_bt/GATTCharacteristic.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/direct_bt/GATTCharacteristic.cpp b/src/direct_bt/GATTCharacteristic.cpp index 13131d48..1bb3d2b1 100644 --- a/src/direct_bt/GATTCharacteristic.cpp +++ b/src/direct_bt/GATTCharacteristic.cpp @@ -139,21 +139,8 @@ std::string GATTCharacteristic::toString() const { } std::string GATTCharacteristic::toSafeString() const { - std::shared_ptr<const uuid_t> service_uuid; - uint16_t service_handle_end = 0xffff; - GATTServiceRef serviceRef = getServiceUnchecked(); - std::string service_name = ""; std::string char_name = ""; - if( nullptr != serviceRef ) { - service_uuid = serviceRef->type; - service_handle_end = serviceRef->endHandle; - - if( uuid_t::UUID16_SZ == service_uuid->getTypeSize() ) { - const uint16_t uuid16 = (static_cast<const uuid16_t*>(service_uuid.get()))->value; - service_name = ", "+GattServiceTypeToString(static_cast<GattServiceType>(uuid16)); - } - } if( uuid_t::UUID16_SZ == value_type->getTypeSize() ) { const uint16_t uuid16 = (static_cast<const uuid16_t*>(value_type.get()))->value; char_name = ", "+GattCharacteristicTypeToString(static_cast<GattCharacteristicType>(uuid16)); @@ -161,8 +148,8 @@ std::string GATTCharacteristic::toSafeString() const { return "handle "+uint16HexString(handle)+", props "+uint8HexString(properties)+" "+getPropertiesString()+ ", value[handle "+uint16HexString(value_handle)+char_name+ "], service["+ - ", handle[ "+uint16HexString(service_handle)+".."+uint16HexString(service_handle_end)+" ]"+ - service_name+", enabled[notify "+std::to_string(enabledNotifyState)+", indicate "+std::to_string(enabledIndicateState)+"] ]"; + ", handle[ "+uint16HexString(service_handle)+".. ]"+ + ", enabled[notify "+std::to_string(enabledNotifyState)+", indicate "+std::to_string(enabledIndicateState)+"] ]"; } std::shared_ptr<GATTService> GATTCharacteristic::getServiceChecked() const { |