Format all C++ files using the astyle beautifier

This commit is contained in:
Manolis Surligas 2019-09-12 16:25:10 +03:00
parent a5caed2ca9
commit e09c180f84
125 changed files with 11718 additions and 12132 deletions

View File

@ -26,17 +26,14 @@
#include <string>
#include <deque>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief AMSAT 8b10b + CCSDS RS DUV decoder
*
*/
class SATNOGS_API amsat_duv_decoder : public decoder
{
class SATNOGS_API amsat_duv_decoder : public decoder {
public:
static const size_t
@ -58,8 +55,7 @@ public:
reset();
private:
typedef enum
{
typedef enum {
SEARCH_SYNC, DECODING
} d_state_t;
@ -88,8 +84,7 @@ private:
inline uint16_t
pack_10b_word(size_t idx);
int d_lookup_8b10b[2][256] =
{
int d_lookup_8b10b[2][256] = {
// RD = -1 cases
{
/* 00 */0x274,
@ -347,7 +342,8 @@ private:
/* fc */0x4ee,
/* fd */0x2e1,
/* fe */0x1e1,
/* ff */0x2b1, }, // RD = +1 cases
/* ff */0x2b1,
}, // RD = +1 cases
{
/* 00 */0x58b,
/* 01 */0x62b,
@ -604,7 +600,9 @@ private:
/* fc */0x0e1,
/* fd */0x51e,
/* fe */0x61e,
/* ff */0x54e, } };
/* ff */0x54e,
}
};
};
} // namespace satnogs

View File

