Arduino Radio Library  0.9
A set of Arduino libraries to control diverse FM radio receiver chips in Arduino projects.
RDSParser.h
Go to the documentation of this file.
1 
21 
22 #ifndef __RDSPARSER_H__
23 #define __RDSPARSER_H__
24 
25 #include <arduino.h>
26 
28 extern "C" {
29  typedef void(*receiveServicenNameFunction)(char *name);
30  typedef void(*receiveTextFunction)(char *name);
31  typedef void(*receiveTimeFunction)(uint8_t hour, uint8_t minute);
32 }
33 
34 
36 class RDSParser
37 {
38 public:
39  RDSParser();
40 
42  void init();
43 
45  void processData(uint16_t block1, uint16_t block2, uint16_t block3, uint16_t block4);
46 
48  void attachTextCallback(receiveTextFunction newFunction);
49  void attachTimeCallback(receiveTimeFunction newFunction);
50 
51 private:
52  // ----- actual RDS values
55 
56  // Program Service Name
57  char _PSName1[10]; // including trailing '\00' character.
58  char _PSName2[10]; // including trailing '\00' character.
59  char programServiceName[10]; // found station name or empty. Is max. 8 character long.
60 
64 
65  uint16_t _lastRDSMinutes;
66 
67  char _RDSText[64 + 2];
68 
69 }; //RDSParser
70 
71 #endif //__RDSPARSER_H__
uint8_t rdsTP
Definition: RDSParser.h:53
void(* receiveTimeFunction)(uint8_t hour, uint8_t minute)
Definition: RDSParser.h:31
void attachTextCallback(receiveTextFunction newFunction)
Register the function for displaying a rds text.
Definition: RDSParser.cpp:40
void(* receiveTextFunction)(char *name)
Definition: RDSParser.h:30
uint8_t rdsGroupType
Definition: RDSParser.h:53
void(* receiveServicenNameFunction)(char *name)
callback function for passing a ServicenName
Definition: RDSParser.h:29
receiveTimeFunction _sendTime
Registered Time function.
Definition: RDSParser.h:62
receiveTextFunction _sendText
Definition: RDSParser.h:63
Library for parsing RDS data values and extracting information.
Definition: RDSParser.h:36
char _RDSText[64+2]
Definition: RDSParser.h:67
uint8_t _lastTextIDX
Definition: RDSParser.h:54
uint8_t rdsPTY
Definition: RDSParser.h:53
uint16_t _lastRDSMinutes
last RDS time send to callback.
Definition: RDSParser.h:65
char programServiceName[10]
Definition: RDSParser.h:59
void attachServicenNameCallback(receiveServicenNameFunction newFunction)
Register function for displaying a new Service Name.
Definition: RDSParser.cpp:35
uint8_t _textAB
Definition: RDSParser.h:54
char _PSName1[10]
Definition: RDSParser.h:57
char _PSName2[10]
Definition: RDSParser.h:58
void attachTimeCallback(receiveTimeFunction newFunction)
Register function for displaying a new time.
Definition: RDSParser.cpp:46
receiveServicenNameFunction _sendServiceName
Registered ServiceName function.
Definition: RDSParser.h:61
void processData(uint16_t block1, uint16_t block2, uint16_t block3, uint16_t block4)
Pass all available RDS data through this function.
Definition: RDSParser.cpp:52
uint8_t _last_textAB
Definition: RDSParser.h:54
RDSParser()
create a new object from this class.
Definition: RDSParser.cpp:21
void init()
Initialize internal variables before starting or after a change to another channel.
Definition: RDSParser.cpp:26