diff options
author | Sven Göthel <[email protected]> | 2024-05-25 21:09:54 +0200 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-05-25 21:09:54 +0200 |
commit | 4396751aa0dfcbdcaf43386ad4879b6497aeee39 (patch) | |
tree | 9bd8637408477dd52ddc7f7ca0780903634f05f7 /api/direct_bt | |
parent | 4941d6ea8d7f945a5b345126c3d4f1b66b11dd78 (diff) |
jau::bytesHexString(): Adjust to API change
Diffstat (limited to 'api/direct_bt')
-rw-r--r-- | api/direct_bt/HCITypes.hpp | 20 | ||||
-rw-r--r-- | api/direct_bt/MgmtTypes.hpp | 30 | ||||
-rw-r--r-- | api/direct_bt/SMPTypes.hpp | 34 |
3 files changed, 42 insertions, 42 deletions
diff --git a/api/direct_bt/HCITypes.hpp b/api/direct_bt/HCITypes.hpp index b5bb5329..5f5acd8a 100644 --- a/api/direct_bt/HCITypes.hpp +++ b/api/direct_bt/HCITypes.hpp @@ -634,7 +634,7 @@ namespace direct_bt { } std::string valueString() const noexcept override { const jau::nsize_t psz = getParamSize(); - const std::string ps = psz > 0 ? jau::bytesHexString(getParam(), 0, psz, true /* lsbFirst */) : ""; + const std::string ps = psz > 0 ? jau::bytesHexString(getParam(), psz, true /* lsbFirst */) : ""; return "param[size "+std::to_string(getParamSize())+", data "+ps+"], tsz "+std::to_string(getTotalSize()); } @@ -720,7 +720,7 @@ namespace direct_bt { std::string valueString() const noexcept override { const jau::nsize_t psz = getParamSize(); - const std::string ps = psz > 0 ? jau::bytesHexString(getParam(), 0, psz, true /* lsbFirst */) : ""; + const std::string ps = psz > 0 ? jau::bytesHexString(getParam(), psz, true /* lsbFirst */) : ""; return "param[size "+std::to_string(getParamSize())+", data "+ps+"], tsz "+std::to_string(getTotalSize()); } @@ -774,9 +774,9 @@ namespace direct_bt { std::string valueString() const noexcept override { return "data[handle "+jau::to_hexstring(getHandle())+ - ", rand "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::COMMAND_HDR_SIZE)), 2, 8, false /* lsbFirst */)+ - ", ediv "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::COMMAND_HDR_SIZE)), 2+8, 2, false /* lsbFirst */)+ - ", ltk "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::COMMAND_HDR_SIZE)), 2+8+2, 16, true /* lsbFirst */)+ + ", rand "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::COMMAND_HDR_SIZE) + 2), 8, false /* lsbFirst */)+ + ", ediv "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::COMMAND_HDR_SIZE) + 2+8), 2, false /* lsbFirst */)+ + ", ltk "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::COMMAND_HDR_SIZE) + 2+8+2), 16, true /* lsbFirst */)+ "], tsz "+std::to_string(getTotalSize()); } @@ -849,7 +849,7 @@ namespace direct_bt { std::string valueString() const noexcept override { return "data[handle "+jau::to_hexstring(getHandle())+ - ", ltk "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::COMMAND_HDR_SIZE)), 2, 16, true /* lsbFirst */)+ + ", ltk "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::COMMAND_HDR_SIZE) + 2), 16, true /* lsbFirst */)+ "], tsz "+std::to_string(getTotalSize()); } public: @@ -1015,7 +1015,7 @@ namespace direct_bt { ", psm "+to_string(psm)+", len "+std::to_string(len)+ "]"; } std::string toString(const uint8_t* l2cap_data) const noexcept { - const std::string ds = nullptr != l2cap_data && 0 < len ? jau::bytesHexString(l2cap_data, 0, len, true /* lsbFirst*/) : "empty"; + const std::string ds = nullptr != l2cap_data && 0 < len ? jau::bytesHexString(l2cap_data, len, true /* lsbFirst*/) : "empty"; return "l2cap[handle "+jau::to_hexstring(handle)+", flags[pb "+toString(pb_flag)+", bc "+jau::to_hexstring(bc_flag)+ "], cid "+to_string(cid)+ ", psm "+to_string(psm)+", len "+std::to_string(len)+", data "+ds+"]"; @@ -1109,7 +1109,7 @@ namespace direct_bt { std::string valueString() const noexcept override { const jau::nsize_t d_sz_base = getBaseParamSize(); const jau::nsize_t d_sz = getParamSize(); - const std::string d_str = d_sz > 0 ? jau::bytesHexString(getParam(), 0, d_sz, true /* lsbFirst */) : ""; + const std::string d_str = d_sz > 0 ? jau::bytesHexString(getParam(), d_sz, true /* lsbFirst */) : ""; return "data[size "+std::to_string(d_sz)+"/"+std::to_string(d_sz_base)+", data "+d_str+"], tsz "+std::to_string(getTotalSize()); } @@ -1426,8 +1426,8 @@ namespace direct_bt { std::string valueString() const noexcept override { return "data[handle "+jau::to_hexstring(getHandle())+ - ", rand "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::EVENT_HDR_SIZE)), 1+2, 8, false /* lsbFirst */)+ - ", ediv "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::EVENT_HDR_SIZE)), 1+2+8, 2, false /* lsbFirst */)+ + ", rand "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::EVENT_HDR_SIZE) + 1+2), 8, false /* lsbFirst */)+ + ", ediv "+jau::bytesHexString(pdu.get_ptr_nc(number(HCIConstSizeT::EVENT_HDR_SIZE) + 1+2+8), 2, false /* lsbFirst */)+ "], tsz "+std::to_string(getTotalSize()); } public: diff --git a/api/direct_bt/MgmtTypes.hpp b/api/direct_bt/MgmtTypes.hpp index b6b2985a..c1223a7d 100644 --- a/api/direct_bt/MgmtTypes.hpp +++ b/api/direct_bt/MgmtTypes.hpp @@ -206,9 +206,9 @@ namespace direct_bt { return "LTK[address["+address.toString()+", "+to_string(address_type)+BDAddressAndType::getBLERandomAddressTypeString(address, address_type, ", ")+ "], type "+to_string(key_type)+", role "+jau::to_hexstring(role)+ ", enc_size "+std::to_string(enc_size)+ - ", ediv "+jau::bytesHexString(reinterpret_cast<const uint8_t *>(&ediv), 0, sizeof(ediv), true /* lsbFirst */)+ - ", rand "+jau::bytesHexString(reinterpret_cast<const uint8_t *>(&rand), 0, sizeof(rand), true /* lsbFirst */)+ - ", ltk "+jau::bytesHexString(ltk.data, 0, sizeof(ltk), true /* lsbFirst */)+ + ", ediv "+jau::bytesHexString(reinterpret_cast<const uint8_t *>(&ediv), sizeof(ediv), true /* lsbFirst */)+ + ", rand "+jau::bytesHexString(reinterpret_cast<const uint8_t *>(&rand), sizeof(rand), true /* lsbFirst */)+ + ", ltk "+jau::bytesHexString(ltk.data, sizeof(ltk), true /* lsbFirst */)+ "]"; } @@ -269,7 +269,7 @@ namespace direct_bt { std::string toString() const noexcept { return "IRK[address["+address.toString()+", "+to_string(address_type)+BDAddressAndType::getBLERandomAddressTypeString(address, address_type, ", ")+ - "], irk "+jau::bytesHexString(irk.data, 0, sizeof(irk), true /* lsbFirst */)+ + "], irk "+jau::bytesHexString(irk.data, sizeof(irk), true /* lsbFirst */)+ "]"; } @@ -299,7 +299,7 @@ namespace direct_bt { std::string toString() const noexcept { return "CSRK[address["+address.toString()+", "+to_string(address_type)+BDAddressAndType::getBLERandomAddressTypeString(address, address_type, ", ")+ "], type "+to_string(key_type)+ - ", csrk "+jau::bytesHexString(csrk.data, 0, sizeof(csrk), true /* lsbFirst */)+ + ", csrk "+jau::bytesHexString(csrk.data, sizeof(csrk), true /* lsbFirst */)+ "]"; } } ); @@ -321,7 +321,7 @@ namespace direct_bt { std::string toString() const noexcept { return "LK[address["+address.toString()+", "+to_string(address_type)+BDAddressAndType::getBLERandomAddressTypeString(address, address_type, ", ")+ "], type "+to_string(key_type)+ - ", key "+jau::bytesHexString(key.data, 0, sizeof(key), true /* lsbFirst */)+ + ", key "+jau::bytesHexString(key.data, sizeof(key), true /* lsbFirst */)+ ", pinLen "+jau::to_hexstring(pin_length)+ "]"; } @@ -527,7 +527,7 @@ namespace direct_bt { std::string valueString() const noexcept override { const jau::nsize_t psz = getParamSize(); - const std::string ps = psz > 0 ? jau::bytesHexString(getParam(), 0, psz, true /* lsbFirst */) : ""; + const std::string ps = psz > 0 ? jau::bytesHexString(getParam(), psz, true /* lsbFirst */) : ""; return "param[size "+std::to_string(getParamSize())+", data "+ps+"], tsz "+std::to_string(getTotalSize()); } @@ -895,7 +895,7 @@ namespace direct_bt { std::string valueString() const noexcept override { const jau::uint128dp_t& irk = getIdentityResolvingKey(); return "param[size "+std::to_string(getParamSize())+", data[privacy "+std::to_string(getPrivacy())+ - ", irk "+jau::bytesHexString(irk.data, 0, sizeof(irk), true /* lsbFirst */)+"]]"; + ", irk "+jau::bytesHexString(irk.data, sizeof(irk), true /* lsbFirst */)+"]]"; } public: @@ -1479,7 +1479,7 @@ namespace direct_bt { } std::string valueString() const noexcept override { const jau::nsize_t d_sz = getDataSize(); - const std::string d_str = d_sz > 0 ? jau::bytesHexString(getData(), 0, d_sz, true /* lsbFirst */) : ""; + const std::string d_str = d_sz > 0 ? jau::bytesHexString(getData(), d_sz, true /* lsbFirst */) : ""; return "data[size "+std::to_string(d_sz)+", data "+d_str+"], tsz "+std::to_string(getTotalSize()); } @@ -2548,8 +2548,8 @@ namespace direct_bt { std::string baseString() const noexcept override { return MgmtEvent::baseString()+", address="+getAddress().toString()+ ", addressType "+to_string(getAddressType())+ - ", rand "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE), 6+1, 8, false /* lsbFirst */)+ - ", ediv "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE), 6+1+8, 2, false /* lsbFirst */); + ", rand "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE + 6+1), 8, false /* lsbFirst */)+ + ", ediv "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE + 6+1+8), 2, false /* lsbFirst */); } public: MgmtEvtHCILELTKReq(const uint16_t dev_id, const BDAddressAndType& addressAndType, const uint64_t rand, const uint16_t ediv) @@ -2631,7 +2631,7 @@ namespace direct_bt { std::string baseString() const noexcept override { return MgmtEvent::baseString()+", address="+getAddress().toString()+ ", addressType "+to_string(getAddressType())+ - ", ltk "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE), 6+1, 16, true /* lsbFirst */); + ", ltk "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE + 6+1), 16, true /* lsbFirst */); } public: MgmtEvtHCILELTKReplyAckCmd(const uint16_t dev_id, const BDAddressAndType& addressAndType, const jau::uint128dp_t ltk) @@ -2719,9 +2719,9 @@ namespace direct_bt { std::string baseString() const noexcept override { return MgmtEvent::baseString()+", address="+getAddress().toString()+ ", addressType "+to_string(getAddressType())+ - ", rand "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE), 6+1, 8, false /* lsbFirst */)+ - ", ediv "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE), 6+1+8, 2, false /* lsbFirst */)+ - ", ltk "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE), 6+1+8+2, 16, true /* lsbFirst */); + ", rand "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE + 6+1), 8, false /* lsbFirst */)+ + ", ediv "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE + 6+1+8), 2, false /* lsbFirst */)+ + ", ltk "+jau::bytesHexString(pdu.get_ptr_nc(MGMT_HEADER_SIZE + 6+1+8+2), 16, true /* lsbFirst */); } public: diff --git a/api/direct_bt/SMPTypes.hpp b/api/direct_bt/SMPTypes.hpp index efb38d7f..c339ec14 100644 --- a/api/direct_bt/SMPTypes.hpp +++ b/api/direct_bt/SMPTypes.hpp @@ -542,9 +542,9 @@ namespace direct_bt { std::string toString() const noexcept { // hex-fmt aligned with btmon return "LTK[props "+getPropertyString(properties)+", enc_size "+std::to_string(enc_size)+ - ", ediv "+jau::bytesHexString(reinterpret_cast<const uint8_t *>(&ediv), 0, sizeof(ediv), true /* lsbFirst */)+ - ", rand "+jau::bytesHexString(reinterpret_cast<const uint8_t *>(&rand), 0, sizeof(rand), true /* lsbFirst */)+ - ", ltk "+jau::bytesHexString(ltk.data, 0, sizeof(ltk), true /* lsbFirst */)+ + ", ediv "+jau::bytesHexString(reinterpret_cast<const uint8_t *>(&ediv), sizeof(ediv), true /* lsbFirst */)+ + ", rand "+jau::bytesHexString(reinterpret_cast<const uint8_t *>(&rand), sizeof(rand), true /* lsbFirst */)+ + ", ltk "+jau::bytesHexString(ltk.data, sizeof(ltk), true /* lsbFirst */)+ ", valid "+std::to_string(isValid())+ "]"; } @@ -629,7 +629,7 @@ namespace direct_bt { std::string toString() const noexcept { // hex-fmt aligned with btmon return "IRK[props "+getPropertyString(properties)+ - ", id "+id_address.toString()+", irk "+jau::bytesHexString(irk.data, 0, sizeof(irk), true /* lsbFirst */)+ + ", id "+id_address.toString()+", irk "+jau::bytesHexString(irk.data, sizeof(irk), true /* lsbFirst */)+ "]"; } } ); @@ -705,7 +705,7 @@ namespace direct_bt { std::string toString() const noexcept { // hex-fmt aligned with btmon return "CSRK[props "+getPropertyString(properties)+ - ", csrk "+jau::bytesHexString(csrk.data, 0, sizeof(csrk), true /* lsbFirst */)+ + ", csrk "+jau::bytesHexString(csrk.data, sizeof(csrk), true /* lsbFirst */)+ "]"; } } ); @@ -816,7 +816,7 @@ namespace direct_bt { std::string toString() const noexcept { // hex-fmt aligned with btmon return "LK[resp "+std::to_string(responder)+", type "+getTypeString(type)+ - ", key "+jau::bytesHexString(key.data, 0, sizeof(key), true /* lsbFirst */)+ + ", key "+jau::bytesHexString(key.data, sizeof(key), true /* lsbFirst */)+ ", plen "+std::to_string(pin_length)+ "]"; } @@ -897,7 +897,7 @@ namespace direct_bt { } virtual std::string valueString() const noexcept { return "size "+std::to_string(getDataSize())+", data " - +jau::bytesHexString(pdu.get_ptr(), getDataOffset(), getDataSize(), true /* lsbFirst */); + +jau::bytesHexString(pdu.get_ptr() + getDataOffset(), getDataSize(), true /* lsbFirst */); } /** actual received PDU */ @@ -1285,7 +1285,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { // hex-fmt aligned with btmon return "size "+std::to_string(getDataSize())+", value "+ - jau::bytesHexString(pdu.get_ptr_nc(1), 0, getDataSize(), true /* lsbFirst */); + jau::bytesHexString(pdu.get_ptr_nc(1), getDataSize(), true /* lsbFirst */); } }; @@ -1381,7 +1381,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { // hex-fmt aligned with btmon return "size "+std::to_string(getDataSize())+", rand "+ - jau::bytesHexString(pdu.get_ptr_nc(1), 0, getDataSize(), true /* lsbFirst */); + jau::bytesHexString(pdu.get_ptr_nc(1), getDataSize(), true /* lsbFirst */); } }; @@ -1518,9 +1518,9 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { return "size "+std::to_string(getDataSize())+", pk_x "+ - jau::bytesHexString(pdu.get_ptr_nc(1), 0, 32, true /* lsbFirst */)+ + jau::bytesHexString(pdu.get_ptr_nc(1), 32, true /* lsbFirst */)+ ", pk_y "+ - jau::bytesHexString(pdu.get_ptr_nc(1+32), 0, 32, true /* lsbFirst */); + jau::bytesHexString(pdu.get_ptr_nc(1+32), 32, true /* lsbFirst */); } }; @@ -1578,7 +1578,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { return "size "+std::to_string(getDataSize())+", dhkey_chk "+ - jau::bytesHexString(pdu.get_ptr_nc(1), 0, getDataSize(), true /* lsbFirst */); + jau::bytesHexString(pdu.get_ptr_nc(1), getDataSize(), true /* lsbFirst */); } }; @@ -1711,7 +1711,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { // hex-fmt aligned with btmon return "size "+std::to_string(getDataSize())+", ltk "+ - jau::bytesHexString(pdu.get_ptr_nc(1), 0, getDataSize(), true /* lsbFirst */); + jau::bytesHexString(pdu.get_ptr_nc(1), getDataSize(), true /* lsbFirst */); } }; @@ -1790,9 +1790,9 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { // hex-fmt aligned with btmon return "size "+std::to_string(getDataSize())+", ediv "+ - jau::bytesHexString(pdu.get_ptr_nc(1), 0, 2, false /* lsbFirst */)+ + jau::bytesHexString(pdu.get_ptr_nc(1), 2, false /* lsbFirst */)+ ", rand "+ - jau::bytesHexString(pdu.get_ptr_nc(1+2), 0, 8, false /* lsbFirst */); + jau::bytesHexString(pdu.get_ptr_nc(1+2), 8, false /* lsbFirst */); } }; @@ -1862,7 +1862,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { return "size "+std::to_string(getDataSize())+", irk "+ - jau::bytesHexString(pdu.get_ptr_nc(1), 0, getDataSize(), true /* lsbFirst */); + jau::bytesHexString(pdu.get_ptr_nc(1), getDataSize(), true /* lsbFirst */); } }; @@ -2002,7 +2002,7 @@ namespace direct_bt { protected: std::string valueString() const noexcept override { // hex-fmt aligned with btmon return "size "+std::to_string(getDataSize())+", csrk "+ - jau::bytesHexString(pdu.get_ptr_nc(1), 0, getDataSize(), true /* lsbFirst */); + jau::bytesHexString(pdu.get_ptr_nc(1), getDataSize(), true /* lsbFirst */); } }; |