Example #1
0
def dab():
    #Check if the device is ready to receive commands
    try:
        with Radio("/dev/ttyACM0", 0, 0) as r:
            status = r.is_system_ready()    
        except:
            return "False"
Example #2
0
def nextDAB(self, mode, index):
     with Radio(radio_board, mode, index) as r:
	       r.get_total_program

        program = r.programs
        r.volume = 11
        r.stereo = True
        #program.play
        r.nextstream
        time_lable = pyxbmct.Label(program.name, alignment=pyxbmct.ALIGN_CENTER, font='header50_title')
        self.placeControl(time_lable, 3, 2, 2, 2)
Example #3
0
        type=int,
        help='Time (in sec.) to sleep between 2 query (default 2)',
        required=False)
    parser.add_argument('-s',
                        '--service',
                        type=int,
                        help='Select service to monitor',
                        required=False)
    parser.add_argument('-o',
                        '--output',
                        help='Output directory',
                        required=False)
    cli_args = parser.parse_args()

    if cli_args.services_list == True:
        with Radio("/dev/ttyACM0", mode=constants.DAB) as r:
            # Reset database
            print "Reset services database"
            r.reset

            # Search from 5A to 13F (See annexe A)
            print "Searching services from 5A to 13F..."
            r.dab_auto_search(start_index=0, end_index=40, clear=False)

            # Display service list
            print "-- SERVICES LIST --"
            i = 0
            for p in r.programs:
                try:
                    p_name = p.name
                except: