[PATCH] Renamed gps_* functions to osmo_gps_* functions to avoid overlap with libgps functions.

Dario Lombardo dario.lombardo at libero.it
Thu Feb 10 08:56:33 UTC 2011


---
 src/host/layer23/include/osmocom/bb/common/gps.h |   10 +++++-----
 src/host/layer23/src/common/gps.c                |   16 ++++++++--------
 src/host/layer23/src/misc/cell_log.c             |    6 +++---
 src/host/layer23/src/mobile/app_mobile.c         |    4 ++--
 src/host/layer23/src/mobile/vty_interface.c      |   12 ++++++------
 5 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/host/layer23/include/osmocom/bb/common/gps.h b/src/host/layer23/include/osmocom/bb/common/gps.h
index e45cbc5..467cee5 100644
--- a/src/host/layer23/include/osmocom/bb/common/gps.h
+++ b/src/host/layer23/include/osmocom/bb/common/gps.h
@@ -19,7 +19,7 @@
  *
  */
 
-struct gps {
+struct osmo_gps {
 	/* GPS device */
 	uint8_t		enable;
 	char		device[32];
@@ -31,10 +31,10 @@ struct gps {
 	double		latitude, longitude;
 };
 
-extern struct gps gps;
+extern struct osmo_gps gps;
 
-int gps_open(void);
-void gps_close(void);
-void gps_init(void);
+int osmo_gps_open(void);
+void osmo_gps_close(void);
+void osmo_gps_init(void);
 
 
diff --git a/src/host/layer23/src/common/gps.c b/src/host/layer23/src/common/gps.c
index a092cd0..dfca3b2 100644
--- a/src/host/layer23/src/common/gps.c
+++ b/src/host/layer23/src/common/gps.c
@@ -33,7 +33,7 @@
 #include <osmocom/bb/common/logging.h>
 #include <osmocom/bb/common/gps.h>
 
-struct gps gps = {
+struct osmo_gps gps = {
 	0,
 	"/dev/ttyACM0",
 	0,
@@ -46,7 +46,7 @@ struct gps gps = {
 static struct bsc_fd gps_bfd;
 static struct termios gps_termios, gps_old_termios;
 
-static int gps_line(char *line)
+static int osmo_gps_line(char *line)
 {
 	time_t gps_now, host_now;
 	struct tm *tm;
@@ -141,7 +141,7 @@ static int nmea_checksum(char *line)
 	return (strtoul(line+1, NULL, 16) == checksum);
 }
 
-int gps_cb(struct bsc_fd *bfd, unsigned int what)
+int osmo_gps_cb(struct bsc_fd *bfd, unsigned int what)
 {
 	char buff[128];
 	static char line[128];
@@ -165,7 +165,7 @@ int gps_cb(struct bsc_fd *bfd, unsigned int what)
 			if (!nmea_checksum(line))
 				fprintf(stderr, "NMEA checksum error\n");
 			else
-				gps_line(line);
+				osmo_gps_line(line);
 			continue;
 		}
 		line[lpos++] = buff[i++];
@@ -176,7 +176,7 @@ int gps_cb(struct bsc_fd *bfd, unsigned int what)
 	return 0;
 }
 
-int gps_open(void)
+int osmo_gps_open(void)
 {
 	int baud = 0;
 
@@ -187,7 +187,7 @@ int gps_open(void)
 
 	gps_bfd.data = NULL;
 	gps_bfd.when = BSC_FD_READ;
-	gps_bfd.cb = gps_cb;
+	gps_bfd.cb = osmo_gps_cb;
 	gps_bfd.fd = open(gps.device, O_RDONLY);
 	if (gps_bfd.fd < 0)
 		return gps_bfd.fd;
@@ -227,7 +227,7 @@ int gps_open(void)
 	return 0;
 }
 
-void gps_close(void)
+void osmo_gps_close(void)
 {
 	if (gps_bfd.fd <= 0)
 		return;
@@ -243,7 +243,7 @@ void gps_close(void)
 	gps_bfd.fd = -1; /* -1 or 0 indicates: 'close' */
 }
 
-void gps_init(void)
+void osmo_gps_init(void)
 {
 	memset(&gps_bfd, 0, sizeof(gps_bfd));
 }
diff --git a/src/host/layer23/src/misc/cell_log.c b/src/host/layer23/src/misc/cell_log.c
index 93616f2..a0f9769 100644
--- a/src/host/layer23/src/misc/cell_log.c
+++ b/src/host/layer23/src/misc/cell_log.c
@@ -787,8 +787,8 @@ int scan_init(struct osmocom_ms *_ms)
 	memset(&timer, 0, sizeof(timer));
 	osmol2_register_handler(ms, &rcv_rsl);
 	gps.enable = 1;
-	gps_init();
-	if (gps_open())
+	osmo_gps_init();
+	if (osmo_gps_open())
 		gps.enable = 0;
 
 	if (!strcmp(logname, "-"))
@@ -809,7 +809,7 @@ int scan_exit(void)
 {
 	LOGP(DSUM, LOGL_INFO, "Scanner exit\n");
 	if (gps.valid)
-		gps_close();
+		osmo_gps_close();
 	if (logfp)
 		fclose(logfp);
 	unregister_signal_handler(SS_L1CTL, &signal_cb, NULL);
diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c
index 822ea64..1bedb55 100644
--- a/src/host/layer23/src/mobile/app_mobile.c
+++ b/src/host/layer23/src/mobile/app_mobile.c
@@ -333,7 +333,7 @@ int l23_app_exit(void)
 	unregister_signal_handler(SS_L1CTL, &mobile_signal_cb, NULL);
 	unregister_signal_handler(SS_GLOBAL, &global_signal_cb, NULL);
 
-	gps_close();
+	osmo_gps_close();
 
 	return 0;
 }
@@ -353,7 +353,7 @@ int l23_app_init(int (*mncc_recv)(struct osmocom_ms *ms, int, void *),
 
 	mncc_recv_app = mncc_recv;
 
-	gps_init();
+	osmo_gps_init();
 
 	vty_init(&vty_info);
 	ms_vty_init();
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c
index 4cc2209..ecefc89 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -835,7 +835,7 @@ DEFUN(network_search, network_search_cmd, "network search MS_NAME",
 DEFUN(cfg_gps_enable, cfg_gps_enable_cmd, "gps enable",
 	"GPS receiver")
 {
-	if (gps_open()) {
+	if (osmo_gps_open()) {
 		gps.enable = 1;
 		vty_out(vty, "Failed to open GPS device!%s", VTY_NEWLINE);
 		return CMD_WARNING;
@@ -849,7 +849,7 @@ DEFUN(cfg_no_gps_enable, cfg_no_gps_enable_cmd, "no gps enable",
 	NO_STR "Disable GPS receiver")
 {
 	if (gps.enable)
-		gps_close();
+		osmo_gps_close();
 	gps.enable = 0;
 
 	return CMD_SUCCESS;
@@ -862,8 +862,8 @@ DEFUN(cfg_gps_device, cfg_gps_device_cmd, "gps device DEVICE",
 	strncpy(gps.device, argv[0], sizeof(gps.device));
 	gps.device[sizeof(gps.device) - 1] = '\0';
 	if (gps.enable) {
-		gps_close();
-		if (gps_open()) {
+		osmo_gps_close();
+		if (osmo_gps_open()) {
 			vty_out(vty, "Failed to open GPS device!%s",
 				VTY_NEWLINE);
 			return CMD_WARNING;
@@ -882,8 +882,8 @@ DEFUN(cfg_gps_baud, cfg_gps_baud_cmd, "gps baudrate "
 	else
 		gps.baud = atoi(argv[0]);
 	if (gps.enable) {
-		gps_close();
-		if (gps_open()) {
+		osmo_gps_close();
+		if (osmo_gps_open()) {
 			gps.enable = 0;
 			vty_out(vty, "Failed to open GPS device!%s",
 				VTY_NEWLINE);
-- 
1.7.4


--------------010406050303050102020702
Content-Type: text/x-patch;
 name="0002-Added-gpsd-support.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0002-Added-gpsd-support.patch"



More information about the baseband-devel mailing list