PU2CLR BK108X Arduino Library 1.0.2
This is an Arduino Library to control the BK108X device
Loading...
Searching...
No Matches
RDS Functions

Functions

char * BK108X::getRdsProgramInformation (void)
 Gets the Program Information (RT - Radio Text)
 
char * BK108X::getRdsStationInformation (void)
 Gets the Station Information.
 
char * BK108X::getRdsStationName (void)
 Gets the Station Name.
 
void BK108X::setRdsMode (uint8_t rds_mode=0)
 Sets the Rds Mode Standard or Verbose.
 
void BK108X::setRds (bool value, bool interrupt_enable=false)
 Sets the RDS operation.
 
bool BK108X::getRdsReady ()
 Returns true if RDS Ready.
 
uint8_t BK108X::getRdsFlagAB (void)
 Returns the current Text Flag A/B.
 
uint16_t BK108X::getRdsGroupType ()
 Return the group type - Gets the Group Type (extracted from the Block B)
 
uint8_t BK108X::getRdsVersionCode (void)
 Gets the version code (extracted from the Block B)
 
uint8_t BK108X::getRdsProgramType (void)
 Returns the Program Type (extracted from the Block B)
 
void BK108X::getNext2Block (char *c)
 Process data received from group 2B - Station Name.
 
void BK108X::getNext4Block (char *c)
 Processes data received from group 2A.
 
char * BK108X::getRdsText (void)
 Gets the RDS Text when the message is of the Group Type 2 version A.
 
char * BK108X::getRdsText0A (void)
 Gets the Station Name and other messages.
 
char * BK108X::getRdsText2A (void)
 Gets the Text processed for the 2A group.
 
char * BK108X::getRdsText2B (void)
 Gets the Text processed for the 2B group.
 
bool BK108X::getRdsAllData (char **stationName, char **stationInformation, char **programInformation, char **utcTime)
 Gets Station Name, Station Information, Program Information and utcTime.
 
char * BK108X::getRdsTime ()
 Gets the RDS time and date when the Group type is 4.
 
char * BK108X::getRdsLocalTime ()
 Gets the RDS time converted to local time.
 
bool BK108X::getRdsSync ()
 Get the Rds Sync.
 
void BK108X::clearRdsBuffer ()
 Clear RDS Information (Station Name, Station Information, Program Information and Time)
 

Detailed Description

RDS/RBDS

Function Documentation

◆ getRdsProgramInformation()

char * BK108X::getRdsProgramInformation ( void  )
inline

Gets the Program Information (RT - Radio Text)

@

Process the program information data. Same getRdsText2A(). It is a alias for getRdsText2A.

ATTENTION: You must call getRdsReady before calling this function.

Returns
char array with the program information (63 bytes)
See also
getRdsText2A

Definition at line 1158 of file BK108X.h.

References BK108X::getRdsText2A().

◆ getRdsStationInformation()

char * BK108X::getRdsStationInformation ( void  )
inline

Gets the Station Information.

ATTENTION: You must call getRdsReady before calling this function.

Returns
char array with the Text of Station Information (33 bytes)
See also
getRdsReady

Definition at line 1167 of file BK108X.h.

References BK108X::getRdsText2B().

◆ getRdsStationName()

char * BK108X::getRdsStationName ( void  )
inline

Gets the Station Name.

Alias for getRdsText0A

ATTENTION: You must call getRdsReady before calling this function.

Returns
char* should return a string with the station name. However, some stations send other kind of messages
See also
getRdsText0A

Definition at line 1177 of file BK108X.h.

References BK108X::getRdsText0A().

◆ setRdsMode()

void BK108X::setRdsMode ( uint8_t  rds_mode = 0)

Sets the Rds Mode Standard or Verbose.

There is no information about it in the BK1088 documentation.

Parameters
rds_mode0 = Standard (default); 1 = Verbose

Definition at line 1091 of file BK108X.cpp.

◆ setRds()

