Mercury Modem
Mercury ARQ/Broadcast modem
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
carousel.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "rs_erasure.h"
Include dependency graph for carousel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  car_frame_t
 
struct  car_io_t
 
struct  car_sblock_t
 
struct  car_rblock_t
 
struct  car_mlog_t
 
struct  car_t
 

Macros

#define CAR_PIECE   24 /* bytes per piece: fits DATAC15 with the headers */
 
#define CAR_PIECE_FLOOR   23
 
#define CAR_MAX_K   96 /* data pieces per block (see carousel.c) */
 
#define CAR_WIN   8 /* open blocks at once */
 
#define CAR_NLEVELS   7 /* the payload mode ladder (3 bits on the wire) */
 
#define CAR_FRAME_MAX   1280 /* largest payload-mode frame, bytes */
 
#define CAR_POLL_BYTES   14 /* a poll fills one control-mode (DATAC16) frame */
 
#define CAR_KEYDOWN_MAX   16 /* frames in one keydown (a round) */
 
#define CAR_MLOG   16 /* M's keydowns whose slots may still be open */
 

Enumerations

enum  { CAR_PATTERN_ACK = 0 , CAR_PATTERN_BREAK = 1 }
 
enum  {
  CAR_T_M , CAR_T_S , CAR_T_F , CAR_T_W ,
  CAR_NTIMERS
}
 

Functions

void car_init (car_t *c, const car_io_t *io, int rx_level, int tx_level)
 
void car_set_max_level (car_t *c, int lv)
 
int car_max_level_for_bw (int bw_hz)
 
void car_seed_ctl_deaf (car_t *c, bool mine, bool peers)
 
bool car_peer_ctl_deaf (const car_t *c)
 
void car_start_sender (car_t *c, uint64_t now)
 
void car_start_receiver (car_t *c, uint64_t now)
 
void car_on_frame (car_t *c, uint64_t now, const uint8_t *bytes, size_t len, int mode, bool control, float snr_db, uint32_t age_ms)
 
void car_on_tx_done (car_t *c, uint64_t now)
 
void car_on_pattern (car_t *c, uint64_t now, int kind)
 
bool car_expect_pattern (const car_t *c)
 
void car_on_app_data (car_t *c, uint64_t now)
 
uint64_t car_next_deadline (const car_t *c)
 
void car_on_time (car_t *c, uint64_t now)
 
int car_start_level (float snr_db)
 
int car_level_mode (int level)
 
int car_piece_for_start (int caller_start_level)
 
int car_piece (const car_t *c)
 
int car_ui_tx_mode (const car_t *c)
 
int car_ui_rx_mode (const car_t *c)
 
int car_ui_peer_mode (const car_t *c)
 
bool car_is_idle (const car_t *c)
 
const char * car_failed (const car_t *c)
 
int car_overruns (const car_t *c)
 
bool car_slot_reserved (const car_t *m, uint64_t start, uint64_t end)
 
void car_set_nav_ms (uint32_t ms)
 
void car_set_nav_below_db (float db)
 
void car_set_nav_loss (double loss)
 
bool car_wants_nav (const car_t *c)
 
void car_rung_geometry (int lv, bool floor_patterns, int *bytes_per_frame, int *frames, uint64_t *round_air_ms, uint64_t *overhead_ms)
 
bool car_is_master (const car_t *c)
 
uint64_t car_free_at (const car_t *c, uint64_t now, uint64_t len)
 
void car_log_ctl (car_t *c, uint64_t end, uint32_t tg)
 
void car_request_end (car_t *c)
 
uint64_t car_drain_budget_ms (const car_t *c)
 
size_t car_tx_inflight (const car_t *c)
 

Macro Definition Documentation

◆ CAR_FRAME_MAX

#define CAR_FRAME_MAX   1280 /* largest payload-mode frame, bytes */

◆ CAR_KEYDOWN_MAX

#define CAR_KEYDOWN_MAX   16 /* frames in one keydown (a round) */

◆ CAR_MAX_K

#define CAR_MAX_K   96 /* data pieces per block (see carousel.c) */

◆ CAR_MLOG

#define CAR_MLOG   16 /* M's keydowns whose slots may still be open */

◆ CAR_NLEVELS

#define CAR_NLEVELS   7 /* the payload mode ladder (3 bits on the wire) */

◆ CAR_PIECE

