STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
radio_link::Link Class Reference

#include <link.h>

Collaboration diagram for radio_link::Link:
[legend]

Public Member Functions

 Link (uint8_t target_id)
ArmAction poll (uint32_t now_ms)
 Drain at most one waiting packet (the SX1262 holds one at a time, so do not loop here; call again on the next DIO1 interrupt).
uint32_t frames_ok () const
uint32_t frames_dropped () const
uint32_t radio_errors () const
const Frame & last_frame () const

Private Attributes

ArmGate gate_
uint32_t frames_ok_ = 0
uint32_t frames_dropped_ = 0
uint32_t radio_errors_ = 0
uint8_t buf_ [kLoraMaxPacket]
Frame frame_

Detailed Description

Definition at line 16 of file link.h.

Constructor & Destructor Documentation

◆ Link()

radio_link::Link::Link ( uint8_t target_id)
inlineexplicit

Definition at line 18 of file link.h.

References gate_.

Member Function Documentation

◆ frames_dropped()

uint32_t radio_link::Link::frames_dropped ( ) const
inline

Definition at line 33 of file link.h.

References frames_dropped_.

◆ frames_ok()

uint32_t radio_link::Link::frames_ok ( ) const
inline

Definition at line 30 of file link.h.

References frames_ok_.

◆ last_frame()

const Frame & radio_link::Link::last_frame ( ) const
inline

Definition at line 41 of file link.h.

References frame_.

◆ poll()

ArmAction radio_link::Link::poll ( uint32_t now_ms)

Drain at most one waiting packet (the SX1262 holds one at a time, so do not loop here; call again on the next DIO1 interrupt).

Returns the gate's action for it: ArmAction::None if nothing was waiting, the packet was invalid, or it was not an ARM/UN_ARM frame (check the counters to tell them apart).

Definition at line 7 of file link.cpp.

References buf_, radio_link::decode_frame(), radio_link::ErrTooLong, frame_, frames_dropped_, frames_ok_, gate_, radio_link::NoData, radio_link::None, radio_link::Ok, radio_errors_, and radio_link::radio_receive().

◆ radio_errors()

uint32_t radio_link::Link::radio_errors ( ) const
inline

Definition at line 36 of file link.h.

References radio_errors_.

Member Data Documentation

◆ buf_

uint8_t radio_link::Link::buf_[kLoraMaxPacket]
private

Definition at line 52 of file link.h.

Referenced by poll().

◆ frame_

Frame radio_link::Link::frame_
private

Definition at line 53 of file link.h.

Referenced by last_frame(), and poll().

◆ frames_dropped_

uint32_t radio_link::Link::frames_dropped_ = 0
private

Definition at line 48 of file link.h.

Referenced by frames_dropped(), and poll().

◆ frames_ok_

uint32_t radio_link::Link::frames_ok_ = 0
private

Definition at line 47 of file link.h.

Referenced by frames_ok(), and poll().

◆ gate_

ArmGate radio_link::Link::gate_
private

Definition at line 46 of file link.h.

Referenced by Link(), and poll().

◆ radio_errors_

uint32_t radio_link::Link::radio_errors_ = 0
private

Definition at line 49 of file link.h.

Referenced by poll(), and radio_errors().


The documentation for this class was generated from the following files:
  • firmware/Flight_Computer/src/radio/link.h
  • firmware/Flight_Computer/src/radio/link.cpp