Quick and super simple RDS log mod for the SDRAngel
rdsparser.cpp
Append group data to log file in hex format.
void RDSParser::parseGroup(unsigned int *group)
{
unsigned int group_type = (unsigned int)((group[1] >> 12) & 0xf);
bool ab = (group[1] >> 11 ) & 0x1;
// add this
{
std::ofstream ofs("rdslog.txt", std::ios::app);
if (ofs)
{
ofs << std::hex << std::uppercase;
// print each 16-bit word as zero-padded 4-digit hex when possible
ofs << std::setw(4) << std::setfill('0') << (group[0] & 0xFFFF);
ofs << std::setw(4) << std::setfill('0') << (group[1] & 0xFFFF);
ofs << std::setw(4) << std::setfill('0') << (group[2] & 0xFFFF);
ofs << std::setw(4) << std::setfill('0') << (group[3] & 0xFFFF);
ofs << std::endl;
}
}
// end add
/*
qDebug() << "RDSParser::parseGroup:"
<< " type: " << group_type << (ab ? 'B' :'A')
<< " (" << rds_group_acronyms[group_type].c_str() << ")";*/
m_pi_count++;
Comments
Post a Comment