#define CAR_PIECE   24 /* bytes per piece: fits DATAC15 with the headers */

◆ CAR_PIECE_FLOOR

#define CAR_PIECE_FLOOR   23

◆ CAR_POLL_BYTES

#define CAR_POLL_BYTES   14 /* a poll fills one control-mode (DATAC16) frame */

◆ CAR_WIN

#define CAR_WIN   8 /* open blocks at once */

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CAR_T_M 
CAR_T_S 
CAR_T_F 
CAR_T_W 
CAR_NTIMERS 

◆ anonymous enum

anonymous enum
Enumerator
CAR_PATTERN_ACK 
CAR_PATTERN_BREAK 

Function Documentation

◆ car_drain_budget_ms()

uint64_t car_drain_budget_ms ( const car_t *  c)

◆ car_expect_pattern()

bool car_expect_pattern ( const car_t *  c)

◆ car_failed()

const char * car_failed ( const car_t *  c)

◆ car_free_at()

uint64_t car_free_at ( const car_t *  c,
uint64_t  now,
uint64_t  len 
)

◆ car_init()

void car_init ( car_t *  c,
const car_io_t *  io,
int  rx_level,
int  tx_level 
)

◆ car_is_idle()

bool car_is_idle ( const car_t *  c)

◆ car_is_master()

bool car_is_master ( const car_t *  c)

◆ car_level_mode()

int car_level_mode ( int  level)

◆ car_log_ctl()

void car_log_ctl ( car_t *  c,
uint64_t  end,
uint32_t  tg 
)

◆ car_max_level_for_bw()

int car_max_level_for_bw ( int  bw_hz)

◆ car_next_deadline()

uint64_t car_next_deadline ( const car_t *  c)

◆ car_on_app_data()

void car_on_app_data ( car_t *  c,
uint64_t  now 
)

◆ car_on_frame()

void car_on_frame ( car_t *  c,
uint64_t  now,
const uint8_t *  bytes,
size_t  len,
int  mode,
bool  control,
float  snr_db,
uint32_t  age_ms 
)

◆ car_on_pattern()

void car_on_pattern ( car_t *  c,
uint64_t  now,
int  kind 
)

◆ car_on_time()

void car_on_time ( car_t *  c,
uint64_t  now 
)

◆ car_on_tx_done()

void car_on_tx_done ( car_t *  c,
uint64_t  now 
)

◆ car_overruns()

int car_overruns ( const car_t *  c)

◆ car_peer_ctl_deaf()

bool car_peer_ctl_deaf ( const car_t *  c)

◆ car_piece()

int car_piece ( const car_t *  c)

◆ car_piece_for_start()

int car_piece_for_start ( int  caller_start_level)

◆ car_request_end()

void car_request_end ( car_t *  c)

◆ car_rung_geometry()

void car_rung_geometry ( int  lv,
bool  floor_patterns,
int *  bytes_per_frame,
int *  frames,
uint64_t *  round_air_ms,
uint64_t *  overhead_ms 
)

◆ car_seed_ctl_deaf()

void car_seed_ctl_deaf ( car_t *  c,
bool  mine,
bool  peers 
)

◆ car_set_max_level()

void car_set_max_level ( car_t *  c,
int  lv 
)

◆ car_set_nav_below_db()

void car_set_nav_below_db ( float  db)

◆ car_set_nav_loss()

void car_set_nav_loss ( double  loss)

◆ car_set_nav_ms()

void car_set_nav_ms ( uint32_t  ms)

◆ car_slot_reserved()

bool car_slot_reserved ( const car_t *  m,
uint64_t  start,
uint64_t  end 
)

◆ car_start_level()

int car_start_level ( float  snr_db)

◆ car_start_receiver()

void car_start_receiver ( car_t *  c,
uint64_t  now 
)

◆ car_start_sender()

void car_start_sender ( car_t *  c,
uint64_t  now 
)

◆ car_tx_inflight()

size_t car_tx_inflight ( const car_t *  c)

◆ car_ui_peer_mode()

int car_ui_peer_mode ( const car_t *  c)

◆ car_ui_rx_mode()

int car_ui_rx_mode ( const car_t *  c)

◆ car_ui_tx_mode()

int car_ui_tx_mode ( const car_t *  c)

◆ car_wants_nav()

bool car_wants_nav ( const car_t *  c)