Skip to content

Commit

Permalink
log UpperMacCPlaneSignallingPacket data
Browse files Browse the repository at this point in the history
  • Loading branch information
marenz2569 committed Jul 4, 2024
1 parent 8e5d097 commit 2739803
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions src/borzoi/borzoi_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "borzoi/borzoi_sender.hpp"
#include "borzoi/borzoi_converter.hpp"
#include "l2/upper_mac_packet.hpp"
#include "l3/circuit_mode_control_entity_packet.hpp"
#include "l3/mobile_link_entity_packet.hpp"
#include "l3/mobile_management_packet.hpp"
Expand Down Expand Up @@ -96,26 +97,29 @@ void BorzoiSender::worker() {
using T = std::decay_t<decltype(arg)>;
if constexpr (std::is_same_v<T, std::unique_ptr<LogicalLinkControlPacket>>) {
/// process the parsed packet
if (auto* llc = dynamic_cast<LogicalLinkControlPacket*>(arg.get())) {
if (llc->basic_link_information_ &&
(llc->basic_link_information_->basic_link_type_ == BasicLinkType::kBlAckWithoutFcs ||
llc->basic_link_information_->basic_link_type_ == BasicLinkType::kBlAckWithFcs)) {
return;
}
std::cout << *llc;
if (auto* mle = dynamic_cast<MobileLinkEntityPacket*>(llc)) {
std::cout << *mle;
if (auto* cmce = dynamic_cast<CircuitModeControlEntityPacket*>(llc)) {
std::cout << *cmce;
if (auto* sds = dynamic_cast<ShortDataServicePacket*>(llc)) {
std::cout << *sds;
}
}
if (auto* mm = dynamic_cast<MobileManagementPacket*>(llc)) {
std::cout << *mm;
auto* cplane_signalling = dynamic_cast<UpperMacCPlaneSignallingPacket*>(arg.get());
auto* llc = dynamic_cast<LogicalLinkControlPacket*>(cplane_signalling);

// Do not log acknowledgements
if (llc->basic_link_information_ &&
(llc->basic_link_information_->basic_link_type_ == BasicLinkType::kBlAckWithoutFcs ||
llc->basic_link_information_->basic_link_type_ == BasicLinkType::kBlAckWithFcs)) {
return;
}
std::cout << *cplane_signalling;
std::cout << *llc;
if (auto* mle = dynamic_cast<MobileLinkEntityPacket*>(llc)) {
std::cout << *mle;
if (auto* cmce = dynamic_cast<CircuitModeControlEntityPacket*>(llc)) {
std::cout << *cmce;
if (auto* sds = dynamic_cast<ShortDataServicePacket*>(llc)) {
std::cout << *sds;
}
std::cout << std::endl;
}
if (auto* mm = dynamic_cast<MobileManagementPacket*>(llc)) {
std::cout << *mm;
}
std::cout << std::endl;
}
send_packet(arg);
} else if constexpr (std::is_same_v<T, Slots>) {
Expand Down

0 comments on commit 2739803

Please sign in to comment.