RDS/TMC lib

The libraries are

  • written in standard C++
  • read a RDS data stream
  • decode RDS groups 0(A+B),1(A+B), 2(A+B),3A, 4A, 10A, 14(A+B)
  • support pluggable ODA decoders
  • TMC-lib as ODA-decoder
  • TMC uses sqlite for event-, location- and message-DB
  • a total of 110KB source for RDS and TMC
  • event and location database for germany available

Short notes on using the lib:

  • takes in data through a single function call
  • notifies of decoder status-changes by the return-value of that call
  • the client app can then fetch the changed data

It is used to collect data for the Realtime TMC Feed.

If you are interested in licensing the technology involved in receiving, decoding or publishing, mail me .

See how simple it is:


  // open character device
  strcpy( device, "/dev/radio0");
  f=open( device,O_RDWR);

  // create decoder objects, register TMC decoder
  cs = new cRdsDecoder();
  tmc = new cTMCDecoder();
  cs->registerODA( tmc);

  while( running) {
      // read data from device
      dataread = read(f, &rdb, sizeof( struct rds_block));
      sum += dataread;
      // only read complete blocks
      if ( dataread != 4) break;

      // write data to decoder
      rc = cs->rdsPutBlock( &rdb);

      // display changes signalled by return code
      if ( rc) {
        cStation *c = cs->getStation();

        if ( rc & RDS_CHG_STATIONNAME) {
          printf( "station: [%s]n", c->getStationName());
        }

        if ( rc & RDS_CHG_TMC) {
          printf( "valid TMC messages: %in", tmc->check());
        }
      }
  }
  close( f);

Leave a Reply

Your email address will not be published. Required fields are marked *