void BK108X::setRds ( bool  value,
bool  interrupt_enable = false 
)

Sets the RDS operation.

Enable or Disable the RDS

You can setup interrupt via GPIO2. It is useful to avoid pulling during RDS queries.

When a new RDS data is available (new RDS information came) a 5ms low pulse will appear at GPIO2

Parameters
true= turns the RDS ON; false = turns the RDS OFF
true= enable interruot at GPIO2 when new RDS is available (default false).

Definition at line 1105 of file BK108X.cpp.

Referenced by BK108X::setRDS().

◆ getRdsReady()

bool BK108X::getRdsReady ( )

Returns true if RDS Ready.

Read addresses 0Ah, 0Ch, and check the bit RDSR.

If in verbose mode, the BLERA bits indicate how many errors were corrected in block A. If BLERA indicates 6 or more errors, the data in RDSA should be discarded.

When using the polling method, it is best not to poll continuously. The data will appear in intervals of ~88 ms and the RDSR indicator will be available for at least 40 ms, so a polling rate of 40 ms or less should be sufficient.

ATTENTION: You must call this function before calling any RDS function to process data

Returns
true or false

Definition at line 1124 of file BK108X.cpp.

Referenced by BK108X::getRdsAllData().

◆ getRdsFlagAB()

uint8_t BK108X::getRdsFlagAB ( void  )

Returns the current Text Flag A/B.

You must call getRdsReady before calling this function

Returns
uint8_t current Text Flag A/B

Definition at line 1143 of file BK108X.cpp.

◆ getRdsGroupType()

uint16_t BK108X::getRdsGroupType ( )

Return the group type - Gets the Group Type (extracted from the Block B)

You must call getRdsReady before calling this function

Returns
uint16_t

Definition at line 1156 of file BK108X.cpp.

◆ getRdsVersionCode()

uint8_t BK108X::getRdsVersionCode ( void  )

Gets the version code (extracted from the Block B)

You must call getRdsReady before calling this function

Returns
0=A or 1=B

Definition at line 1170 of file BK108X.cpp.

◆ getRdsProgramType()

uint8_t BK108X::getRdsProgramType ( void  )

Returns the Program Type (extracted from the Block B)

You must call getRdsReady before calling this function

See also
https://en.wikipedia.org/wiki/Radio_Data_System
Returns
program type (an integer betwenn 0 and 31)

Definition at line 1184 of file BK108X.cpp.

◆ getNext2Block()

void BK108X::getNext2Block ( char *  c)
inline

Process data received from group 2B - Station Name.

It appears that the BK1088 device is typically pre-configured with RBDS setup instead of RDS by default.

Consequently, the Station Name is obtained from block E instead of block B.

The documentation from BEKEN used in this project does not provide instructions on how to switch from RBDS to RDS mode.

If anyone has access to this information, kindly share it with us.

Parameters
cchar array reference to the "group 2B" text

Definition at line 1200 of file BK108X.cpp.

Referenced by BK108X::getRdsText0A(), and BK108X::getRdsText2B().

◆ getNext4Block()

void BK108X::getNext4Block ( char *  c)
inline

Processes data received from group 2A.

decodes data received from block C and block D

Parameters
cchar array reference to the "group 2A" text

Definition at line 1213 of file BK108X.cpp.

Referenced by BK108X::getRdsText2A().

◆ getRdsText()

char * BK108X::getRdsText ( void  )

Gets the RDS Text when the message is of the Group Type 2 version A.

Returns
char* The string (char array) with the content (Text) received from group 2A

Definition at line 1227 of file BK108X.cpp.

◆ getRdsText0A()

char * BK108X::getRdsText0A ( void  )

Gets the Station Name and other messages.

Todo:

Need to check Block B and Block E and RDS mode

RDS Dynamic PS or Scrolling PS support

Same getRdsStationName.

Returns
char* should return a string with the station name. However, some stations send other kind of messages

