From patchwork Tue Mar 8 15:01:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan-Niklas Burfeind X-Patchwork-Id: 1603057 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=J6gplHXu; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aiyionpri.me header.i=@aiyionpri.me header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=cKfZiUDY; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KCdsb6QVXz9sG2 for ; Wed, 9 Mar 2022 02:04:51 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cAwyEPC6Vl7fNHmZ6i1p00yTmTPO5a7dh/OTwYfQzFU=; b=J6gplHXu22UODh nO0mK0wo2kcE8XuxWOwwu87aPwChJkehDkV7jKGJilrVYkqrRRxJmnni4chDqyRFyaMONBZRn1nyI 4PAZp5twE0MYpn72jTqMYkEgy7jmmYZebiNJ+wOOfvl/x9QZJMVe+daHbL1NDVgHcIK4u5V9ddD6H akz0M3oesuR/kd5GCkfldLDBflTOJEQbRrHrDiJrT8IuQ5cGI0633t0WZXAYMOyrr+UR1Y9dyFBLs 9Kq3lUR0KIjXUqCfc3Yj4iOlq0pAEnJ7NbcUeSUIdh7vdq7dfO48n9nncZ/QM6CCOuhe/AlUSc/Tx lKMYV1vdrD4qje7rNafA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRbLf-004sLV-5X; Tue, 08 Mar 2022 15:02:03 +0000 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRbLb-004sJI-Uk for openwrt-devel@lists.openwrt.org; Tue, 08 Mar 2022 15:02:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1646751713; s=strato-dkim-0002; d=aiyionpri.me; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=sWMaACYyix/HgB6kzbNx3tUO9KEzyx8PtuuAv8WX85s=; b=cKfZiUDYiIZTdv34z8+Ner9nHnSNdrdKqkYWdN1dnuWHWoWnM7qSU/Utjj5P5FF6Ip V7sdPDPjqosjuedw11R9lprEWTksTy4YY5bzD4bijGDylKY38N0vltJ240BNqNEP1WlP u0hJVPXtaNaO28SHuX8k9LZI8jTYdzaZhBVcJZKijqto6QCtFTVb0jvIDOKlIa+y/bDR 5J+bAQYU8us3ztXlCk8MJ9HNsoi3Xz/59yWVqN7HjdIC+rIp/1WIIVR9gOevUloTgt3Y 3V8+OpcJ/BG+ysCsG9d2UcGANpvTdCC7pHpbnfJdCVCmbiayHQa2cP4/StnBEJFSduNM A/8Q== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":IWkkdEmxcvCtRDtHUQOu48a0Nfy9hOkboq9r6d0vrgVDHZTjCI3RMwuZyUMg713CXbhb/+nz5riYEGAo43XGh8sC75Fxr8Ei/CCb" X-RZG-CLASS-ID: mo00 Received: from chromia.speedport.ip by smtp.strato.de (RZmta 47.40.1 AUTH) with ESMTPSA id f44de9y28F1rIgU (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 8 Mar 2022 16:01:53 +0100 (CET) From: Jan-Niklas Burfeind To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?q?Oskari_Lemmel=C3=A4?= , Cezary Jackiewicz , Jan-Niklas Burfeind Subject: [PATCH v3 1/2] command-nas: fix cmd_nas_get_cell_location_info_cb Date: Tue, 8 Mar 2022 16:01:43 +0100 Message-Id: <20220308150144.1617236-1-git@aiyionpri.me> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_070200_196594_DBB32A33 X-CRM114-Status: UNSURE ( 7.90 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Correct order of rsrp and rsrq parameters for print_lte_info. Signed-off-by: Jan-Niklas Burfeind --- commands-nas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands-nas.c b/commands-nas.c index 01ca3b8..275c53f 100644 --- a/commands-nas.c +++ b/commands-nas.c @@ -688, 7 +688, 7 @@ cmd_nas_get_tx_rx_info_prepare(struct qmi_dev *qmi, struct qmi_ [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [85.215.255.21 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_H5 RBL: Excellent reputation (+5) [85.215.255.21 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Correct order of rsrp and rsrq parameters for print_lte_info. Signed-off-by: Jan-Niklas Burfeind --- commands-nas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands-nas.c b/commands-nas.c index 01ca3b8..275c53f 100644 --- a/commands-nas.c +++ b/commands-nas.c @@ -688,7 +688,7 @@ cmd_nas_get_tx_rx_info_prepare(struct qmi_dev *qmi, struct qmi_request *req, str } static void -print_lte_info(int32_t cell_id, int16_t rsrp, int16_t rsrq, int16_t rssi) +print_lte_info(int32_t cell_id, int16_t rsrq, int16_t rsrp, int16_t rssi) { blobmsg_add_u32(&status, "physical_cell_id", cell_id); blobmsg_add_double(&status, "rsrq", ((double)rsrq)/10); From patchwork Tue Mar 8 15:01:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan-Niklas Burfeind X-Patchwork-Id: 1603058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Kr6f4vx8; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aiyionpri.me header.i=@aiyionpri.me header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=BNB3OvmK; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KCdsc2tknz9sG9 for ; Wed, 9 Mar 2022 02:04:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YO75FlYnDoxauJSlt2Wz0+3pjMK5Kyi+BFdMjuzBMf0=; b=Kr6f4vx8VbcGZB vpm50PaIbV7x/I8kz4M9C68Gb9IazZOZGy04LPzNpMHRJ8DY9KhCO9mZenLv+V1uEGopdDKZubg4X fgYw9RO+N24YReNCWzApg3BRxPu605sj/MkkEG9nl9YZ3pUSTWTpSk9mi+UTpPIkfBObLNxEeAR1Z VRAiWjDweqSAQ9V+CgH5cFK007ZpUPsJsrmR9Mnt5SEGLT2S+bo/BSRdTKZsI/5YQGOMrBilXdKkN a1dGNBeZyKGGnISLS9Ut7UWyo61Be4GpclAl6a5pCSstYlNZxezPre/u22N11WBYWMU8zERKfnl4x nM4QPtP312ubMW8ibJKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRbLs-004sNO-ER; Tue, 08 Mar 2022 15:02:16 +0000 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.54]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRbLd-004sJS-EU for openwrt-devel@lists.openwrt.org; Tue, 08 Mar 2022 15:02:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1646751715; s=strato-dkim-0002; d=aiyionpri.me; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=R5ln2nwKvZX5ZF+fItdGB1zxnztvZaxKTaKRFSfAEIc=; b=BNB3OvmKb6176xOcCoF5aD2eB4pmOwywD90ZQcmR5d9FyPZ8iPg1Q+5s/fTH5/ZENU 5cYAcipmvraI1ynPSBkxV3s8JPUvnIz9VST2/bOio32Ceeg7UILfkO6JYhP9Xk/o6FfP spdv4wQotmpycZgLjCo4B/496DWtuPtBoORp73KFUo+phWFe7IMU5x0TPINvKqz8nFfL Ma1xP+9zrT/tJNnUAYx5ad/Vdd6V5lLWpFTIKs7ZvFCOAbwuzp8lcj8vWkEHRjTOXn4B mApd/JnvFJn7Fsnl3rTNOEyt2AyohI5NAO+xGUy73nyP0nYQwbc3DbUegQOmUShJXvY3 hMzQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":IWkkdEmxcvCtRDtHUQOu48a0Nfy9hOkboq9r6d0vrgVDHZTjCI3RMwuZyUMg713CXbhb/+nz5riYEGAo43XGh8sC75Fxr8Ei/CCb" X-RZG-CLASS-ID: mo00 Received: from chromia.speedport.ip by smtp.strato.de (RZmta 47.40.1 AUTH) with ESMTPSA id f44de9y28F1tIgV (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 8 Mar 2022 16:01:55 +0100 (CET) From: Jan-Niklas Burfeind To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?q?Oskari_Lemmel=C3=A4?= , Cezary Jackiewicz , Jan-Niklas Burfeind Subject: [PATCH v3 2/2] command-nas: fix json output Date: Tue, 8 Mar 2022 16:01:44 +0100 Message-Id: <20220308150144.1617236-2-git@aiyionpri.me> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220308150144.1617236-1-git@aiyionpri.me> References: <20220308150144.1617236-1-git@aiyionpri.me> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_070201_808021_D470054B X-CRM114-Status: GOOD ( 13.34 ) X-Spam-Score: -0.2 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__Output_the_cells_from_--get-cell-locat?= =?unknown-8bit?q?ion-info_in_an_array?= =?unknown-8bit?q?_=22cells=22=2C_=22geran=22_entries_as_an_array_called_alik?= =?unknown-8bit?q?e=2C_and_wrap_output_for_different?= =?unknown-8bit?q?_=22frequencies=22_as_such=2E_Reported-by=3A_Cezary_Jackiew?= =?unknown-8bit?q?icz_=3Ccezary=2Ejackiewicz=40gmail=2Ecom=3E?= =?unknown-8bit?q?_Suggested-by=3A_Oskari_Lemmel=C3=A4_=3Coskari=40lemmela=2E?= =?unknown-8bit?q?net=3E_Signed-off-by=3A_Jan-Niklas?= =?unknown-8bit?q?_Burfeind_=3Cgit=40aiyionpri=2Eme=3E_---_Hey_Oskari_and_Cez?= =?unknown-8bit?q?ary=2C_Please_=5B=2E=2E=2E=5D_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-0=2E2_points=2C_5=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C?= =?unknown-8bit?q?_no_trust?= =?unknown-8bit?q?_=5B85=2E215=2E255=2E54_listed_in_list=2Ednswl=2Eorg=5D?= =?unknown-8bit?q?_0=2E0_SPF=5FNONE_______________SPF=3A_sender_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E0_SPF=5FHELO=5FPASS__________SPF=3A_HELO_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_RCVD=5FIN=5FMSPIKE=5FH5______RBL=3A_Excellent_reputa?= =?unknown-8bit?q?tion_=28+5=29?= =?unknown-8bit?q?_=5B85=2E215=2E255=2E54_listed_in_wl=2Emailspike=2Enet=5D?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_author=27s_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_0=2E0_RCVD=5FIN=5FMSPIKE=5FWL______Mailspike_good_senders?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Output the cells from --get-cell-location-info in an array "cells", "geran" entries as an array called alike, and wrap output for different "frequencies" as such. Reported-by: Cezary Jackiewicz Suggested-by: Oskari Lemmelä Signed-off-by: Jan-Niklas Burfeind --- Hey Oskari and Cezary, Please have a thorough look at this, as I do not have the matching equipment at hand to test all cases. Let me know if you rather would see `frequencies` become `channels` and if the `geran`-array does make sense. I just compiled this series without errors and will have a look at the LTE-related json-outputs. Thanks for your time Jan-Niklas commands-nas.c | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/commands-nas.c b/commands-nas.c index 275c53f..b99767f 100644 --- a/commands-nas.c +++ b/commands-nas.c @@ -708,7 +708,7 @@ static void cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg) { struct qmi_nas_get_cell_location_info_response res; - void *c, *t, *cell, *freq; + void *c, *t, *cell, *cells, *freq, *frequencies, *geran; int i, j; qmi_parse_nas_get_cell_location_info_response(msg, &res); @@ -724,6 +724,7 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, res.data.umts_info_v2.primary_scrambling_code); blobmsg_add_u32(&status, "rscp", res.data.umts_info_v2.rscp); blobmsg_add_u32(&status, "ecio", res.data.umts_info_v2.ecio); + cells = blobmsg_open_array(&status, "cells"); for (j = 0; j < res.data.umts_info_v2.cell_n; j++) { cell = blobmsg_open_table(&status, NULL); blobmsg_add_u32(&status, "channel", @@ -734,6 +735,8 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, blobmsg_add_u32(&status, "ecio", res.data.umts_info_v2.cell[j].ecio); blobmsg_close_table(&status, cell); } + blobmsg_close_array(&status, cells); + geran = blobmsg_open_array(&status, "geran"); for (j = 0; j < res.data.umts_info_v2.neighboring_geran_n; j++) { cell = blobmsg_open_table(&status, "neighboring_geran"); blobmsg_add_u32(&status, "channel", @@ -746,6 +749,7 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, res.data.umts_info_v2.neighboring_geran[j].rssi); blobmsg_close_table(&status, cell); } + blobmsg_close_array(&status, geran); blobmsg_close_table(&status, c); } if (res.set.intrafrequency_lte_info_v2) { @@ -769,6 +773,7 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, blobmsg_add_u32(&status, "s_intra_search_threshold", res.data.intrafrequency_lte_info_v2.s_intra_search_threshold); } + cells = blobmsg_open_array(&status, "cells"); for (i = 0; i < res.data.intrafrequency_lte_info_v2.cell_n; i++) { cell = blobmsg_open_table(&status, NULL); print_lte_info(res.data.intrafrequency_lte_info_v2.cell[i].physical_cell_id, @@ -780,11 +785,14 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, res.data.intrafrequency_lte_info_v2.cell[i].cell_selection_rx_level); blobmsg_close_table(&status, cell); } + blobmsg_close_array(&status, cells); blobmsg_close_table(&status, c); } if (res.set.interfrequency_lte_info) { - if (res.data.interfrequency_lte_info.frequency_n > 0) + if (res.data.interfrequency_lte_info.frequency_n > 0) { c = blobmsg_open_table(&status, "interfrequency_lte_info"); + frequencies = blobmsg_open_array(&status, "frequencies"); + } for (i = 0; i < res.data.interfrequency_lte_info.frequency_n; i++) { freq = blobmsg_open_table(&status, NULL); blobmsg_add_u32(&status, "channel", @@ -795,6 +803,7 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, res.data.interfrequency_lte_info.frequency[i].cell_selection_rx_level_high_threshold, res.data.interfrequency_lte_info.frequency[i].cell_selection_rx_level_low_threshold); } + cells = blobmsg_open_array(&status, "cells"); for (j = 0; j < res.data.interfrequency_lte_info.frequency[i].cell_n; j++) { cell = blobmsg_open_table(&status, NULL); print_lte_info(res.data.interfrequency_lte_info.frequency[i].cell[j].physical_cell_id, @@ -806,14 +815,19 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, res.data.interfrequency_lte_info.frequency[i].cell[j].cell_selection_rx_level); blobmsg_close_table(&status, cell); } + blobmsg_close_array(&status, cells); blobmsg_close_table(&status, freq); } - if (res.data.interfrequency_lte_info.frequency_n > 0) + if (res.data.interfrequency_lte_info.frequency_n > 0) { + blobmsg_close_array(&status, frequencies); blobmsg_close_table(&status, c); + } } if (res.set.lte_info_neighboring_gsm) { - if (res.data.lte_info_neighboring_gsm.frequency_n > 0) + if (res.data.lte_info_neighboring_gsm.frequency_n > 0) { c = blobmsg_open_table(&status, "lte_info_neighboring_gsm"); + frequencies = blobmsg_open_array(&status, "frequencies"); + } for (i = 0; i < res.data.lte_info_neighboring_gsm.frequency_n; i++) { freq = blobmsg_open_table(&status, NULL); blobmsg_add_u32(&status, "ncc_permitted", @@ -823,6 +837,7 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, res.data.lte_info_neighboring_gsm.frequency[i].cell_reselection_high_threshold, res.data.lte_info_neighboring_gsm.frequency[i].cell_reselection_low_threshold); } + cells = blobmsg_open_array(&status, "cells"); for (j = 0; j < res.data.lte_info_neighboring_gsm.frequency[i].cell_n; j++) { cell = blobmsg_open_table(&status, NULL); blobmsg_add_u32(&status, "channel", @@ -836,14 +851,19 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, res.data.lte_info_neighboring_gsm.frequency[i].cell[j].cell_selection_rx_level); blobmsg_close_table(&status, cell); } + blobmsg_close_array(&status, cells); blobmsg_close_table(&status, freq); } - if (res.data.lte_info_neighboring_gsm.frequency_n > 0) + if (res.data.lte_info_neighboring_gsm.frequency_n > 0) { + blobmsg_close_array(&status, frequencies); blobmsg_close_table(&status, c); + } } if (res.set.lte_info_neighboring_wcdma) { - if (res.data.lte_info_neighboring_wcdma.frequency_n > 0) + if (res.data.lte_info_neighboring_wcdma.frequency_n > 0) { c = blobmsg_open_table(&status, "lte_info_neighboring_wcdma"); + frequencies = blobmsg_open_array(&status, "frequencies"); + } for (i = 0; i < res.data.lte_info_neighboring_wcdma.frequency_n; i++) { freq = blobmsg_open_table(&status, NULL); blobmsg_add_u32(&status, "channel", @@ -853,6 +873,7 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, res.data.lte_info_neighboring_wcdma.frequency[i].cell_reselection_high_threshold, res.data.lte_info_neighboring_wcdma.frequency[i].cell_reselection_low_threshold); } + cells = blobmsg_open_array(&status, "cells"); for (j = 0; j < res.data.lte_info_neighboring_wcdma.frequency[i].cell_n; j++) { cell = blobmsg_open_table(&status, NULL); blobmsg_add_u32(&status, "primary_scrambling_code", @@ -866,14 +887,19 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, res.data.lte_info_neighboring_wcdma.frequency[i].cell[j].cell_selection_rx_level); blobmsg_close_table(&status, cell); } + blobmsg_close_array(&status, cells); blobmsg_close_table(&status, freq); } - if (res.data.lte_info_neighboring_wcdma.frequency_n > 0) + if (res.data.lte_info_neighboring_wcdma.frequency_n > 0) { + blobmsg_close_array(&status, frequencies); blobmsg_close_table(&status, c); + } } if (res.set.umts_info_neighboring_lte) { - if (res.data.umts_info_neighboring_lte.frequency_n > 0) + if (res.data.umts_info_neighboring_lte.frequency_n > 0) { c = blobmsg_open_table(&status, "umts_info_neighboring_lte"); + frequencies = blobmsg_open_array(&status, "frequencies"); + } for (i = 0; i < res.data.umts_info_neighboring_lte.frequency_n; i++) { freq = blobmsg_open_table(&status, NULL); blobmsg_add_u32(&status, "channel", @@ -889,8 +915,10 @@ cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, res.data.umts_info_neighboring_lte.frequency[i].cell_selection_rx_level); blobmsg_close_table(&status, freq); } - if (res.data.umts_info_neighboring_lte.frequency_n > 0) + if (res.data.umts_info_neighboring_lte.frequency_n > 0) { + blobmsg_close_array(&status, frequencies); blobmsg_close_table(&status, c); + } } blobmsg_close_table(&status, t); }