diff options
author | Sven Gothel <[email protected]> | 2021-02-06 23:34:03 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-02-06 23:34:03 +0100 |
commit | 9dfcad8e80c80fcd8849ad2d399315848f208880 (patch) | |
tree | f15f3f46830d609572fc11fb5bb5dc247704b07c | |
parent | 87404c88aaacb664438d2215c82624b1a8192b0f (diff) |
Adapt to jau::bytesHexString(..)/<type>HexString(..): Removed leading0X argument: Unifying output.
-rw-r--r-- | api/direct_bt/ATTPDUTypes.hpp | 34 | ||||
-rw-r--r-- | api/direct_bt/HCITypes.hpp | 6 | ||||
-rw-r--r-- | api/direct_bt/MgmtTypes.hpp | 10 | ||||
-rw-r--r-- | api/direct_bt/SMPTypes.hpp | 16 | ||||
-rw-r--r-- | src/direct_bt/BTGattService.cpp | 4 | ||||
-rw-r--r-- | src/direct_bt/BTTypes0.cpp | 10 | ||||
-rw-r--r-- | src/direct_bt/GATTNumbers.cpp | 8 |
7 files changed, 44 insertions, 44 deletions
diff --git a/api/direct_bt/ATTPDUTypes.hpp b/api/direct_bt/ATTPDUTypes.hpp index b7f75f2e..af9408ed 100644 --- a/api/direct_bt/ATTPDUTypes.hpp +++ b/api/direct_bt/ATTPDUTypes.hpp @@ -373,22 +373,22 @@ namespace direct_bt { { const Opcode has = getOpcode(); if( expected != has ) { - throw AttOpcodeException("Has opcode "+jau::uint8HexString(number(has), true)+" "+getOpcodeString(has)+ - ", but expected "+jau::uint8HexString(number(expected), true)+" "+getOpcodeString(expected), E_FILE_LINE); + throw AttOpcodeException("Has opcode "+jau::uint8HexString(number(has))+" "+getOpcodeString(has)+ + ", but expected "+jau::uint8HexString(number(expected))+" "+getOpcodeString(expected), E_FILE_LINE); } } void checkOpcode(const Opcode exp1, const Opcode exp2) const { const Opcode has = getOpcode(); if( exp1 != has && exp2 != has ) { - throw AttOpcodeException("Has opcode "+jau::uint8HexString(number(has), true)+" "+getOpcodeString(has)+ - ", but expected either "+jau::uint8HexString(number(exp1), true)+" "+getOpcodeString(exp1)+ - " or "+jau::uint8HexString(number(exp1), true)+" "+getOpcodeString(exp1), E_FILE_LINE); + throw AttOpcodeException("Has opcode "+jau::uint8HexString(number(has))+" "+getOpcodeString(has)+ + ", but expected either "+jau::uint8HexString(number(exp1))+" "+getOpcodeString(exp1)+ + " or "+jau::uint8HexString(number(exp1))+" "+getOpcodeString(exp1), E_FILE_LINE); } } virtual std::string baseString() const noexcept { - return "opcode="+jau::uint8HexString(number(getOpcode()), true)+" "+getOpcodeString()+ + return "opcode="+jau::uint8HexString(number(getOpcode()))+" "+getOpcodeString()+ ", size[total="+std::to_string(pdu.getSize())+", param "+std::to_string(getPDUParamSize())+"]"; } virtual std::string valueString() const noexcept { @@ -631,7 +631,7 @@ namespace direct_bt { std::string getErrorString() const noexcept { const ErrorCode ec = getErrorCode(); - return jau::uint8HexString(number(ec), true) + ": " + getPlainErrorString(ec); + return jau::uint8HexString(number(ec)) + ": " + getPlainErrorString(ec); } std::string getName() const noexcept override { @@ -716,7 +716,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { - return "handle "+jau::uint16HexString(getHandle(), true); + return "handle "+jau::uint16HexString(getHandle()); } }; @@ -801,7 +801,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { - return "handle "+jau::uint16HexString(getHandle(), true)+", valueOffset "+jau::uint16HexString(getValueOffset(), true); + return "handle "+jau::uint16HexString(getHandle())+", valueOffset "+jau::uint16HexString(getValueOffset()); } }; @@ -894,7 +894,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { - return "handle "+jau::uint16HexString(getHandle(), true)+", data "+view.toString();; + return "handle "+jau::uint16HexString(getHandle())+", data "+view.toString();; } }; @@ -966,7 +966,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { - return "handle "+jau::uint16HexString(getHandle(), true)+", data "+view.toString();; + return "handle "+jau::uint16HexString(getHandle())+", data "+view.toString();; } }; @@ -1022,7 +1022,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { - return "handle "+jau::uint16HexString(getHandle(), true)+", size "+std::to_string(getPDUValueSize())+", data "+view.toString(); + return "handle "+jau::uint16HexString(getHandle())+", size "+std::to_string(getPDUValueSize())+", data "+view.toString(); } }; @@ -1157,7 +1157,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { - return "handle ["+jau::uint16HexString(getStartHandle(), true)+".."+jau::uint16HexString(getEndHandle(), true)+ + return "handle ["+jau::uint16HexString(getStartHandle())+".."+jau::uint16HexString(getEndHandle())+ "], uuid "+getNType()->toString(); } }; @@ -1207,7 +1207,7 @@ namespace direct_bt { jau::nsize_t getValueSize() const noexcept { return view.getSize() - 2 /* handle size */; } std::string toString() const { - return "handle "+jau::uint16HexString(getHandle(), true)+ + return "handle "+jau::uint16HexString(getHandle())+ ", data "+jau::bytesHexString(getValuePtr(), 0, getValueSize(), true /* lsbFirst */); } }; @@ -1370,7 +1370,7 @@ namespace direct_bt { protected: std::string elementString(const jau::nsize_t idx) const override { Element e = getElement(idx); - return "handle ["+jau::uint16HexString(e.getStartHandle(), true)+".."+jau::uint16HexString(e.getEndHandle(), true)+ + return "handle ["+jau::uint16HexString(e.getStartHandle())+".."+jau::uint16HexString(e.getEndHandle())+ "], data "+jau::bytesHexString(e.getValuePtr(), 0, e.getValueSize(), true /* lsbFirst */); } }; @@ -1412,7 +1412,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { - return "handle ["+jau::uint16HexString(getStartHandle(), true)+".."+jau::uint16HexString(getEndHandle(), true)+"]"; + return "handle ["+jau::uint16HexString(getStartHandle())+".."+jau::uint16HexString(getEndHandle())+"]"; } }; @@ -1513,7 +1513,7 @@ namespace direct_bt { std::string elementString(const jau::nsize_t idx) const override { Element e = getElement(idx); - return "handle "+jau::uint16HexString(e.handle, true)+ + return "handle "+jau::uint16HexString(e.handle)+ ", uuid "+e.uuid.get()->toString(); } }; diff --git a/api/direct_bt/HCITypes.hpp b/api/direct_bt/HCITypes.hpp index 3f42b623..8a091b3e 100644 --- a/api/direct_bt/HCITypes.hpp +++ b/api/direct_bt/HCITypes.hpp @@ -880,9 +880,9 @@ namespace direct_bt { protected: std::string baseString() const noexcept override { return HCIEvent::baseString()+ - ", status "+jau::uint8HexString(static_cast<uint8_t>(getStatus()), true)+" "+getHCIStatusCodeString(getStatus())+ + ", status "+jau::uint8HexString(static_cast<uint8_t>(getStatus()))+" "+getHCIStatusCodeString(getStatus())+ ", handle "+jau::uint16HexString(getHandle())+ - ", reason "+jau::uint8HexString(static_cast<uint8_t>(getReason()), true)+" "+getHCIStatusCodeString(getReason()); + ", reason "+jau::uint8HexString(static_cast<uint8_t>(getReason()))+" "+getHCIStatusCodeString(getReason()); } public: @@ -963,7 +963,7 @@ namespace direct_bt { return HCIEvent::baseString()+", opcode="+jau::uint16HexString(static_cast<uint16_t>(getOpcode()))+ " "+getHCIOpcodeString(getOpcode())+ ", ncmd "+std::to_string(getNumCommandPackets())+ - ", status "+jau::uint8HexString(static_cast<uint8_t>(getStatus()), true)+" "+getHCIStatusCodeString(getStatus()); + ", status "+jau::uint8HexString(static_cast<uint8_t>(getStatus()))+" "+getHCIStatusCodeString(getStatus()); } public: diff --git a/api/direct_bt/MgmtTypes.hpp b/api/direct_bt/MgmtTypes.hpp index fb5c05b7..2af62e89 100644 --- a/api/direct_bt/MgmtTypes.hpp +++ b/api/direct_bt/MgmtTypes.hpp @@ -1156,7 +1156,7 @@ namespace direct_bt { } virtual std::string baseString() const noexcept override { - return "opcode "+getOpcodeString()+", devID "+jau::uint16HexString(getDevID(), true); + return "opcode "+getOpcodeString()+", devID "+jau::uint16HexString(getDevID()); } virtual std::string valueString() const noexcept override { const jau::nsize_t d_sz = getDataSize(); @@ -1259,7 +1259,7 @@ namespace direct_bt { protected: std::string baseString() const noexcept override { return MgmtEvent::baseString()+", cmd "+MgmtCommand::getOpcodeString(getCmdOpcode())+ - ", status "+jau::uint8HexString(static_cast<uint8_t>(getStatus()), true)+" "+getMgmtStatusString(getStatus()); + ", status "+jau::uint8HexString(static_cast<uint8_t>(getStatus()))+" "+getMgmtStatusString(getStatus()); } MgmtEvtCmdComplete(const uint8_t* buffer, const jau::nsize_t buffer_len, const jau::nsize_t exp_param_size) @@ -1499,7 +1499,7 @@ namespace direct_bt { std::string baseString() const noexcept override { return MgmtEvent::baseString()+", address="+getAddress().toString()+ ", addressType "+getBDAddressTypeString(getAddressType())+ - ", flags="+jau::uint32HexString(getFlags(), true)+ + ", flags="+jau::uint32HexString(getFlags())+ ", eir-size "+std::to_string(getEIRSize())+ ", hci_handle "+jau::uint16HexString(hci_conn_handle); } @@ -1780,7 +1780,7 @@ namespace direct_bt { } else { return MgmtEvent::baseString()+", address="+getAddress().toString()+ ", addressType "+getBDAddressTypeString(getAddressType())+ - ", rssi "+std::to_string(getRSSI())+", flags="+jau::uint32HexString(getFlags(), true)+ + ", rssi "+std::to_string(getRSSI())+", flags="+jau::uint32HexString(getFlags())+ ", eir-size "+std::to_string(getEIRSize()); } } @@ -2177,7 +2177,7 @@ namespace direct_bt { std::string baseString() const noexcept override { return MgmtEvent::baseString()+", address="+getAddress().toString()+ ", addressType "+getBDAddressTypeString(getAddressType())+ - ", features="+jau::uint64HexString(direct_bt::number(getFeatures()), true); + ", features="+jau::uint64HexString(direct_bt::number(getFeatures())); } public: diff --git a/api/direct_bt/SMPTypes.hpp b/api/direct_bt/SMPTypes.hpp index 590b3480..19e3321c 100644 --- a/api/direct_bt/SMPTypes.hpp +++ b/api/direct_bt/SMPTypes.hpp @@ -678,22 +678,22 @@ namespace direct_bt { { const Opcode has = getOpcode(); if( expected != has ) { - throw SMPOpcodeException("Has opcode "+jau::uint8HexString(number(has), true)+" "+getOpcodeString(has)+ - ", but expected "+jau::uint8HexString(number(expected), true)+" "+getOpcodeString(expected), E_FILE_LINE); + throw SMPOpcodeException("Has opcode "+jau::uint8HexString(number(has))+" "+getOpcodeString(has)+ + ", but expected "+jau::uint8HexString(number(expected))+" "+getOpcodeString(expected), E_FILE_LINE); } } void checkOpcode(const Opcode exp1, const Opcode exp2) const { const Opcode has = getOpcode(); if( exp1 != has && exp2 != has ) { - throw SMPOpcodeException("Has opcode "+jau::uint8HexString(number(has), true)+" "+getOpcodeString(has)+ - ", but expected either "+jau::uint8HexString(number(exp1), true)+" "+getOpcodeString(exp1)+ - " or "+jau::uint8HexString(number(exp1), true)+" "+getOpcodeString(exp1), E_FILE_LINE); + throw SMPOpcodeException("Has opcode "+jau::uint8HexString(number(has))+" "+getOpcodeString(has)+ + ", but expected either "+jau::uint8HexString(number(exp1))+" "+getOpcodeString(exp1)+ + " or "+jau::uint8HexString(number(exp1))+" "+getOpcodeString(exp1), E_FILE_LINE); } } virtual std::string baseString() const noexcept { - return "opcode="+jau::uint8HexString(number(getOpcode()), true)+" "+getOpcodeString()+ + return "opcode="+jau::uint8HexString(number(getOpcode()))+" "+getOpcodeString()+ ", size[total="+std::to_string(pdu.getSize())+", param "+std::to_string(getPDUParamSize())+"]"; } virtual std::string valueString() const noexcept { @@ -1236,7 +1236,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { const ReasonCode ec = getReasonCode(); - return jau::uint8HexString(number(ec), true) + ": " + getPlainReasonString(ec); + return jau::uint8HexString(number(ec)) + ": " + getPlainReasonString(ec); } }; @@ -1418,7 +1418,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { const TypeCode ec = getTypeCode(); - return jau::uint8HexString(number(ec), true) + ": " + getTypeCodeString(ec); + return jau::uint8HexString(number(ec)) + ": " + getTypeCodeString(ec); } }; diff --git a/src/direct_bt/BTGattService.cpp b/src/direct_bt/BTGattService.cpp index 356fbbf2..10ba113f 100644 --- a/src/direct_bt/BTGattService.cpp +++ b/src/direct_bt/BTGattService.cpp @@ -69,7 +69,7 @@ std::string BTGattService::toString() const noexcept { const uint16_t uuid16 = (static_cast<const uuid16_t*>(type.get()))->value; name = " - "+GattServiceTypeToString(static_cast<GattServiceType>(uuid16)); } - return "[type 0x"+type->toString()+", handle ["+uint16HexString(startHandle, true)+".."+uint16HexString(endHandle, true)+"]"+ + return "[type 0x"+type->toString()+", handle ["+uint16HexString(startHandle)+".."+uint16HexString(endHandle)+"]"+ name+", "+std::to_string(characteristicList.size())+" characteristics]"; } @@ -79,6 +79,6 @@ std::string BTGattService::toShortString() const noexcept { const uint16_t uuid16 = (static_cast<const uuid16_t*>(type.get()))->value; name = " - "+GattServiceTypeToString(static_cast<GattServiceType>(uuid16)); } - return "[handle ["+uint16HexString(startHandle, true)+".."+uint16HexString(endHandle, true)+"]"+ + return "[handle ["+uint16HexString(startHandle)+".."+uint16HexString(endHandle)+"]"+ name+", "+std::to_string(characteristicList.size())+" characteristics]"; } diff --git a/src/direct_bt/BTTypes0.cpp b/src/direct_bt/BTTypes0.cpp index e6c72397..04180d06 100644 --- a/src/direct_bt/BTTypes0.cpp +++ b/src/direct_bt/BTTypes0.cpp @@ -614,14 +614,14 @@ std::string EInfoReport::toString(const bool includeServices) const noexcept { "], name['"+name+"'/'"+name_short+"'], "+eirDataMaskToString()+ ", evt-type "+getAD_PDU_TypeString(evt_type)+", rssi "+std::to_string(rssi)+ ", tx-power "+std::to_string(tx_power)+ - ", dev-class "+jau::uint32HexString(device_class, true)+ + ", dev-class "+jau::uint32HexString(device_class)+ ", appearance "+jau::uint16HexString(static_cast<uint16_t>(appearance))+" ("+getAppearanceCatString(appearance)+ "), hash["+hash.toString()+ "], randomizer["+randomizer.toString()+ - "], device-id[source "+jau::uint16HexString(did_source, true)+ - ", vendor "+jau::uint16HexString(did_vendor, true)+ - ", product "+jau::uint16HexString(did_product, true)+ - ", version "+jau::uint16HexString(did_version, true)+ + "], device-id[source "+jau::uint16HexString(did_source)+ + ", vendor "+jau::uint16HexString(did_vendor)+ + ", product "+jau::uint16HexString(did_product)+ + ", version "+jau::uint16HexString(did_version)+ "], "+msdstr+"]"); if( includeServices && services.size() > 0 ) { diff --git a/src/direct_bt/GATTNumbers.cpp b/src/direct_bt/GATTNumbers.cpp index 7816c2eb..9b59df6b 100644 --- a/src/direct_bt/GATTNumbers.cpp +++ b/src/direct_bt/GATTNumbers.cpp @@ -398,10 +398,10 @@ std::shared_ptr<GattPnP_ID> GattPnP_ID::get(const TROOctets &source) noexcept { } std::string GattPnP_ID::toString() const noexcept { - return "vendor_id[source "+jau::uint8HexString(vendor_id_source, true)+ - ", id "+jau::uint16HexString(vendor_id, true)+ - "], product_id "+jau::uint16HexString(product_id, true)+ - ", product_version "+jau::uint16HexString(product_version, true); + return "vendor_id[source "+jau::uint8HexString(vendor_id_source)+ + ", id "+jau::uint16HexString(vendor_id)+ + "], product_id "+jau::uint16HexString(product_id)+ + ", product_version "+jau::uint16HexString(product_version); } std::string GattDeviceInformationSvc::toString() const noexcept { |