Definition at line 1241 of file BK108X.cpp.

References BK108X::getNext2Block(), and BK108X::rds_buffer0A.

Referenced by BK108X::getRdsAllData(), and BK108X::getRdsStationName().

◆ getRdsText2A()

char * BK108X::getRdsText2A ( void  )

Gets the Text processed for the 2A group.

@

Returns
char* string with the Text of the group A2

Definition at line 1269 of file BK108X.cpp.

References BK108X::getNext4Block(), and BK108X::rds_buffer2A.

Referenced by BK108X::getRdsAllData(), and BK108X::getRdsProgramInformation().

◆ getRdsText2B()

char * BK108X::getRdsText2B ( void  )

Gets the Text processed for the 2B group.

Returns
char* string with the Text of the group AB

Definition at line 1296 of file BK108X.cpp.

References BK108X::getNext2Block(), and BK108X::rds_buffer2B.

Referenced by BK108X::getRdsAllData(), and BK108X::getRdsStationInformation().

◆ getRdsAllData()

bool BK108X::getRdsAllData ( char **  stationName,
char **  stationInformation,
char **  programInformation,
char **  utcTime 
)

Gets Station Name, Station Information, Program Information and utcTime.

This function populates four char pointer variable parameters with Station Name, Station Information, Programa Information and UTC time.

You must call setRDS(true), setRdsFifo(true) before calling getRdsAllData(...)

ATTENTION: the parameters below are point to point to array of char.

the right way to call this function is shown below.

char *stationName, *stationInfo, *programInfo, *rdsTime;
// The char pointers above will be populate by the call below. So, the char pointers need to be passed by reference (pointer to pointer).
if (rx.getRdsAllData(&stationName, &stationInfo , &programInfo, &rdsTime) ) {
showProgramaInfo(programInfo);
showStationName(stationName);
showStationInfo(stationInfo);
showUtcTime(rdsTime);
}
Parameters
stationName(reference) - if NOT NULL, point to Name of the Station (char array - 9 bytes)
stationInformation(reference) - if NOT NULL, point to Station information (char array - 33 bytes)
programInformation(reference) - if NOT NULL, point to program information (char array - 65 nytes)
utcTime(reference) - if NOT NULL, point to char array containing the current UTC time (format HH:MM:SS +HH:MM)
Returns
True if found at least one valid data
See also
setRDS, setRdsFifo, getRdsAllData

Definition at line 1340 of file BK108X.cpp.

References BK108X::getRdsReady(), BK108X::getRdsText0A(), BK108X::getRdsText2A(), BK108X::getRdsText2B(), and BK108X::getRdsTime().

◆ getRdsTime()

char * BK108X::getRdsTime ( )

Gets the RDS time and date when the Group type is 4.

Returns
char* a string with hh:mm +/- offset

Definition at line 1358 of file BK108X.cpp.

References BK108X::rds_time.

Referenced by BK108X::getRdsAllData().

◆ getRdsLocalTime()

char * BK108X::getRdsLocalTime ( )

Gets the RDS time converted to local time.

Todo:
Need to check.

ATTENTION: You must call getRdsReady before calling this function.

ATTENTION: Some stations broadcast wrong time.

Returns
char* a string with hh:mm
See also
getRdsReady

Definition at line 1424 of file BK108X.cpp.

References BK108X::rds_time.

◆ getRdsSync()

bool BK108X::getRdsSync ( )

Get the Rds Sync.

Returns true if RDS currently synchronized.

Returns
true or false

Definition at line 1487 of file BK108X.cpp.

◆ clearRdsBuffer()

void BK108X::clearRdsBuffer ( )

Clear RDS Information (Station Name, Station Information, Program Information and Time)

Clear the buffer with latest RDS information

Definition at line 1497 of file BK108X.cpp.

References BK108X::rds_buffer0A, BK108X::rds_buffer2A, BK108X::rds_buffer2B, and BK108X::rds_time.