SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
test.hpp
Go to the documentation of this file.
1/*
2 * SatNOGS-COMMS MCU software
3 *
4 * Copyright (C) 2023, 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#pragma once
23
25#include <zephyr/kernel.h>
26
27namespace satnogs::comms
28{
29class test
30{
31public:
33 {
34 struct k_work work;
36 uint32_t param0;
37 uint32_t param1;
38 uint32_t param2;
39 };
40
41 static test &
43 {
44 static test inst;
45 return inst;
46 }
47
48 enum class test_id : int
49 {
54 };
55
56 /* Singleton */
57 test(test const &) = delete;
58
59 void
60 operator=(test const &) = delete;
61
62 void
63 exec_test(test_id id, std::initializer_list<uint32_t> params);
64
65 void
66 stop();
67
68 bool
69 running() const;
70
71 void
73
74 bool
75 emmc_success() const;
76
77private:
78 test();
79
80 static void
81 exec(struct k_work *item);
82
83 void
84 uhf_tx_simple(uint32_t nframes, uint32_t delay_us, uint32_t len);
85
86 void
87 sband_tx_simple(uint32_t nframes, uint32_t delay_us, uint32_t len);
88
89 void
90 emmc_simple(uint32_t nbytes);
91
92 void
93 init_workq();
94
95 void
96 tx_simple(satnogs::comms::lib::radio::interface iface, uint32_t nframes,
97 uint32_t delay_us, uint32_t len);
98 bool m_emmc_success;
99 bool m_running;
100 bool m_stop;
101 struct params_work_container m_test_internal_params;
102};
103
104} // namespace satnogs::comms
interface
Radio interface identifier.
Definition radio.hpp:177
void operator=(test const &)=delete
bool running() const
Definition test.cpp:288
bool emmc_success() const
Definition test.cpp:157
test(test const &)=delete
void exec_test(test_id id, std::initializer_list< uint32_t > params)
Definition test.cpp:64
static test & get_instance()
Definition test.hpp:42
void emc_routine()
A simple routine for EMC testing.
Definition test.cpp:222