Skip to content

Commit

Permalink
remove PacketPrinter
Browse files Browse the repository at this point in the history
  • Loading branch information
sgherbst authored and bsheffer1 committed Nov 8, 2023
1 parent 8497993 commit d19fc63
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions switchboard/cpp/umisb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#include "umilib.h"
#include "umilib.hpp"

typedef std::function<void(sb_packet packet, bool header)> PacketPrinter;

// generic formatting methods

template <typename T> std::string umi_data_as_str(T& x) {
Expand Down Expand Up @@ -211,8 +209,7 @@ struct UmiTransaction {
// higher-level functions for UMI transactions

template <typename T>
static inline bool umisb_send(T& x, SBTX& tx, bool blocking = true, void (*loop)(void) = NULL,
PacketPrinter printer = NULL) {
static inline bool umisb_send(T& x, SBTX& tx, bool blocking = true, void (*loop)(void) = NULL) {

// sends (or tries to send, if blocking=false) a single UMI transaction

Expand Down Expand Up @@ -269,18 +266,12 @@ static inline bool umisb_send(T& x, SBTX& tx, bool blocking = true, void (*loop)
}
}

// print out the packet sent if desired
if (printer != NULL) {
printer(p, true);
}

// if we reach this point, we succeeded in sending the packet
return true;
}

template <typename T>
static inline bool umisb_recv(T& x, SBRX& rx, bool blocking = true, void (*loop)(void) = NULL,
PacketPrinter printer = NULL) {
static inline bool umisb_recv(T& x, SBRX& rx, bool blocking = true, void (*loop)(void) = NULL) {

// if the receive side isn't active, there is nothing to receive
if (!rx.is_active()) {
Expand All @@ -307,10 +298,6 @@ static inline bool umisb_recv(T& x, SBRX& rx, bool blocking = true, void (*loop)

umi_packet* up = (umi_packet*)p.data;

if (printer != NULL) {
printer(p, true);
}

// read information from the packet

x.cmd = up->cmd;
Expand Down

0 comments on commit d19fc63

Please # to comment.