GitXplorerGitXplorer
c

rds

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
caa21b7e7e70a2265d60ac8ded0dc168042cb802

Documented two register values.

ccmumford committed 4 years ago
Unverified
b116cdb9e0ee567c1e93620617f0d87948aab2a5

Defining rds_clock_t.

ccmumford committed 4 years ago
Unverified
fa491bdf6ad91edf57e93c0299b8e07ed83ba380

Added ARRAY_SIZE macro.

ccmumford committed 4 years ago
Unverified
7fa52dcd956712d9aea6f69034ddebf11c9e26e1

Simplified Makefile.

ccmumford committed 4 years ago
Unverified
a906950d928ec4082d0dab87507d38e1a87eb56a

Moved ARRAY_SIZE out of public API.

ccmumford committed 4 years ago
Unverified
dd34c9b9403c5ebe6dfdaeb48f9c697b2726c974

Fixed when RDS_DEV isn't defined.

ccmumford committed 4 years ago

README

The README file for this repository.

A Library for Decoding RDS/RBDS data.

Overview

This project aims to provide complete decode implementation of the RDS/RBDS protocol as defined by the RBDS Specification.

This library has a single implementation, but with two public facing API's. Mongoose OS is supported, but all functions are prefixed with mgos_ to conform with naming conventions for that platform.

Contributions are welcome, please see CONTRIBUTING.md for more information.

Building

On Mongoose OS add the following library dependency to the application mos.yml file:

libs:
  - origin: https://github.com/cmumford/rds

On all other platforms use cmake as follows:

mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build .

Example Use

struct rds_data data;

// Create the RDS decoder.
const struct rds_decoder_config config = {
    .advanced_ps_decoding = true,
    .rds_data = &data,
};
struct rds_decoder* decoder = rds_decoder_create(&config);

// Populate this structure with RDS blocks and (if available)
// block error values from the receiving device.
const struct rds_blocks blocks = {
    {block_a, BLER_NONE },
    {block_b, BLER_NONE },
    {block_c, BLER_NONE },
    {block_d, BLER_NONE }};
rds_decoder_decode(decoder, &blocks);

// Use one of the decoded RDS data values.
if (data.valid_values & RDS_PTY) {
  // Do something with a decoded RDS value.
  printf("PTY:  %u\n", rds_data.pty);
}

// When no longer used, delete the RDS decoder.
rds_decoder_delete(decoder);

Mongoose OS is nearly identical, but with mgos_ prefixes:

struct rds_data data;

// Create the RDS decoder.
const struct rds_decoder_config config = {
    .advanced_ps_decoding = true,
    .rds_data = &data,
};
struct rds_decoder* decoder = mgos_rds_decoder_create(&config);

// Populate this structure with RDS blocks and (if available)
// block error values from the receiving device.
const struct rds_blocks blocks = {
    {block_a, BLER_NONE },
    {block_b, BLER_NONE },
    {block_c, BLER_NONE },
    {block_d, BLER_NONE }};
mgos_rds_decoder_decode(decoder, &blocks);

// Use one of the decoded RDS data values.
if (data.valid_values & RDS_PTY) {
  // Do something with a decoded RDS value.
  printf("PTY:  %u\n", rds_data.pty);
}

// When no longer used, delete the RDS decoder.
mgos_rds_decoder_delete(decoder);

util

util contains a program, rdsstats, which reads (as input) raw RDS block data from RDS Spy, and prints out various statistics. There is also a higher-level script, rds_spy_log_stats.py, which processes an entire directory (recursively) of logs, and writes out a CSV file for directory-wide statistics.