SatCat5
net_cfgbus.h
1 // Copyright 2021-2025 The Aerospace Corporation.
3 // This file is a part of SatCat5, licensed under CERN-OHL-W v2 or later.
5 // Handler for ConfigBus network commands
6 
7 #pragma once
8 
9 #include <satcat5/net_core.h>
10 
11 namespace satcat5 {
12  namespace net {
30  protected:
36  const satcat5::net::Type& cmd,
37  const satcat5::net::Type& ack,
38  unsigned max_devices);
39  ~ProtoConfig() SATCAT5_OPTIONAL_DTOR;
41 
43  void frame_rcvd(satcat5::io::LimitedRead& src) override;
44 
45  // Member variables
49  const unsigned m_max_devices;
50  };
51  }
52 
53  namespace eth {
56  class ProtoConfig final : public satcat5::net::ProtoConfig {
57  public:
61  unsigned max_devices = satcat5::cfg::DEVS_PER_CFGBUS);
62  };
63  }
64 
65  namespace udp {
68  class ProtoConfig final : public satcat5::net::ProtoConfig {
69  public:
73  unsigned max_devices = satcat5::cfg::DEVS_PER_CFGBUS);
74  };
75  }
76 }
Memory-mapped local ConfigBus.
Definition: cfgbus_core.h:199
Implemention of "net::Dispatch" for Ethernet frames.
Definition: eth_dispatch.h:21
Thin wrapper for access via ethernet frames through eth::Dispatch.
Definition: net_cfgbus.h:56
Limited read of next N bytes.
Definition: io_readable.h:255
The "Dispatch" is a generic interface that knows how to read a designated protocol layer and sort inc...
Definition: net_dispatch.h:36
Handler for ConfigBus network commands.
Definition: net_cfgbus.h:29
~ProtoConfig() SATCAT5_OPTIONAL_DTOR
Only children can access constructor/destructor.
Definition: net_cfgbus.cc:104
satcat5::cfg::ConfigBusMmap *const m_cfg
ConfigBus instance.
Definition: net_cfgbus.h:46
void frame_rcvd(satcat5::io::LimitedRead &src) override
Event handler to process incoming frames and respond.
Definition: net_cfgbus.cc:110
satcat5::net::Dispatch *const m_iface
Registered iface.
Definition: net_cfgbus.h:47
satcat5::net::Type const m_acktype
Type for replies.
Definition: net_cfgbus.h:48
const unsigned m_max_devices
Max # of devices.
Definition: net_cfgbus.h:49
ProtoConfig(satcat5::cfg::ConfigBusMmap *cfg, satcat5::net::Dispatch *iface, const satcat5::net::Type &cmd, const satcat5::net::Type &ack, unsigned max_devices)
Only children can access constructor/destructor.
Definition: net_cfgbus.cc:88
A net::Protocol is the counterpart to net::Dispatch that handles a particular data stream,...
Definition: net_protocol.h:28
Dispatcher sorts incoming UDP messages by port index.
Definition: udp_dispatch.h:20
Thin wrapper for access via UDP/IP through udp::Dispatch.
Definition: net_cfgbus.h:68
Generic network Dispatch API.
Multipurpose filter for matching fields in network packets.
Definition: net_type.h:38