SatNOGS-COMMS
4.1.0
A COMMS subsystem for CubeSats
Toggle main menu visibility
Loading...
Searching...
No Matches
mission.cpp
Go to the documentation of this file.
1
/*
2
* SatNOGS-COMMS MCU software
3
*
4
* Copyright (C) 2025, Libre Space Foundation <http://libre.space>
5
*
6
* This program is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*
19
* SPDX-License-Identifier: GNU General Public License v3.0 or later
20
*/
21
22
#include "
mission.hpp
"
23
24
namespace
satnogs::comms
25
{
26
31
void
32
mission::pre_init
()
const
33
{
34
m_pre_init.call_if();
35
}
36
42
void
43
mission::register_pre_init
(etl::delegate<
void
(
void
)> callback)
44
{
45
m_pre_init = callback;
46
}
47
52
void
53
mission::post_init
()
const
54
{
55
m_post_init.call_if();
56
}
57
63
void
64
mission::register_post_init
(etl::delegate<
void
(
void
)> callback)
65
{
66
m_post_init = callback;
67
}
68
73
void
74
mission::start
()
const
75
{
76
m_start.call_if();
77
}
78
84
void
85
mission::register_start
(etl::delegate<
void
(
void
)> callback)
86
{
87
m_start = callback;
88
}
89
95
void
96
mission::register_msg_parser
(
97
etl::delegate<
bool
(
msg_arbiter::msg
&msg)> callback)
98
{
99
m_msg_parser = callback;
100
}
101
102
void
103
mission::register_sp_msg_parser
(
104
etl::delegate<
bool
(
msg_arbiter::msg
&msg)> callback)
105
{
106
m_sp_msg_parser = callback;
107
}
108
121
bool
122
mission::msg_parser
(
msg_arbiter::msg
&msg,
bool
is_sp)
123
{
124
if
(is_sp) {
125
auto
x = m_sp_msg_parser.call_if(msg);
126
return
x.value_or(
false
);
127
}
else
{
128
auto
x = m_msg_parser.call_if(msg);
129
return
x.value_or(
false
);
130
}
131
}
132
133
}
// namespace satnogs::comms
satnogs::comms::mission::start
void start() const
This method is called at the end of the startup::start().
Definition
mission.cpp:74
satnogs::comms::mission::msg_parser
bool msg_parser(msg_arbiter::msg &msg, bool is_sp)
This method is called inside the msg_arbiter, in case an incoming message was not parsed by the defau...
Definition
mission.cpp:122
satnogs::comms::mission::register_start
void register_start(etl::delegate< void(void)> callback)
Registers a callback for the start().
Definition
mission.cpp:85
satnogs::comms::mission::register_sp_msg_parser
void register_sp_msg_parser(etl::delegate< bool(msg_arbiter::msg &msg)> callback)
Definition
mission.cpp:103
satnogs::comms::mission::register_pre_init
void register_pre_init(etl::delegate< void(void)> callback)
Registers a callback for the pre_init().
Definition
mission.cpp:43
satnogs::comms::mission::register_post_init
void register_post_init(etl::delegate< void(void)> callback)
Registers a callback for the post_init().
Definition
mission.cpp:64
satnogs::comms::mission::register_msg_parser
void register_msg_parser(etl::delegate< bool(msg_arbiter::msg &msg)> callback)
Registers a callback for the msg_parser().
Definition
mission.cpp:96
satnogs::comms::mission::pre_init
void pre_init() const
This method is called before the satnogs::comms::lib::board::init().
Definition
mission.cpp:32
satnogs::comms::mission::post_init
void post_init() const
This method is called after the satnogs::comms::lib::board::init().
Definition
mission.cpp:53
satnogs::comms::msg_arbiter::msg
Definition
msg_arbiter.hpp:118
mission.hpp
satnogs::comms
Definition
bsp.cpp:28
src
mission.cpp
Generated by
1.17.0