@ -27,11 +27,9 @@
#include <stdint.h>
#include <string>
namespace gr
{
namespace gr {
namespace satnogs
{
namespace satnogs {
const size_t AX25_MIN_ADDR_LEN = 14;
const size_t AX25_MAX_ADDR_LEN = 28;
const size_t AX25_MIN_CTRL_LEN = 1;
@ -46,26 +44,22 @@ namespace gr
/**
* AX.25 Frame types
*/
typedef enum
{
typedef enum {
AX25_I_FRAME, //!< AX25_I_FRAME Information frame
AX25_S_FRAME, //!< AX25_S_FRAME Supervisory frame
AX25_U_FRAME, //!< AX25_U_FRAME Unnumbered frame
AX25_UI_FRAME /**!< AX25_UI_FRAME Unnumbered information frame */
} ax25_frame_type_t;
typedef enum
{
typedef enum {
AX25_ENC_FAIL, AX25_ENC_OK
} ax25_encode_status_t;
typedef enum
{
typedef enum {
AX25_DEC_FAIL, AX25_DEC_OK
} ax25_decode_status_t;
typedef struct
{
typedef struct {
uint8_t address[AX25_MAX_ADDR_LEN];
size_t address_len;
uint16_t ctrl;

View File

@ -27,10 +27,8 @@
#include <deque>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief AX.25 decoder that supports the legacy hardware radios.
@ -52,8 +50,7 @@ namespace satnogs
* \ingroup satnogs
*
*/
class SATNOGS_API ax25_decoder : public decoder
{
class SATNOGS_API ax25_decoder : public decoder {
public:
/**
@ -117,8 +114,7 @@ public:
reset();
private:
typedef enum
{
typedef enum {
NO_SYNC, IN_SYNC, DECODING
} decoding_state_t;

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/sync_block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief AX.25 encoder block that supports the legacy hardware radios.
@ -39,8 +37,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API ax25_encoder_mb : virtual public gr::sync_block
{
class SATNOGS_API ax25_encoder_mb : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<ax25_encoder_mb> sptr;

View File

@ -73,15 +73,17 @@ base64_encode (unsigned char const *bytes_to_encode, unsigned int in_len)
+ ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;
for (i = 0; (i < 4); i++)
for (i = 0; (i < 4); i++) {
ret += base64_chars[char_array_4[i]];
}
i = 0;
}
}
if (i) {
for (j = i; j < 3; j++)
for (j = i; j < 3; j++) {
char_array_3[j] = '\0';
}
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03) << 4)
@ -89,11 +91,13 @@ base64_encode (unsigned char const *bytes_to_encode, unsigned int in_len)
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2)
+ ((char_array_3[2] & 0xc0) >> 6);
for (j = 0; (j < i + 1); j++)
for (j = 0; (j < i + 1); j++) {
ret += base64_chars[char_array_4[j]];
}
while ((i++ < 3))
while ((i++ < 3)) {
ret += '=';
}
}
@ -116,8 +120,9 @@ base64_decode (std::string const &encoded_string)
char_array_4[i++] = encoded_string[in_];
in_++;
if (i == 4) {
for (i = 0; i < 4; i++)
for (i = 0; i < 4; i++) {
char_array_4[i] = base64_chars.find(char_array_4[i]) & 0xff;
}
char_array_3[0] = (char_array_4[0] << 2)
+ ((char_array_4[1] & 0x30) >> 4);
@ -125,23 +130,26 @@ base64_decode (std::string const &encoded_string)
+ ((char_array_4[2] & 0x3c) >> 2);
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
for (i = 0; (i < 3); i++)
for (i = 0; (i < 3); i++) {
ret += char_array_3[i];
}
i = 0;
}
}
if (i) {
for (j = 0; j < i; j++)
for (j = 0; j < i; j++) {
char_array_4[j] = base64_chars.find(char_array_4[j]) & 0xff;
}
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
char_array_3[1] = ((char_array_4[1] & 0xf) << 4)
+ ((char_array_4[2] & 0x3c) >> 2);
for (j = 0; (j < i - 1); j++)
for (j = 0; (j < i - 1); j++) {
ret += char_array_3[j];
}
}
return ret;
}

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/sync_block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief This block corrects the doppler effect between the ground
@ -38,8 +36,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API coarse_doppler_correction_cc : virtual public gr::sync_block
{
class SATNOGS_API coarse_doppler_correction_cc : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<coarse_doppler_correction_cc> sptr;

View File

@ -25,17 +25,14 @@
#include <vector>
#include <deque>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief <+description+>
*
*/
class SATNOGS_API convolutional_deinterleaver
{
class SATNOGS_API convolutional_deinterleaver {
public:
convolutional_deinterleaver(size_t branches, size_t M);
~convolutional_deinterleaver();

View File

@ -23,17 +23,14 @@
#include <satnogs/api.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* CRC class providing a range of different CRC calculation static methods
*
*/
class SATNOGS_API crc
{
class SATNOGS_API crc {
public:
typedef enum crc_type {
PDU = 0,

View File

@ -25,10 +25,8 @@
#include <satnogs/api.h>
#include <gnuradio/sync_block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief CW encoder block, mainly for debugging and testing purposes.
@ -37,8 +35,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API cw_encoder : virtual public gr::sync_block
{
class SATNOGS_API cw_encoder : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<cw_encoder> sptr;

View File

@ -27,10 +27,8 @@
#define MIN_WPM 5
#define MAX_WPM 50
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief The CW to Symbol block tries to translate the input signal
@ -42,8 +40,7 @@ namespace gr
*
* \ingroup satnogs
*/
class SATNOGS_API cw_to_symbol : virtual public gr::sync_block
{
class SATNOGS_API cw_to_symbol : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<cw_to_symbol> sptr;

File diff suppressed because it is too large Load Diff

View File

@ -24,18 +24,15 @@
#include <satnogs/api.h>
#include <gnuradio/block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief A block for debug reasons producing specific messages
* \ingroup satnogs
*
*/
class SATNOGS_API debug_msg_source : virtual public gr::block
{
class SATNOGS_API debug_msg_source : virtual public gr::block {
public:
typedef boost::shared_ptr<debug_msg_source> sptr;

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief A block for debug reasons producing specific messages.
@ -36,8 +34,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API debug_msg_source_raw : virtual public gr::block
{
class SATNOGS_API debug_msg_source_raw : virtual public gr::block {
public:
typedef boost::shared_ptr<debug_msg_source_raw> sptr;

View File

@ -26,16 +26,13 @@
#include <cstdlib>
#include <pmt/pmt.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/**
* The status of the decoder
*/
class decoder_status
{
class decoder_status {
public:
int consumed; /**< The number of input items consumed */
bool decode_success; /**< Indicated if there was a successful decoding */
@ -63,8 +60,7 @@ typedef class decoder_status decoder_status_t;
* appropriate decoder class that implements this abstract class API.
*
*/
class SATNOGS_API decoder
{
class SATNOGS_API decoder {
public:
typedef boost::shared_ptr<decoder> decoder_sptr;

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/sync_block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief This block corrects the doppler effect between the ground
@ -39,8 +37,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API doppler_correction_cc : virtual public gr::sync_block
{
class SATNOGS_API doppler_correction_cc : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<doppler_correction_cc> sptr;

View File

@ -26,17 +26,14 @@
#include <deque>
#include <boost/thread/mutex.hpp>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief Doppler frequency polynomial fitting tool
* \ingroup satnogs
*/
class SATNOGS_API doppler_fit
{
class SATNOGS_API doppler_fit {
public:
doppler_fit(size_t degree);

View File

@ -25,10 +25,8 @@
#include <satnogs/whitening.h>
#include <gnuradio/sync_block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief A generic frame acquisition block
@ -60,8 +58,7 @@ namespace satnogs
* \ingroup satnogs
*
*/
class SATNOGS_API frame_acquisition : virtual public gr::sync_block
{
class SATNOGS_API frame_acquisition : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<frame_acquisition> sptr;

View File

@ -41,8 +41,7 @@ namespace gr {
* \ingroup satnogs
*
*/
class SATNOGS_API frame_decoder : virtual public gr::sync_block
{
class SATNOGS_API frame_decoder : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<frame_decoder> sptr;

View File

@ -32,8 +32,7 @@ namespace gr {
* \ingroup satnogs
*
*/
class SATNOGS_API frame_encoder : virtual public gr::sync_block
{
class SATNOGS_API frame_encoder : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<frame_encoder> sptr;

View File

@ -24,18 +24,15 @@
#include <satnogs/api.h>
#include <gnuradio/block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief <+description of block+>
* \ingroup satnogs
*
*/
class SATNOGS_API frame_file_sink : virtual public gr::block
{
class SATNOGS_API frame_file_sink : virtual public gr::block {
public:
typedef boost::shared_ptr<frame_file_sink> sptr;

View File

@ -24,18 +24,15 @@
#include <satnogs/api.h>
#include <stdint.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief Class that specifies the frequency drift at a given time.
* The time is measured in samples.
* \ingroup satnogs
*/
class SATNOGS_API freq_drift
{
class SATNOGS_API freq_drift {
public:
freq_drift(uint64_t x, double y);
~freq_drift();

View File

@ -27,10 +27,8 @@
#include <cstdint>
#include <vector>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief A binary Golay (24,12,8) encoder and decoder.
@ -42,8 +40,7 @@ namespace satnogs
* John Wiley & Sons, 2006.
*
*/
class SATNOGS_API golay24
{
class SATNOGS_API golay24 {
public:
golay24();
~golay24();

View File

@ -25,10 +25,8 @@
#include <satnogs/whitening.h>
#include <satnogs/crc.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief A IEEE 802.15.4 like decoder
@ -40,8 +38,7 @@ namespace satnogs
* scheme.
*
*/
class SATNOGS_API ieee802_15_4_variant_decoder
{
class SATNOGS_API ieee802_15_4_variant_decoder {
public:
ieee802_15_4_variant_decoder(const std::vector<uint8_t> &preamble,
size_t preamble_threshold,

View File

@ -25,10 +25,8 @@
#include <gnuradio/sync_block.h>
#include <gnuradio/blocks/file_sink_base.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief This block converts a complex float input stream to short and stores
@ -39,8 +37,7 @@ namespace gr
*
*/
class SATNOGS_API iq_sink : virtual public gr::sync_block,
virtual public gr::blocks::file_sink_base
{
virtual public gr::blocks::file_sink_base {
public:
typedef boost::shared_ptr<iq_sink> sptr;

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/block.h>
#include <string>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief This block takes a PMT message from the SatNOGS decoders
@ -36,8 +34,7 @@ namespace satnogs
* \ingroup satnogs
*
*/
class SATNOGS_API json_converter : virtual public gr::block
{
class SATNOGS_API json_converter : virtual public gr::block {
public:
typedef boost::shared_ptr<json_converter> sptr;

View File

@ -24,18 +24,15 @@
#include <satnogs/api.h>
#include <gnuradio/block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief <+description of block+>
* \ingroup satnogs
*
*/
class SATNOGS_API lrpt_decoder : virtual public gr::block
{
class SATNOGS_API lrpt_decoder : virtual public gr::block {
public:
typedef boost::shared_ptr<lrpt_decoder> sptr;

View File

@ -24,18 +24,15 @@
#include <satnogs/api.h>
#include <gnuradio/sync_block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief <+description of block+>
* \ingroup satnogs
*
*/
class SATNOGS_API lrpt_sync : virtual public gr::sync_block
{
class SATNOGS_API lrpt_sync : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<lrpt_sync> sptr;

View File

@ -32,8 +32,7 @@ namespace gr {
namespace satnogs {
class SATNOGS_API metadata
{
class SATNOGS_API metadata {
public:
typedef enum key {
PDU = 0,

View File

@ -25,10 +25,8 @@
#include <satnogs/api.h>
#include <gnuradio/block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief A Morse debug source block that supports injection of random
@ -37,8 +35,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API morse_debug_source : virtual public gr::block
{
class SATNOGS_API morse_debug_source : virtual public gr::block {
public:
typedef boost::shared_ptr<morse_debug_source> sptr;

View File

@ -32,8 +32,7 @@ namespace gr {
* This block received messages from the previous blocks
* and try to decode the dot and dashes into clear text.
*/
class SATNOGS_API morse_decoder : virtual public gr::block
{
class SATNOGS_API morse_decoder : virtual public gr::block {
public:
typedef boost::shared_ptr<morse_decoder> sptr;

View File

@ -26,16 +26,13 @@
#include <string>
#include <satnogs/morse.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief Binary tree node containing the corresponding character
*/
class SATNOGS_API tree_node
{
class SATNOGS_API tree_node {
private:
const char d_char;
tree_node *d_left;
@ -68,8 +65,7 @@ namespace gr
* The tree follows the ITU International Morse code representation
* ITU-R M.1677-1
*/
class SATNOGS_API morse_tree
{
class SATNOGS_API morse_tree {
public:
morse_tree();
morse_tree(char unrecognized);

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief Block accepting clear text messages from various decoders.
@ -37,8 +35,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API multi_format_msg_sink : virtual public gr::block
{
class SATNOGS_API multi_format_msg_sink : virtual public gr::block {
public:
typedef boost::shared_ptr<multi_format_msg_sink> sptr;

View File

@ -24,18 +24,15 @@
#include <satnogs/api.h>
#include <gnuradio/sync_block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* Sink block for NOAA satellites
* \ingroup satnogs
*
*/
class SATNOGS_API noaa_apt_sink : virtual public gr::sync_block
{
class SATNOGS_API noaa_apt_sink : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<noaa_apt_sink> sptr;

View File

@ -24,18 +24,15 @@
#include <satnogs/api.h>
#include <gnuradio/sync_block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief Ogg encoder and sink block
* \ingroup satnogs
*
*/
class SATNOGS_API ogg_encoder : virtual public gr::sync_block
{
class SATNOGS_API ogg_encoder : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<ogg_encoder> sptr;

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/sync_block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief OGG source block. Reads a file with an OGG audio and
@ -36,8 +34,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API ogg_source : virtual public gr::sync_block
{
class SATNOGS_API ogg_source : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<ogg_source> sptr;

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief Parses the received AX.25 and separates the
@ -35,8 +33,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API qb50_deframer : virtual public gr::block
{
class SATNOGS_API qb50_deframer : virtual public gr::block {
public:
typedef boost::shared_ptr<qb50_deframer> sptr;

View File

@ -25,17 +25,14 @@
#include <deque>
#include <ostream>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief Implements a bit shift register
*
*/
class SATNOGS_API shift_reg
{
class SATNOGS_API shift_reg {
public:
shift_reg(size_t len);
~shift_reg();

View File

@ -119,10 +119,8 @@
#define TURN_ON 1
#define RESET 2
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief Telemetry and telecommands packet methods
* \ingroup satnogs
@ -131,8 +129,7 @@ namespace gr
/*!
* Return status codes
*/
typedef enum
{
typedef enum {
R_OBC_PKT_ILLEGAL_APPID = 0, //!< R_OBC_PKT_ILLEGAL_APPID illegal application ID
R_OBC_PKT_INV_LEN = 1, //!< R_OBC_PKT_INV_LEN invalid length
R_OBC_PKT_INC_CRC = 2, //!< R_OBC_PKT_INC_CRC incorrect CRC
@ -144,15 +141,13 @@ namespace gr
R_OBC_EOT = 8, //!< R_OBC_EOT End-of-transfer
} OBC_ret_state_t;
union _cnv
{
union _cnv {
uint32_t cnv32;
uint16_t cnv16[2];
uint8_t cnv8[4];
};
typedef struct
{
typedef struct {
/* packet id */
uint8_t ver; /* 3 bits, should be equal to 0 */
uint8_t data_field_hdr; /* 1 bit, data_field_hdr exists in data = 1 */

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief Block that accepts TCP messages with rigctl commands. Depending
@ -36,8 +34,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API tcp_rigctl_msg_source : virtual public gr::block
{
class SATNOGS_API tcp_rigctl_msg_source : virtual public gr::block {
public:
typedef boost::shared_ptr<tcp_rigctl_msg_source> sptr;

View File

@ -32,8 +32,7 @@ namespace gr {
* \ingroup satnogs
*
*/
class SATNOGS_API udp_msg_sink : virtual public gr::block
{
class SATNOGS_API udp_msg_sink : virtual public gr::block {
public:
typedef boost::shared_ptr<udp_msg_sink> sptr;

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief UDP message/command accepter.
@ -38,8 +36,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API udp_msg_source : virtual public gr::block
{
class SATNOGS_API udp_msg_source : virtual public gr::block {
public:
typedef boost::shared_ptr<udp_msg_source> sptr;

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/sync_block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief This block implements a FSK frame encoder for the UPSAT satellite.
@ -38,8 +36,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API upsat_fsk_frame_encoder : virtual public gr::sync_block
{
class SATNOGS_API upsat_fsk_frame_encoder : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<upsat_fsk_frame_encoder> sptr;

View File

@ -25,11 +25,9 @@
#include <cmath>
#include <arpa/inet.h>
namespace gr
{
namespace gr {
namespace satnogs
{
namespace satnogs {
#define htonll(x) ((1==htonl(1)) ? (x) : ((uint64_t)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32))
#define ntohll(x) ((1==ntohl(1)) ? (x) : ((uint64_t)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32))
@ -60,8 +58,8 @@ bit_count (unsigned int x)
return (((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
}
static const uint8_t _bytes_reversed[256] =
{ 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0,
static const uint8_t _bytes_reversed[256] = {
0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0,
0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68,
0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84,
0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34,
@ -84,7 +82,8 @@ static const uint8_t _bytes_reversed[256] =
0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7,
0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, 0x0F, 0x8F, 0x4F,
0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF,
0x7F, 0xFF };
0x7F, 0xFF
};
/**
* Reverse the bits of the byte b.
@ -126,8 +125,8 @@ reverse_uint64_bytes (uint64_t x)
static inline uint32_t
update_crc32(uint32_t crc, const uint8_t *data, size_t len)
{
static const uint32_t crc32_lut[256] =
{ 0x00000000L, 0x77073096L, 0xEE0E612CL, 0x990951BAL, 0x076DC419L,
static const uint32_t crc32_lut[256] = {
0x00000000L, 0x77073096L, 0xEE0E612CL, 0x990951BAL, 0x076DC419L,
0x706AF48FL, 0xE963A535L, 0x9E6495A3L, 0x0EDB8832L, 0x79DCB8A4L,
0xE0D5E91EL, 0x97D2D988L, 0x09B64C2BL, 0x7EB17CBDL, 0xE7B82D07L,
0x90BF1D91L, 0x1DB71064L, 0x6AB020F2L, 0xF3B97148L, 0x84BE41DEL,
@ -178,7 +177,8 @@ update_crc32 (uint32_t crc, const uint8_t *data, size_t len)
0xBDBDF21CL, 0xCABAC28AL, 0x53B39330L, 0x24B4A3A6L, 0xBAD03605L,
0xCDD70693L, 0x54DE5729L, 0x23D967BFL, 0xB3667A2EL, 0xC4614AB8L,
0x5D681B02L, 0x2A6F2B94L, 0xB40BBE37L, 0xC30C8EA1L, 0x5A05DF1BL,
0x2D02EF8DL };
0x2D02EF8DL
};
register uint32_t i;
for (i = 0; i < len; i++) {

View File

@ -24,10 +24,8 @@
#include <satnogs/api.h>
#include <gnuradio/sync_block.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief This block computes the waterfall of the incoming signal
@ -39,8 +37,7 @@ namespace gr
* \ingroup satnogs
*
*/
class SATNOGS_API waterfall_sink : virtual public gr::sync_block
{
class SATNOGS_API waterfall_sink : virtual public gr::sync_block {
public:
typedef boost::shared_ptr<waterfall_sink> sptr;

View File

@ -25,17 +25,14 @@
#include <gnuradio/digital/lfsr.h>
#include <boost/shared_ptr.hpp>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* \brief Performs data whitening and de-whitening
*
*/
class SATNOGS_API whitening
{
class SATNOGS_API whitening {
public:
static int base_unique_id;

View File

@ -31,10 +31,8 @@ extern "C" {
#include <fec.h>
}
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/**
* Actual frame size without RS padding and parity.
@ -42,8 +40,7 @@ namespace satnogs
*/
const size_t amsat_duv_decoder::amsat_fox_duv_frame_size = 6 + 58;
const uint8_t amsat_duv_decoder::amsat_fox_spacecraft_id[]
{
const uint8_t amsat_duv_decoder::amsat_fox_spacecraft_id[] {
0x1 /* FOX-1A */,
0x2 /* FOX-1B */,
0x3 /* FOX-1C */,
@ -210,8 +207,7 @@ amsat_duv_decoder::decode (const void *in, int len)
if (d_bitstream.size() < 11) {
return status;
}
switch (d_state)
{
switch (d_state) {
case SEARCH_SYNC:
for (size_t i = 0; i < d_bitstream.size(); i++) {
d_data_reg = (d_data_reg << 1) | (d_bitstream[i] & 0x1);

View File

@ -27,10 +27,8 @@
#include <satnogs/ax25.h>
#include <satnogs/metadata.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
decoder::decoder_sptr
ax25_decoder::make(const std::string &addr, uint8_t ssid, bool promisc,
@ -105,8 +103,7 @@ ax25_decoder::_decode (decoder_status_t& status)
{
while (1) {
bool cont = false;
switch (d_state)
{
switch (d_state) {
case NO_SYNC:
for (size_t i = 0; i < d_bitstream.size(); i++) {
decode_1b(d_bitstream[i]);

View File

@ -28,10 +28,8 @@
#include <satnogs/log.h>
#include <satnogs/ax25.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
ax25_encoder_mb::sptr
ax25_encoder_mb::make(const std::string &dest_addr, uint8_t dest_ssid,

View File

@ -25,13 +25,10 @@
#include <satnogs/ax25_encoder_mb.h>
#include <gnuradio/digital/lfsr.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class ax25_encoder_mb_impl : public ax25_encoder_mb
{
class ax25_encoder_mb_impl : public ax25_encoder_mb {
private:
const size_t d_preamble_len;
const size_t d_postamble_len;

View File

@ -27,10 +27,8 @@
#include <volk/volk.h>
#include <satnogs/log.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
coarse_doppler_correction_cc::sptr
coarse_doppler_correction_cc::make(double target_freq,

View File

@ -24,13 +24,10 @@
#include <satnogs/coarse_doppler_correction_cc.h>
#include <gnuradio/fxpt_nco.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class coarse_doppler_correction_cc_impl : public coarse_doppler_correction_cc
{
class coarse_doppler_correction_cc_impl : public coarse_doppler_correction_cc {
private:
double d_target_freq;
const double d_samp_rate;

View File

@ -25,10 +25,8 @@
#include <gnuradio/io_signature.h>
#include <satnogs/convolutional_deinterleaver.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
convolutional_deinterleaver::convolutional_deinterleaver(size_t branches,
size_t M) :

View File

@ -25,14 +25,12 @@
#include <gnuradio/io_signature.h>
#include <satnogs/crc.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
const uint16_t crc::crc16_ccitt_table_reverse[256] =
{ 0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF, 0x8C48,
const uint16_t crc::crc16_ccitt_table_reverse[256] = {
0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF, 0x8C48,
0x9DC1, 0xAF5A, 0xBED3, 0xCA6C, 0xDBE5, 0xE97E, 0xF8F7, 0x1081, 0x0108,
0x3393, 0x221A, 0x56A5, 0x472C, 0x75B7, 0x643E, 0x9CC9, 0x8D40, 0xBFDB,
0xAE52, 0xDAED, 0xCB64, 0xF9FF, 0xE876, 0x2102, 0x308B, 0x0210, 0x1399,
@ -60,10 +58,11 @@ const uint16_t crc::crc16_ccitt_table_reverse[256] =
0xF687, 0xC41C, 0xD595, 0xA12A, 0xB0A3, 0x8238, 0x93B1, 0x6B46, 0x7ACF,
0x4854, 0x59DD, 0x2D62, 0x3CEB, 0x0E70, 0x1FF9, 0xF78F, 0xE606, 0xD49D,
0xC514, 0xB1AB, 0xA022, 0x92B9, 0x8330, 0x7BC7, 0x6A4E, 0x58D5, 0x495C,
0x3DE3, 0x2C6A, 0x1EF1, 0x0F78 };
0x3DE3, 0x2C6A, 0x1EF1, 0x0F78
};
const uint16_t crc::crc16_ccitt_table[256] =
{ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, 0x8108,
const uint16_t crc::crc16_ccitt_table[256] = {
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, 0x8108,
0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, 0x1231, 0x0210,
0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, 0x9339, 0x8318, 0xB37B,
0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, 0x2462, 0x3443, 0x0420, 0x1401,
@ -91,7 +90,8 @@ const uint16_t crc::crc16_ccitt_table[256] =
0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, 0x7C26, 0x6C07,
0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, 0xEF1F, 0xFF3E, 0xCF5D,
0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, 0x6E17, 0x7E36, 0x4E55, 0x5E74,
0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 };
0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
};
uint16_t
crc::crc16_ccitt_reversed(const uint8_t *data, size_t len)
@ -143,8 +143,9 @@ uint16_t
crc::crc16_ibm(const uint8_t *data, size_t len)
{
uint16_t crc = 0xFFFF;
for (size_t i = 0; i < len; i++)
for (size_t i = 0; i < len; i++) {
crc = update_crc16_ibm(data[i], crc);
}
return crc;
}

View File

@ -28,13 +28,10 @@
#include <satnogs/morse.h>
#include <gnuradio/fxpt_nco.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class cw_encoder_impl : public cw_encoder
{
class cw_encoder_impl : public cw_encoder {
private:
const double d_samp_rate;
const double d_cw_freq;

View File

@ -37,10 +37,8 @@
#endif
#include <volk/volk.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
cw_to_symbol::sptr
cw_to_symbol::make(double sampling_rate, float threshold, float conf_level,
@ -255,8 +253,7 @@ cw_to_symbol_impl::work (int noutput_items,
/* From now one, we handle the input in multiples of a window */
for (i = 0; i < (size_t) noutput_items / d_window_size; i++) {
triggered = is_triggered(in + i * d_window_size, d_window_size);
switch (d_dec_state)
{
switch (d_dec_state) {
case SEARCH_DOT:
if (triggered) {
d_window_cnt++;

View File

@ -25,16 +25,12 @@
#include <satnogs/morse.h>
#include <satnogs/cw_to_symbol.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class cw_to_symbol_impl : public cw_to_symbol
{
class cw_to_symbol_impl : public cw_to_symbol {
typedef enum
{
typedef enum {
NO_SYNC, SEARCH_DOT, SEARCH_DASH, SEARCH_SPACE
} cw_dec_state_t;

View File

@ -26,10 +26,8 @@
#include "debug_msg_source_impl.h"
#include <boost/chrono.hpp>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
debug_msg_source::sptr
debug_msg_source::make(const std::string &msg, double delay, bool repeat)

View File

@ -24,13 +24,10 @@
#include <satnogs/debug_msg_source.h>
#include <boost/thread.hpp>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class debug_msg_source_impl : public debug_msg_source
{
class debug_msg_source_impl : public debug_msg_source {
private:
const size_t d_buf_len;
const double d_delay;

View File

@ -25,10 +25,8 @@
#include <gnuradio/io_signature.h>
#include "debug_msg_source_raw_impl.h"
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
debug_msg_source_raw::sptr
debug_msg_source_raw::make(const std::vector<uint8_t> &msg, double delay,

View File

@ -23,13 +23,10 @@
#include <satnogs/debug_msg_source_raw.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class debug_msg_source_raw_impl : public debug_msg_source_raw
{
class debug_msg_source_raw_impl : public debug_msg_source_raw {
private:
const size_t d_buf_len;
const double d_delay;

View File

@ -25,10 +25,8 @@
#include <gnuradio/io_signature.h>
#include <satnogs/decoder.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
int decoder::base_unique_id = 1;

View File

@ -27,10 +27,8 @@
#include <satnogs/log.h>
#include <volk/volk.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
doppler_correction_cc::sptr
doppler_correction_cc::make(double target_freq, double sampling_rate,

View File

@ -27,13 +27,10 @@
#include <gnuradio/fxpt_nco.h>
#include <deque>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class doppler_correction_cc_impl : public doppler_correction_cc
{
class doppler_correction_cc_impl : public doppler_correction_cc {
private:
const double d_target_freq;
const double d_samp_rate;

View File

@ -27,10 +27,8 @@
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/lu.hpp>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/**
* Creates a polynomial fitting routine.

View File

@ -31,10 +31,8 @@
#include <satnogs/utils.h>
#include <arpa/inet.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
frame_acquisition::sptr
frame_acquisition::make(variant_t variant,
@ -194,8 +192,7 @@ frame_acquisition_impl::work (int noutput_items,
{
const uint8_t *in = (const uint8_t *) input_items[0];
switch(d_state)
{
switch (d_state) {
case SEARCHING:
return searching_preamble(in, noutput_items);
case SEARCHING_SYNC:

View File

@ -24,13 +24,10 @@
#include <satnogs/shift_reg.h>
#include <satnogs/frame_acquisition.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class frame_acquisition_impl : public frame_acquisition
{
class frame_acquisition_impl : public frame_acquisition {
public:
frame_acquisition_impl(variant_t variant,
@ -55,8 +52,7 @@ private:
/**
* Decoding FSM
*/
typedef enum
{
typedef enum {
SEARCHING, //!< when searching for the start of the preamble
SEARCHING_SYNC,
DECODING_GENERIC_FRAME_LEN,

View File

@ -25,10 +25,8 @@
#include <gnuradio/io_signature.h>
#include "frame_decoder_impl.h"
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
frame_decoder::sptr
frame_decoder::make(decoder::decoder_sptr decoder_object, int input_size)

View File

@ -23,13 +23,10 @@
#include <satnogs/frame_decoder.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class frame_decoder_impl : public frame_decoder
{
class frame_decoder_impl : public frame_decoder {
public:
frame_decoder_impl(decoder::decoder_sptr decoder_object, int input_size);

View File

@ -25,10 +25,8 @@
#include <gnuradio/io_signature.h>
#include "frame_encoder_impl.h"
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
frame_encoder::sptr
frame_encoder::make(bool append_preamble, bool ecss_encap,

View File

@ -23,13 +23,10 @@
#include <satnogs/frame_encoder.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class frame_encoder_impl : public frame_encoder
{
class frame_encoder_impl : public frame_encoder {
private:
// Nothing to declare in this block.

View File

@ -25,10 +25,8 @@
#include <gnuradio/io_signature.h>
#include "frame_file_sink_impl.h"
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
frame_file_sink::sptr
frame_file_sink::make(const std::string &prefix_name, int output_type)
@ -86,25 +84,21 @@ namespace gr
filename.append(buffer);
if (filename.compare(d_filename_prev)==0)
{
if (filename.compare(d_filename_prev) == 0) {
d_filename_prev.assign(filename);
filename.append("_");
d_counter++;
filename.append(std::to_string(d_counter));
}
else
{
else {
d_filename_prev.assign(filename);
d_counter = 0;
}
uint8_t *su;
switch (d_output_type)
{
case 0:
{
switch (d_output_type) {
case 0: {
/* Binary form */
std::ofstream fd(filename.c_str());
fd.write((const char *) pmt::blob_data(msg),
@ -112,8 +106,7 @@ namespace gr
fd.close();
break;
}
case 1:
{
case 1: {
/* aHex annotated, dd .txt to filename */
filename.append(".txt");
std::ofstream fd(filename.c_str());
@ -125,8 +118,7 @@ namespace gr
fd.close();
break;
}
case 2:
{
case 2: {
/* Binary annotated, add .txt to filename */
filename.append(".txt");
std::ofstream fd(filename.c_str());

View File

@ -26,13 +26,10 @@
#include <fstream>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class frame_file_sink_impl : public frame_file_sink
{
class frame_file_sink_impl : public frame_file_sink {
private:
const std::string d_prefix_name;
int d_output_type;

View File

@ -25,10 +25,8 @@
#include <gnuradio/io_signature.h>
#include <satnogs/freq_drift.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
freq_drift::freq_drift(uint64_t x, double y) :
d_x(x),

View File

@ -28,10 +28,8 @@
#include <satnogs/utils.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*
* Matrix P was retrieved by:
@ -40,13 +38,15 @@ namespace satnogs
* Matrix mentioned by Morelos-Zaragoza, Robert H. "The art of error correcting coding."
* John Wiley & Sons, 2006 was not suitable.
*/
const std::vector<uint32_t> golay24::G_P =
{0x8ED, 0x1DB, 0x3B5, 0x769, 0xED1, 0xDA3, 0xB47, 0x68F, 0xD1D, 0xA3B, 0x477,
0xFFE};
const std::vector<uint32_t> golay24::G_P = {
0x8ED, 0x1DB, 0x3B5, 0x769, 0xED1, 0xDA3, 0xB47, 0x68F, 0xD1D, 0xA3B, 0x477,
0xFFE
};
const std::vector<uint32_t> golay24::G_I =
{ 0x800, 0x400, 0x200, 0x100, 0x080, 0x040, 0x020, 0x010, 0x008, 0x004, 0x002,
0x001 };
const std::vector<uint32_t> golay24::G_I = {
0x800, 0x400, 0x200, 0x100, 0x080, 0x040, 0x020, 0x010, 0x008, 0x004, 0x002,
0x001
};
golay24::golay24()
{

View File

@ -26,10 +26,8 @@
#include <satnogs/ieee802_15_4_variant_decoder.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
ieee802_15_4_variant_decoder::ieee802_15_4_variant_decoder(
const std::vector<uint8_t> &preamble, size_t preamble_threshold,

View File

@ -27,10 +27,8 @@
#include <volk/volk.h>
#include <stdexcept>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
iq_sink::sptr
iq_sink::make(const float scale, const char *filename, bool append,
@ -74,20 +72,19 @@ namespace gr
{
gr_complex *inbuf = (gr_complex *) input_items[0];
int nwritten = 0;
switch (d_status)
{
case IQ_SINK_STATUS_NULL:
{
switch (d_status) {
case IQ_SINK_STATUS_NULL: {
return noutput_items;
}
case IQ_SINK_STATUS_ACTIVE:
{
case IQ_SINK_STATUS_ACTIVE: {
/* update d_fp is required */
do_update();
if (!d_fp)
/* drop output on the floor */
{
return noutput_items;
}
volk_32f_s32f_convert_16i(d_out, (float *) inbuf, d_scale,
noutput_items * 2);

View File

@ -25,19 +25,15 @@
#include <chrono>
#include <fstream>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class iq_sink_impl : public iq_sink
{
class iq_sink_impl : public iq_sink {
private:
/**
* The different values for iq sink status
*/
typedef enum
{
typedef enum {
IQ_SINK_STATUS_NULL = 0, //!< IQ_SINK_STATUS_NULL IQ sink block behaves just like a null sink
IQ_SINK_STATUS_ACTIVE = 1, //!< IQ_SINK_STATUS_ACTIVE IQ sink block is active
} iq_sink_status_t;

View File

@ -28,10 +28,8 @@
#include <json/json.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
json_converter::sptr
json_converter::make(const std::string &extra)

View File

@ -23,13 +23,10 @@
#include <satnogs/json_converter.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class json_converter_impl : public json_converter
{
class json_converter_impl : public json_converter {
public:
json_converter_impl(const std::string &extra);

View File

@ -32,10 +32,8 @@ extern "C" {
#include <fec.h>
}
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
lrpt_decoder::sptr
lrpt_decoder::make()

View File

@ -25,13 +25,10 @@
#include <satnogs/convolutional_deinterleaver.h>
#include <satnogs/whitening.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class lrpt_decoder_impl : public lrpt_decoder
{
class lrpt_decoder_impl : public lrpt_decoder {
public:
lrpt_decoder_impl();

View File

@ -30,10 +30,8 @@
#include <volk/volk.h>
#include <gnuradio/blocks/count_bits.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
lrpt_sync::sptr
lrpt_sync::make(size_t threshold)

View File

@ -25,13 +25,10 @@
#include <satnogs/convolutional_deinterleaver.h>
#include <gnuradio/digital/constellation.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class lrpt_sync_impl : public lrpt_sync
{
class lrpt_sync_impl : public lrpt_sync {
public:
lrpt_sync_impl(size_t threshold);
~lrpt_sync_impl();

View File

@ -28,10 +28,8 @@
#include <satnogs/morse.h>
#include <random>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
morse_debug_source::sptr
morse_debug_source::make(const size_t wpm,
@ -60,12 +58,12 @@ namespace gr
d_p(error_prob),
d_seq_pause_ms(seq_pause_ms),
d_run(true),
d_chars
{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
d_chars {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' },
d_symbols
{ ".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..",
d_symbols {
".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..",
".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-",
".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--",
"--..", ".----", "..---", "...--", "....-", ".....", "-....",

View File

@ -27,13 +27,10 @@
#include <algorithm>
#include <vector>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class morse_debug_source_impl : public morse_debug_source
{
class morse_debug_source_impl : public morse_debug_source {
private:
const size_t d_wpm;
const bool d_inject_errors;

View File

@ -26,10 +26,8 @@
#include <gnuradio/io_signature.h>
#include "morse_decoder_impl.h"
#include <satnogs/log.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
morse_decoder::sptr
morse_decoder::make(char unrecognized_char, size_t min_frame_len)
@ -45,8 +43,7 @@ morse_decoder_impl::symbol_msg_handler (pmt::pmt_t msg)
morse_symbol_t s;
s = (morse_symbol_t) pmt::to_long(msg);
switch (s)
{
switch (s) {
case MORSE_DOT:
case MORSE_DASH:
case MORSE_S_SPACE:

View File

@ -24,13 +24,10 @@
#include <satnogs/morse_decoder.h>
#include <satnogs/morse_tree.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class morse_decoder_impl : public morse_decoder
{
class morse_decoder_impl : public morse_decoder {
public:
morse_decoder_impl(char unrecognized_char, size_t min_frame_len);

View File

@ -28,10 +28,8 @@
#include <satnogs/log.h>
#include <string.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
/*!
* Constructs a Morse code tree for Morse code decoding
@ -203,8 +201,7 @@ namespace gr
if (d_word_len == d_buff_len) {
return false;
}
switch (s)
{
switch (s) {
case MORSE_DOT:
if (d_current->get_left_child()) {
d_current = d_current->get_left_child();

View File

@ -28,10 +28,8 @@
#include <iostream>
#include <iomanip>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
multi_format_msg_sink::sptr
multi_format_msg_sink::make(size_t format,
@ -59,8 +57,7 @@ namespace gr
d_fos << "[" << buf << "]";
}
switch (d_format)
{
switch (d_format) {
case 0:
d_fos << s << std::endl;
break;
@ -99,8 +96,7 @@ namespace gr
std::cout << "[" << buf << "]";
}
switch (d_format)
{
switch (d_format) {
case 0: // binary
for (size_t i = 0; i < pmt::blob_length(msg); i++) {
std::cout << s[i];

View File

@ -24,13 +24,10 @@
#include <satnogs/multi_format_msg_sink.h>
#include <fstream>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class multi_format_msg_sink_impl : public multi_format_msg_sink
{
class multi_format_msg_sink_impl : public multi_format_msg_sink {
private:
void
msg_handler_stdout(pmt::pmt_t msg);

View File

@ -27,10 +27,8 @@
#include <cmath>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
// Noaa apt sync pattern A
// (see https://sourceforge.isae.fr/attachments/download/1813/apt_synch.gif)
const bool noaa_apt_sink_impl::synca_seq[] = {false, false, false, false,
@ -42,7 +40,8 @@ namespace gr
true, true, false, false, // Pulse 6
true, true, false, false, // Pulse 7
false, false, false, false,
false, false, false, false};
false, false, false, false
};
// Noaa apt sync pattern B
// (see https://sourceforge.isae.fr/attachments/download/1813/apt_synch.gif)
@ -54,7 +53,8 @@ namespace gr
true, true, true, false, false,
true, true, true, false, false,
true, true, true, false, false,
false};
false
};
@ -126,18 +126,21 @@ namespace gr
}
}
noaa_apt_sink_impl::~noaa_apt_sink_impl () {
noaa_apt_sink_impl::~noaa_apt_sink_impl()
{
}
bool
noaa_apt_sink_impl::stop(){
noaa_apt_sink_impl::stop()
{
if (!d_image_received) {
write_image(d_full_image, d_filename_png);
}
return true;
}
void noaa_apt_sink_impl::set_pixel (size_t x, size_t y, float sample) {
void noaa_apt_sink_impl::set_pixel(size_t x, size_t y, float sample)
{
// We can encounter NaN here since skip_to read the history whithout checking
if (std::isnan(sample)) {
sample = 0.0;
@ -150,7 +153,8 @@ namespace gr
}
void
noaa_apt_sink_impl::skip_to (size_t new_x, size_t pos, const float *samples) {
noaa_apt_sink_impl::skip_to(size_t new_x, size_t pos, const float *samples)
{
// Check if the skip is forward or backward
if (new_x > d_current_x) {
// In case it is forward there will be a new_x - d_current_x sized hole
@ -167,7 +171,8 @@ namespace gr
noaa_apt_sync_marker
noaa_apt_sink_impl::is_marker(size_t pos, const float *samples) {
noaa_apt_sink_impl::is_marker(size_t pos, const float *samples)
{
// Initialize counters for 'hacky' correlation
size_t count_a = 0;
size_t count_b = 0;

View File

@ -28,14 +28,11 @@
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
enum class noaa_apt_sync_marker {SYNC_A, SYNC_B, NONE};
class noaa_apt_sink_impl : public noaa_apt_sink
{
class noaa_apt_sink_impl : public noaa_apt_sink {
private:
// Factor exponential smoothing average,
// which is used for sync pattern detection

View File

@ -31,10 +31,8 @@
#include <time.h>
#include <math.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
ogg_encoder::sptr
ogg_encoder::make(char *filename, double samp_rate, float quality)
@ -57,8 +55,9 @@ namespace gr
d_samp_rate = samp_rate;
vorbis_info_init(&d_vi);
int ret = vorbis_encode_init_vbr(&d_vi, 1, d_samp_rate, d_quality);
if (ret)
if (ret) {
exit(1);
}
vorbis_comment_init(&d_vc);
vorbis_comment_add_tag(&d_vc, "ENCODER", "satnogs ogg encoder");
@ -81,8 +80,9 @@ namespace gr
int result = 1;
while (result) {
result = ogg_stream_flush(&d_os, &d_og);
if (result == 0)
if (result == 0) {
break;
}
fwrite(d_og.header, 1, d_og.header_len, d_out);
fwrite(d_og.body, 1, d_og.body_len, d_out);
}
@ -121,15 +121,17 @@ namespace gr
int result = 1;
while (result) {
int result = ogg_stream_pageout(&d_os, &d_og);
if (result == 0)
if (result == 0) {
break;
}
fwrite(d_og.header, 1, d_og.header_len, d_out);
fwrite(d_og.body, 1, d_og.body_len, d_out);
if (ogg_page_eos (&d_og))
if (ogg_page_eos(&d_og)) {
result = 1;
}
}
}
}
return noutput_items;
}

View File

@ -24,13 +24,10 @@
#include <satnogs/ogg_encoder.h>
#include <vorbis/vorbisenc.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class ogg_encoder_impl : public ogg_encoder
{
class ogg_encoder_impl : public ogg_encoder {
private:
// Nothing to declare in this block.
ogg_stream_state d_os;

View File

@ -25,13 +25,10 @@
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
class ogg_source_impl : public ogg_source
{
class ogg_source_impl : public ogg_source {
private:
const int d_channels;
const bool d_repeat;

View File

@ -23,10 +23,8 @@
#include "qa_ax25_decoder.h"
#include <satnogs/ax25_decoder.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
void
qa_ax25_decoder::t1()

View File

@ -27,8 +27,7 @@
namespace gr {
namespace satnogs {
class qa_ax25_decoder : public CppUnit::TestCase
{
class qa_ax25_decoder : public CppUnit::TestCase {
public:
CPPUNIT_TEST_SUITE(qa_ax25_decoder);
CPPUNIT_TEST(t1);

View File

@ -23,10 +23,8 @@
#include "qa_crc.h"
#include <satnogs/crc.h>
namespace gr
{
namespace satnogs
{
namespace gr {
namespace satnogs {
void
qa_crc::t1()

View File

@ -27,8 +27,7 @@
namespace gr {
namespace satnogs {
class qa_crc : public CppUnit::TestCase
{
class qa_crc : public CppUnit::TestCase {
public:
CPPUNIT_TEST_SUITE(qa_crc);
CPPUNIT_TEST(t1);

View File

@ -29,8 +29,7 @@ namespace gr {
namespace satnogs {
class qa_golay24 : public CppUnit::TestCase
{
class qa_golay24 : public CppUnit::TestCase {
public:
CPPUNIT_TEST_SUITE(qa_golay24);
CPPUNIT_TEST(example_47);

Some files were not shown because too many files have changed in this diff Show More