mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
zapit/src/transponder.cpp: add description() to get commonly used transponder description string
This commit is contained in:
@@ -38,9 +38,9 @@ public:
|
|||||||
struct dvb_frontend_parameters feparams;
|
struct dvb_frontend_parameters feparams;
|
||||||
unsigned char polarization;
|
unsigned char polarization;
|
||||||
bool updated;
|
bool updated;
|
||||||
bool scanned;
|
|
||||||
|
|
||||||
transponder(fe_type_t fType, const transponder_id_t t_id, const struct dvb_frontend_parameters p_feparams, const uint8_t p_polarization = 0);
|
transponder(fe_type_t fType, const transponder_id_t t_id, const struct dvb_frontend_parameters p_feparams, const uint8_t p_polarization = 0);
|
||||||
|
transponder();
|
||||||
|
|
||||||
bool operator==(const transponder& t) const;
|
bool operator==(const transponder& t) const;
|
||||||
bool compare (const transponder& t) const;
|
bool compare (const transponder& t) const;
|
||||||
@@ -48,6 +48,7 @@ public:
|
|||||||
void dump(std::string label = "tp");
|
void dump(std::string label = "tp");
|
||||||
void ddump(std::string label = "tp");
|
void ddump(std::string label = "tp");
|
||||||
static char pol(unsigned char pol);
|
static char pol(unsigned char pol);
|
||||||
|
std::string description();
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map <transponder_id_t, transponder> transponder_list_t;
|
typedef std::map <transponder_id_t, transponder> transponder_list_t;
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <zapit/transponder.h>
|
#include <zapit/transponder.h>
|
||||||
|
#include <zapit/frontend_c.h>
|
||||||
#include <zapit/debug.h>
|
#include <zapit/debug.h>
|
||||||
|
|
||||||
transponder::transponder(fe_type_t fType, const transponder_id_t t_id, const struct dvb_frontend_parameters p_feparams, const uint8_t p_polarization)
|
transponder::transponder(fe_type_t fType, const transponder_id_t t_id, const struct dvb_frontend_parameters p_feparams, const uint8_t p_polarization)
|
||||||
@@ -30,7 +31,6 @@ transponder::transponder(fe_type_t fType, const transponder_id_t t_id, const str
|
|||||||
feparams = p_feparams;
|
feparams = p_feparams;
|
||||||
polarization = p_polarization;
|
polarization = p_polarization;
|
||||||
updated = 0;
|
updated = 0;
|
||||||
scanned = 0;
|
|
||||||
satellitePosition = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(transponder_id);
|
satellitePosition = GET_SATELLITEPOSITION_FROM_TRANSPONDER_ID(transponder_id);
|
||||||
if (satellitePosition & 0xF000)
|
if (satellitePosition & 0xF000)
|
||||||
satellitePosition = -(satellitePosition & 0xFFF);
|
satellitePosition = -(satellitePosition & 0xFFF);
|
||||||
@@ -39,6 +39,17 @@ transponder::transponder(fe_type_t fType, const transponder_id_t t_id, const str
|
|||||||
type = fType;
|
type = fType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transponder::transponder()
|
||||||
|
{
|
||||||
|
memset(&feparams, 0, sizeof(struct dvb_frontend_parameters));
|
||||||
|
transponder_id = 0;
|
||||||
|
transport_stream_id = 0;
|
||||||
|
original_network_id = 0;
|
||||||
|
polarization = 0;
|
||||||
|
satellitePosition = 0;
|
||||||
|
type = FE_QPSK;
|
||||||
|
}
|
||||||
|
|
||||||
bool transponder::operator==(const transponder& t) const
|
bool transponder::operator==(const transponder& t) const
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
@@ -120,3 +131,23 @@ char transponder::pol(unsigned char p)
|
|||||||
else
|
else
|
||||||
return 'R';
|
return 'R';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string transponder::description()
|
||||||
|
{
|
||||||
|
char buf[128] = {0};
|
||||||
|
char * f, *s, *m;
|
||||||
|
switch(type) {
|
||||||
|
case FE_QPSK:
|
||||||
|
CFrontend::getDelSys(type, feparams.u.qpsk.fec_inner, dvbs_get_modulation(feparams.u.qpsk.fec_inner), f, s, m);
|
||||||
|
snprintf(buf, sizeof(buf), "%d %c %d %s %s %s ", feparams.frequency/1000, pol(polarization), feparams.u.qpsk.symbol_rate/1000, f, s, m);
|
||||||
|
break;
|
||||||
|
case FE_QAM:
|
||||||
|
CFrontend::getDelSys(type, feparams.u.qam.fec_inner, feparams.u.qam.modulation, f, s, m);
|
||||||
|
snprintf(buf, sizeof(buf), "%d %d %s %s %s ", feparams.frequency/1000, feparams.u.qam.symbol_rate/1000, f, s, m);
|
||||||
|
break;
|
||||||
|
case FE_OFDM:
|
||||||
|
case FE_ATSC:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return std::string(buf);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user