[MERGED] openbsc[master]: meas_json: fix NEIGH: missing array braces

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Keith Whyte gerrit-no-reply at lists.osmocom.org
Wed Mar 1 11:48:10 UTC 2017


Keith Whyte has submitted this change and it was merged.

Change subject: meas_json: fix NEIGH: missing array braces
......................................................................


meas_json: fix NEIGH: missing array braces

Make NEIGH an array of Javascript objects, otherwise the JSON is not parseable
when neighbours exist

Change-Id: I42029f40bf357adbb2f3c71cdcbafbc21090e348
---
M openbsc/src/utils/meas_json.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/utils/meas_json.c b/openbsc/src/utils/meas_json.c
index 93203bc..51eb6c7 100644
--- a/openbsc/src/utils/meas_json.c
+++ b/openbsc/src/utils/meas_json.c
@@ -89,7 +89,7 @@
 	for (i = 0; i < mr->num_cell; i++) {
 		struct gsm_meas_rep_cell *mrc = &mr->cell[i];
 		if (i!=0) printf(", ");
-		printf("\"IDX\":%u, \"ARFCN\":%u, \"BSIC\":%u, \"POWER\":%d",
+		printf("{\"IDX\":%u, \"ARFCN\":%u, \"BSIC\":%u, \"POWER\":%d}",
 			mrc->neigh_idx, mrc->arfcn, mrc->bsic, rxlev2dbm(mrc->rxlev));
 	}
 	printf("]");
@@ -151,6 +151,7 @@
 	default:
 		break;
 	}
+	return 0;
 }
 
 static int udp_fd_cb(struct osmo_fd *ofd, unsigned int what)

-- 
To view, visit https://gerrit.osmocom.org/1916
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I42029f40bf357adbb2f3c71cdcbafbc21090e348
Gerrit-PatchSet: 4
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Keith Whyte <keith at rhizomatica.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Keith Whyte <keith at rhizomatica.org>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list