K-FSW v1.2.1-59-gcaca356
KFSW: modular flight software on Zephyr, for small satellites
Loading...
Searching...
No Matches
Which spacecraft the rules are for

Data Structures

struct  kfsw_gpredict_profile
 

Macros

#define KFSW_GPREDICT_PROFILE_NAME_MAX   16U
 
#define KFSW_COMMAND_ID_GPREDICT_SELECT   40U
 
#define KFSW_COMMAND_ID_GPREDICT_ENABLE   41U
 
#define KFSW_COMMAND_ID_GPREDICT_PARK   42U
 
#define KFSW_COMMAND_ID_GPREDICT_CLEAR   43U
 

Enumerations

enum  kfsw_gpredict_frequency_policy { KFSW_GPREDICT_FREQUENCY_FOLLOW = 0 , KFSW_GPREDICT_FREQUENCY_HOLD = 1 , KFSW_GPREDICT_FREQUENCY_IGNORE = 2 }
 

Functions

int kfsw_gpredict_profile_define (uint8_t index, const struct kfsw_gpredict_profile *profile)
 
int kfsw_gpredict_profile_select (uint8_t index)
 
int kfsw_gpredict_profile_enable (uint8_t index, bool enabled)
 
int kfsw_gpredict_profile_get (uint8_t index, struct kfsw_gpredict_profile *profile)
 
int kfsw_gpredict_profile_selected (void)
 
int kfsw_gpredict_profile_bearing (const struct kfsw_gpredict_bearing *bearing)
 
int kfsw_gpredict_profile_frequency (uint64_t offered, uint64_t *send)
 

Variables

const struct kfsw_command_definition_set kfsw_gpredict_command_definitions
 

Description

The ground proxy stands where the rotator and radio daemons stand and sees every bearing and frequency Gpredict sends.

What it cannot know is which spacecraft they are for: the hamlib protocols carry angles and a frequency and nothing else. So the spacecraft is chosen here, by hand, and its profile decides what the proxy is allowed to forward.

The profiles live in the node rather than in the proxy because this is where the commands, the parameters and the operator already are. A ground tool that kept its own copy would be a second place to change them, and the two would disagree the first time somebody edited one.

Macro Documentation

◆ KFSW_COMMAND_ID_GPREDICT_SELECT

#define KFSW_COMMAND_ID_GPREDICT_SELECT   40U

#include <gpredict.h>

Wire identifiers of this module's commands.

Never reused.

◆ KFSW_GPREDICT_PROFILE_NAME_MAX

#define KFSW_GPREDICT_PROFILE_NAME_MAX   16U

#include <gpredict.h>

Longest profile name, including the terminator.

Enumeration Documentation

◆ kfsw_gpredict_frequency_policy

#include <gpredict.h>

What the node does with the frequency Gpredict sends.

Enumerator
KFSW_GPREDICT_FREQUENCY_FOLLOW 

Pass it through.

Gpredict owns the Doppler.

KFSW_GPREDICT_FREQUENCY_HOLD 

Use the profile's own frequency instead.

Gpredict keeps correcting every cycle, so this is a standing override, not a value set once.

KFSW_GPREDICT_FREQUENCY_IGNORE 

Send nothing to the radio.

The rotator is unaffected.

Function Documentation

◆ kfsw_gpredict_profile_bearing()

int kfsw_gpredict_profile_bearing ( const struct kfsw_gpredict_bearing *  bearing)

#include <gpredict.h>

Judge a bearing against the selected profile.

This is what the proxy asks before forwarding. It applies the profile's travel on top of the rotator's own limits, so a profile can narrow the travel and never widen it.

Return values
0Allowed, and the tracker has taken it.
-ENOENTNo profile is selected.
-EINVALOutside the profile's travel or the rotator's.
-EPERMThe tracker is in fault.

◆ kfsw_gpredict_profile_define()

int kfsw_gpredict_profile_define ( uint8_t  index,
const struct kfsw_gpredict_profile *  profile 
)

#include <gpredict.h>

Define a profile at an index, replacing whatever was there.

Return values
0Defined.
-EINVALA NULL, an empty name, a travel outside the rotator's own limits, an unknown policy, or HOLD with no frequency to hold.
-ENOSPCindex is past the compiled profile count.

◆ kfsw_gpredict_profile_enable()

int kfsw_gpredict_profile_enable ( uint8_t  index,
bool  enabled 
)

#include <gpredict.h>

Enable or disable a profile.

Disabling the selected one refuses with -EBUSY.

◆ kfsw_gpredict_profile_frequency()

int kfsw_gpredict_profile_frequency ( uint64_t  offered,
uint64_t *  send 
)

#include <gpredict.h>

Ask what to send the radio for a frequency Gpredict offered.

Parameters
[in]offeredWhat Gpredict sent, in hertz.
[out]sendWhat to forward, in hertz. Zero means forward nothing.
Return values
0Decided.
-ENOENTNo profile is selected.
-EINVALA NULL destination, or a zero offer.

◆ kfsw_gpredict_profile_get()

int kfsw_gpredict_profile_get ( uint8_t  index,
struct kfsw_gpredict_profile *  profile 
)

#include <gpredict.h>

Read one profile.

Returns -ENOENT for an index that holds nothing.

◆ kfsw_gpredict_profile_select()

int kfsw_gpredict_profile_select ( uint8_t  index)

#include <gpredict.h>

Choose the profile whose rules apply.

Selecting does not move the antenna: it changes what the next bearing is judged against, and a pass already running keeps its state.

Return values
0Selected.
-ENOENTNo profile is defined at index.
-EPERMThe profile is defined but not enabled.

◆ kfsw_gpredict_profile_selected()

int kfsw_gpredict_profile_selected ( void  )

#include <gpredict.h>

Index of the selected profile, or -ENOENT when none is.

Variable Documentation

◆ kfsw_gpredict_command_definitions

const struct kfsw_command_definition_set kfsw_gpredict_command_definitions
extern

#include <gpredict.h>

The module's commands, for a composition to register.