@@ -336,7 +336,7 @@ struct endpoint_info {
336
336
constexpr endpoint_info &operator =(endpoint_info const &) = default ;
337
337
constexpr endpoint_info &operator =(endpoint_info &&) noexcept = default ;
338
338
339
- bool operator ==(endpoint_info const &) const = default ;
339
+ constexpr bool operator ==(endpoint_info const &) const noexcept = default ;
340
340
341
341
explicit constexpr operator packed::endpoint_info_v1 () const ;
342
342
@@ -383,6 +383,10 @@ struct endpoint_info_reply {
383
383
constexpr endpoint_info_reply &operator =(endpoint_info_reply const &) = default ;
384
384
constexpr endpoint_info_reply &operator =(endpoint_info_reply &&) noexcept = default ;
385
385
386
+ constexpr bool operator ==(endpoint_info_reply const &other) const noexcept {
387
+ return status == other.status && std::ranges::equal (information, other.information );
388
+ }
389
+
386
390
explicit constexpr operator packed::endpoint_info_reply_v1 () const ;
387
391
388
392
std::byte status{};
@@ -478,6 +482,8 @@ struct ack {
478
482
479
483
explicit constexpr operator packed::ack_v1 () const ;
480
484
485
+ constexpr bool operator ==(ack const &other) const noexcept ;
486
+
481
487
std::uint8_t original_id = 0 ;
482
488
std::uint8_t status_code = 0 ;
483
489
std::uint8_t status_data = 0 ;
@@ -502,6 +508,11 @@ constexpr ack::operator packed::ack_v1() const {
502
508
{std::byte{0 }}};
503
509
}
504
510
511
+ constexpr bool ack::operator ==(ack const &other) const noexcept {
512
+ return original_id == other.original_id && status_code == other.status_code && status_data == other.status_data &&
513
+ details == other.details && std::ranges::equal (message, other.message );
514
+ }
515
+
505
516
// * _ *
506
517
// * _ _ __ _| |__ *
507
518
// * | ' \/ _` | / / *
@@ -577,6 +588,11 @@ constexpr nak::operator packed::nak_v2() const {
577
588
{std::byte{0 }}};
578
589
}
579
590
591
+ constexpr bool nak::operator ==(nak const &other) const {
592
+ return original_id == other.original_id && status_code == other.status_code && status_data == other.status_data &&
593
+ details == other.details && std::ranges::equal (message, other.message );
594
+ }
595
+
580
596
namespace profile_configuration {
581
597
582
598
// * __ _ _ _ _ *
@@ -630,6 +646,9 @@ struct inquiry_reply {
630
646
constexpr inquiry_reply &operator =(inquiry_reply const &) = default ;
631
647
constexpr inquiry_reply &operator =(inquiry_reply &&) noexcept = default ;
632
648
649
+ constexpr bool operator ==(inquiry_reply const &other) const {
650
+ return std::ranges::equal (enabled, other.enabled ) && std::ranges::equal (disabled, other.disabled );
651
+ }
633
652
explicit constexpr operator packed::inquiry_reply_v1_pt1 () const ;
634
653
explicit constexpr operator packed::inquiry_reply_v1_pt2 () const ;
635
654
@@ -808,6 +827,10 @@ struct details_reply {
808
827
809
828
explicit constexpr operator packed::details_reply_v1 () const ;
810
829
830
+ constexpr bool operator ==(details_reply const &other) const {
831
+ return pid == other.pid && target == other.target && std::ranges::equal (data, other.data );
832
+ }
833
+
811
834
byte_array_5 pid{}; // /< Profile ID of profile
812
835
std::uint8_t target = 0 ; // /< Inquiry target
813
836
std::span<std::byte const > data;
@@ -1107,6 +1130,10 @@ struct specific_data {
1107
1130
1108
1131
explicit constexpr operator packed::specific_data_v1 () const ;
1109
1132
1133
+ constexpr bool operator ==(specific_data const &other) const {
1134
+ return pid == other.pid && std::ranges::equal (data, other.data );
1135
+ }
1136
+
1110
1137
byte_array_5 pid{}; // /< Profile ID
1111
1138
std::span<std::byte const > data; // /< Profile specific data
1112
1139
};
@@ -1299,7 +1326,8 @@ static_assert(std::is_trivially_copyable_v<property_exchange_pt2>);
1299
1326
1300
1327
} // end namespace packed
1301
1328
1302
- struct property_exchange {
1329
+ class property_exchange {
1330
+ public:
1303
1331
struct chunk_info {
1304
1332
chunk_info () = default ;
1305
1333
chunk_info (std::uint16_t const number_of_chunks_, std::uint16_t const chunk_number_)
@@ -1316,9 +1344,10 @@ struct property_exchange {
1316
1344
explicit constexpr operator packed::property_exchange_pt1 () const ;
1317
1345
explicit constexpr operator packed::property_exchange_pt2 () const ;
1318
1346
1347
+ constexpr bool operator ==(property_exchange const &other) const ;
1348
+
1319
1349
protected:
1320
1350
constexpr property_exchange () = default;
1321
-
1322
1351
constexpr property_exchange (chunk_info const &chunk_, std::uint8_t request_, std::span<char const > header_,
1323
1352
std::span<char const > data_)
1324
1353
: chunk{chunk_}, request{request_}, header{header_}, data{data_} {}
@@ -1341,6 +1370,11 @@ constexpr property_exchange::operator packed::property_exchange_pt2() const {
1341
1370
};
1342
1371
}
1343
1372
1373
+ constexpr bool property_exchange::operator ==(property_exchange const &other) const {
1374
+ return chunk == other.chunk && request == other.request && std::ranges::equal (header, other.header ) &&
1375
+ std::ranges::equal (data, other.data );
1376
+ }
1377
+
1344
1378
struct get : public property_exchange {
1345
1379
public:
1346
1380
constexpr get () = default;
0 commit comments