GNU Radio's SATNOGS Package
metadata.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
4  *
5  * Copyright (C) 2019, Libre Space Foundation <http://libre.space>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef INCLUDE_SATNOGS_METADATA_H_
22 #define INCLUDE_SATNOGS_METADATA_H_
23 
24 #include <satnogs/api.h>
25 #include <string>
26 #include <pmt/pmt.h>
27 #include <json/json.h>
28 #include <cstdint>
29 
30 namespace gr {
31 
32 namespace satnogs {
33 
34 
36 public:
37  typedef enum key {
38  PDU = 0,
46  SNR,
47  KEYS_NUM
48  } key_t;
49 
50  static std::string
51  value(const key_t &k);
52 
53  static std::string
54  keys();
55 
56  static std::string
57  time_iso8601();
58 
59  static void
60  add_time_iso8601(pmt::pmt_t &m);
61 
62  static void
63  add_pdu(pmt::pmt_t &m, const uint8_t *in, size_t len);
64 
65  static void
66  add_crc_valid(pmt::pmt_t &m, bool valid);
67 
68  static void
69  add_sample_start(pmt::pmt_t &m, uint64_t idx);
70 
71  static void
72  add_sample_cnt(pmt::pmt_t &m, uint64_t cnt);
73 
74  static void
75  add_symbol_erasures(pmt::pmt_t &m, uint32_t cnt);
76 
77  static void
78  add_corrected_bits(pmt::pmt_t &m, uint32_t cnt);
79 
80  static void
81  add_freq_offset(pmt::pmt_t &m, double offset);
82 
83  static void
84  add_snr(pmt::pmt_t &m, float snr);
85 
86  static Json::Value
87  to_json(const pmt::pmt_t &m);
88 };
89 
90 } // namespace satnogs
91 
92 } // namespace gr
93 
94 
95 #endif /* INCLUDE_SATNOGS_METADATA_H_ */
Definition: metadata.h:41
enum gr::satnogs::metadata::key key_t
Definition: metadata.h:39
Definition: metadata.h:46
Definition: metadata.h:42
Definition: amsat_duv_decoder.h:29
Definition: metadata.h:44
Definition: metadata.h:43
Definition: metadata.h:40
key
Definition: metadata.h:37
#define SATNOGS_API
Definition: api.h:30
int k
Definition: decode_rs.h:71
Definition: metadata.h:35