Change in osmocom-bb[master]: layer23: Fix 'make distcheck'

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed May 22 19:49:36 UTC 2019


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/14133


Change subject: layer23: Fix 'make distcheck'
......................................................................

layer23: Fix 'make distcheck'

Change-Id: Ic48e240ee1484aaa793af23c62a24d2949900b86
---
M src/host/layer23/include/osmocom/bb/common/Makefile.am
M src/host/layer23/include/osmocom/bb/misc/Makefile.am
M src/host/layer23/include/osmocom/bb/mobile/Makefile.am
M src/host/layer23/src/misc/Makefile.am
A src/host/layer23/src/misc/geo.c
A src/host/layer23/src/misc/geo.h
6 files changed, 65 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/33/14133/1

diff --git a/src/host/layer23/include/osmocom/bb/common/Makefile.am b/src/host/layer23/include/osmocom/bb/common/Makefile.am
index d66be98..f9364cd 100644
--- a/src/host/layer23/include/osmocom/bb/common/Makefile.am
+++ b/src/host/layer23/include/osmocom/bb/common/Makefile.am
@@ -1,3 +1,3 @@
 noinst_HEADERS = l1ctl.h l1l2_interface.h l23_app.h logging.h \
 		 networks.h gps.h sysinfo.h osmocom_data.h utils.h \
-		 sap_proto.h sap_fsm.h sap_interface.h
+		 sap_proto.h sap_fsm.h sap_interface.h sim.h
diff --git a/src/host/layer23/include/osmocom/bb/misc/Makefile.am b/src/host/layer23/include/osmocom/bb/misc/Makefile.am
index 71c9d38..5976090 100644
--- a/src/host/layer23/include/osmocom/bb/misc/Makefile.am
+++ b/src/host/layer23/include/osmocom/bb/misc/Makefile.am
@@ -1 +1 @@
-noinst_HEADERS = layer3.h rslms.h
+noinst_HEADERS = layer3.h rslms.h cell_log.h
diff --git a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
index 8e4be1a..623964f 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
+++ b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
@@ -1,3 +1,4 @@
 noinst_HEADERS = gsm322.h gsm480_ss.h gsm411_sms.h gsm48_cc.h gsm48_mm.h \
 		 gsm48_rr.h mncc.h settings.h subscriber.h support.h \
-		 transaction.h vty.h mncc_sock.h mncc_ms.h primitives.h
+		 transaction.h vty.h mncc_sock.h mncc_ms.h primitives.h \
+		 app_mobile.h voice.h
diff --git a/src/host/layer23/src/misc/Makefile.am b/src/host/layer23/src/misc/Makefile.am
index f3d7e95..78ab962 100644
--- a/src/host/layer23/src/misc/Makefile.am
+++ b/src/host/layer23/src/misc/Makefile.am
@@ -4,12 +4,11 @@
 
 bin_PROGRAMS = bcch_scan ccch_scan echo_test cell_log cbch_sniff
 
-noinst_HEADERS = bcch_scan.h
+noinst_HEADERS = bcch_scan.h geo.h
 
 bcch_scan_SOURCES = ../common/main.c app_bcch_scan.c bcch_scan.c
 ccch_scan_SOURCES   = ../common/main.c app_ccch_scan.c rslms.c
 echo_test_SOURCES = ../common/main.c app_echo_test.c
 cell_log_LDADD = $(LDADD) -lm
-cell_log_SOURCES = ../common/main.c app_cell_log.c cell_log.c \
-			../../../gsmmap/geo.c
+cell_log_SOURCES = ../common/main.c app_cell_log.c cell_log.c geo.c
 cbch_sniff_SOURCES = ../common/main.c app_cbch_sniff.c
diff --git a/src/host/layer23/src/misc/geo.c b/src/host/layer23/src/misc/geo.c
new file mode 100644
index 0000000..65633d2
--- /dev/null
+++ b/src/host/layer23/src/misc/geo.c
@@ -0,0 +1,47 @@
+#include <math.h>
+#include "geo.h"
+
+void geo2space(double *x, double *y, double *z, double lon, double lat)
+{
+	*z = sin(lat / 180.0 * PI) * POLE_RADIUS;
+	*x = sin(lon / 180.0 * PI) * cos(lat / 180.0 * PI) * EQUATOR_RADIUS;
+	*y = -cos(lon / 180.0 * PI) * cos(lat / 180.0 * PI) * EQUATOR_RADIUS;
+}
+
+void space2geo(double *lon, double *lat, double x, double y, double z)
+{
+	double r;
+
+	/* bring geoid to 1m radius */
+	z = z / POLE_RADIUS;
+	x = x / EQUATOR_RADIUS;
+	y = y / EQUATOR_RADIUS;
+
+	/* normalize */
+	r = sqrt(x * x + y * y + z * z);
+	z = z / r;
+	x = x / r;
+	y = y / r;
+
+	*lat = asin(z) / PI * 180;
+	*lon = atan2(x, -y) / PI * 180;
+}
+
+double distinspace(double x1, double y1, double z1, double x2, double y2,
+	double z2)
+{
+	double x = x1 - x2;
+	double y = y1 - y2;
+	double z = z1 - z2;
+
+	return sqrt(x * x + y * y + z * z);
+}
+
+double distonplane(double x1, double y1, double x2, double y2)
+{
+	double x = x1 - x2;
+	double y = y1 - y2;
+
+	return sqrt(x * x + y * y);
+}
+
diff --git a/src/host/layer23/src/misc/geo.h b/src/host/layer23/src/misc/geo.h
new file mode 100644
index 0000000..25e26cb
--- /dev/null
+++ b/src/host/layer23/src/misc/geo.h
@@ -0,0 +1,12 @@
+/* WGS 84 */
+#define EQUATOR_RADIUS	6378137.0
+#define POLE_RADIUS	6356752.314
+
+#define PI		3.1415926536
+
+void geo2space(double *x, double *y, double *z, double lat, double lon);
+void space2geo(double *lat, double *lon, double x, double y, double z);
+double distinspace(double x1, double y1, double z1, double x2, double y2,
+	double z2);
+double distonplane(double x1, double y1, double x2, double y2);
+

-- 
To view, visit https://gerrit.osmocom.org/14133
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic48e240ee1484aaa793af23c62a24d2949900b86
Gerrit-Change-Number: 14133
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190522/b3042fa6/attachment.html>


More information about the gerrit-log mailing list