SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
satnogs::comms::utils::iface_ctrl Class Reference

#include <iface_ctrl.hpp>

Inheritance diagram for satnogs::comms::utils::iface_ctrl:

Classes

class  stats
 Radio interface statistics. More...
class  disabled_exception
class  tx_inhibit_exception

Public Types

enum class  state : uint8_t { DISABLED , TX , RX , IDLE }

Public Member Functions

 iface_ctrl (satnogs::comms::lib::radio::interface iface)
void enable ()
 Enables the interface and set it automatically to RX state.
void enable (bool yes)
void disable ()
 Disables the interface.
void restart ()
 Restarts the interface by disabling and enabling it again.
void reset_stats ()
 Resets the TX/RX statistics of the interface.
const statsget_stats () const
 Returns the statistics class of the interface.
void rx_frame_dropped ()
 Increments the RX drop counter.
void frame_received (bool valid, float rssi)
 Updates the RX stats.
void tx (const msg_arbiter::msg &msg, bool more=false)
iface_ctrl::state get_state () const
 Returns the current state of the interface.

Static Public Attributes

static constexpr uint32_t MAX_TRX_MS = 5000U

Detailed Description

Definition at line 33 of file iface_ctrl.hpp.

Member Enumeration Documentation

◆ state

enum class satnogs::comms::utils::iface_ctrl::state : uint8_t
strong
Enumerator
DISABLED 

Interface is disabled.

TX 

Interface is either TX a frame or wait to TX the next frame.

RX 

Interface is in RX mode.

IDLE 

Interface is in idle state. This state is used for controlling the RX duty cycle

Definition at line 42 of file iface_ctrl.hpp.

Constructor & Destructor Documentation

◆ iface_ctrl()

satnogs::comms::utils::iface_ctrl::iface_ctrl ( satnogs::comms::lib::radio::interface iface)

Definition at line 19 of file iface_ctrl.cpp.

Member Function Documentation

◆ disable()

void satnogs::comms::utils::iface_ctrl::disable ( )

Disables the interface.

Definition at line 62 of file iface_ctrl.cpp.

◆ enable() [1/2]

void satnogs::comms::utils::iface_ctrl::enable ( )

Enables the interface and set it automatically to RX state.

Definition at line 42 of file iface_ctrl.cpp.

◆ enable() [2/2]

void satnogs::comms::utils::iface_ctrl::enable ( bool yes)

Definition at line 48 of file iface_ctrl.cpp.

◆ frame_received()

void satnogs::comms::utils::iface_ctrl::frame_received ( bool valid,
float rssi )

Updates the RX stats.

Parameters
validtrue if the frame passes the CRC check false otherwise
rssithe RSSI of the received frame

Definition at line 199 of file iface_ctrl.cpp.

◆ get_state()

iface_ctrl::state satnogs::comms::utils::iface_ctrl::get_state ( ) const

Returns the current state of the interface.

Returns
iface_ctrl::state

Definition at line 125 of file iface_ctrl.cpp.

◆ get_stats()

const iface_ctrl::stats & satnogs::comms::utils::iface_ctrl::get_stats ( ) const

Returns the statistics class of the interface.

Returns
const iface_ctrl::stats&

Definition at line 96 of file iface_ctrl.cpp.

◆ reset_stats()

void satnogs::comms::utils::iface_ctrl::reset_stats ( )

Resets the TX/RX statistics of the interface.

Definition at line 85 of file iface_ctrl.cpp.

◆ restart()

void satnogs::comms::utils::iface_ctrl::restart ( )

Restarts the interface by disabling and enabling it again.

This can be useful when radio settings have changed and the interface needs to be reconfigured.

Definition at line 74 of file iface_ctrl.cpp.

◆ rx_frame_dropped()

void satnogs::comms::utils::iface_ctrl::rx_frame_dropped ( )

Increments the RX drop counter.

Definition at line 223 of file iface_ctrl.cpp.

◆ tx()

void satnogs::comms::utils::iface_ctrl::tx ( const msg_arbiter::msg & msg,
bool more = false )

Definition at line 102 of file iface_ctrl.cpp.

Member Data Documentation

◆ MAX_TRX_MS

uint32_t satnogs::comms::utils::iface_ctrl::MAX_TRX_MS = 5000U
staticconstexpr

Maximum allowed TX/RX turnaround time in milliseconds

Definition at line 40 of file iface_ctrl.hpp.


The documentation for this class was generated from the following files: