From patchwork Tue May 7 16:24:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konke Radlow X-Patchwork-Id: 2536091 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id DEA6FE00E6 for ; Tue, 7 May 2013 16:24:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758780Ab3EGQYn (ORCPT ); Tue, 7 May 2013 12:24:43 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:55801 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752908Ab3EGQYl (ORCPT ); Tue, 7 May 2013 12:24:41 -0400 Received: by mail-wi0-f171.google.com with SMTP id l13so3980427wie.10 for ; Tue, 07 May 2013 09:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references; bh=CF3vRPL9CVTsWLbDCyjR2YDfwsvgt3kUU90HrDAqKhU=; b=w9r6Baq1HnumFOA3vLWOykLpM41kvA0+vaLiIK1Vvs72oK509Xw0A3hoF6L4wo/3yx Bu81VIWlnF5DaYSnztohfj2echmMFR1vFKuGlAy3ODRRzys3xYCtDLzXULKQ+MdaJ9oe PXJgd2a5ZPHVTO8lXELLPCBso4uPSAsgmGhrgvAxAAYg4S6sfxvyFTuajcZDLjXdUhB1 zl1cS1LDJVtxsUukf+xGhP86vm9543N8NFVSKjpIza2/Edgo/8cKIrHN4LfW/sUfRedf GRgp3JOaQUIYWqxpgR8yCioecPGUXWeJVTGg9bwZo6SjPjLhbLFwqUEwkE1Nup6j2P// JCPQ== X-Received: by 10.194.71.103 with SMTP id t7mr4697179wju.38.1367943879944; Tue, 07 May 2013 09:24:39 -0700 (PDT) Received: from oan.soton.ac.uk (dhcp-162-254.wireless.soton.ac.uk. [152.78.162.254]) by mx.google.com with ESMTPSA id i4sm3759854wix.10.2013.05.07.09.24.39 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 May 2013 09:24:39 -0700 (PDT) From: Konke Radlow To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, hdegoede@redhat.com Subject: [RFC PATCH 2/4] rds-ctl.cpp: added functionality to print RDS-EON information Date: Tue, 7 May 2013 17:24:21 +0100 Message-Id: <63291557e0c1b342aea66fc33ef900cf22051db3.1367943797.git.koradlow@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1367943863-28803-1-git-send-email-koradlow@gmail.com> References: <1367943863-28803-1-git-send-email-koradlow@gmail.com> In-Reply-To: <43cedfcd3ab893d4efbf97587ee0fe6640ee3d39.1367943797.git.koradlow@gmail.com> References: <43cedfcd3ab893d4efbf97587ee0fe6640ee3d39.1367943797.git.koradlow@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Konke Radlow --- utils/rds-ctl/rds-ctl.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp index de76d9f..51536cf 100644 --- a/utils/rds-ctl/rds-ctl.cpp +++ b/utils/rds-ctl/rds-ctl.cpp @@ -550,6 +550,33 @@ static void print_rds_af(const struct v4l2_rds_af_set *af_set) } } +static void print_rds_eon(const struct v4l2_rds_eon_set *eon_set) +{ + int counter = 0; + + printf("\n\nEnhanced Other Network information: %u channels", eon_set->size); + for (int i = 0; i < eon_set->size; i++, counter++) { + if (eon_set->eon[i].valid_fields & V4L2_RDS_PI) + printf("\nPI(ON %02i) = %04x", i, eon_set->eon[i].pi); + if (eon_set->eon[i].valid_fields & V4L2_RDS_PS) + printf("\nPS(ON %02i) = %s", i, eon_set->eon[i].ps); + if (eon_set->eon[i].valid_fields & V4L2_RDS_PTY) + printf("\nPTY(ON %02i) = %0u", i, eon_set->eon[i].pty); + if (eon_set->eon[i].valid_fields & V4L2_RDS_LSF) + printf("\nLSF(ON %02i) = %0u", i, eon_set->eon[i].lsf); + if (eon_set->eon[i].valid_fields & V4L2_RDS_AF) + printf("\nPTY(ON %02i) = %0u", i, eon_set->eon[i].pty); + if (eon_set->eon[i].valid_fields & V4L2_RDS_TP) + printf("\nTP(ON %02i): %s" ,i ,eon_set->eon[i].tp? "yes":"no"); + if (eon_set->eon[i].valid_fields & V4L2_RDS_TA) + printf("\nTA(ON %02i): %s",i ,eon_set->eon[i].tp? "yes":"no"); + if (eon_set->eon[i].valid_fields & V4L2_RDS_AF) { + printf("\nAF(ON %02i): size=%i", i, eon_set->eon[i].af.size); + print_rds_af(&(eon_set->eon[i].af)); + } + } +} + static void print_rds_pi(const struct v4l2_rds *handle) { printf("\nArea Coverage: %s", v4l2_rds_get_coverage_str(handle)); @@ -662,6 +689,8 @@ static void read_rds_from_fd(const int fd) /* try to receive and decode RDS data */ read_rds(rds_handle, fd, params.wait_limit); + if (rds_handle->valid_fields & V4L2_RDS_EON) + print_rds_eon(&rds_handle->rds_eon); print_rds_statistics(&rds_handle->rds_statistics); v4l2_rds_destroy(rds_handle);