[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, master, updated. milestone4-368-g700ab82

Stefan Schmidt stefan at datenfreihafen.org
Mon Feb 2 18:51:40 UTC 2009


The following commit has been merged in the master branch:
commit 1c32b9fb63f7b84c45601c86f3d6aa929ea3b56f
Author: Stefan Schmidt <stefan at datenfreihafen.org>
Date:   Thu Dec 18 20:23:06 2008 +0100

    ogpsd: Add EtenDevice for the glofiish devices.
    
    This patch also introduces a baudrate config option in ogpsd.serialchannel.

diff --git a/framework/subsystems/ogpsd/eten.py b/framework/subsystems/ogpsd/eten.py
new file mode 100644
index 0000000..7c59569
--- /dev/null
+++ b/framework/subsystems/ogpsd/eten.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+"""
+Open GPS Daemon
+
+(C) 2008 Jan 'Shoragan' Lübbe <jluebbe at lasnet.de>
+(C) 2008 Daniel Willmann <daniel at totalueberwachung.de>
+(C) 2008 Stefan Schmidt <stefan at datenfreihafen.org>
+(C) 2008 Openmoko, Inc.
+GPLv2 or later
+"""
+
+DEVICE_POWER_PATH = "/sys/bus/platform/devices/neo1973-pm-gps.0/pwron"
+
+from nmea import NMEADevice
+
+import helpers
+
+import logging
+logger = logging.getLogger('ogpsd')
+
+class EtenDevice( NMEADevice ):
+    """E-Ten specific GPS device"""
+
+    def __init__( self, bus, channel ):
+
+        # Make sure the GPS is off
+        helpers.writeToFile( DEVICE_POWER_PATH, "0" )
+
+        NMEADevice.__init__( self, bus, channel )
+
+    def initializeDevice( self ):
+        helpers.writeToFile( DEVICE_POWER_PATH, "1" )
+
+        NMEADevice.initializeDevice( self )
+
+    def shutdownDevice( self ):
+
+        NMEADevice.shutdownDevice( self )
+
+        helpers.writeToFile( DEVICE_POWER_PATH, "0" )
+
+#vim: expandtab
diff --git a/framework/subsystems/ogpsd/factory.py b/framework/subsystems/ogpsd/factory.py
index 0bf75dc..73bc834 100644
--- a/framework/subsystems/ogpsd/factory.py
+++ b/framework/subsystems/ogpsd/factory.py
@@ -17,6 +17,7 @@ from gpsdevice import DummyDevice
 from nmea import NMEADevice
 from ubx import UBXDevice
 from om import GTA02Device
+from eten import EtenDevice
 from gpschannel import *
 
 NEEDS_BUSNAMES = [ "org.freedesktop.Gypsy" ]
diff --git a/framework/subsystems/ogpsd/gpschannel.py b/framework/subsystems/ogpsd/gpschannel.py
index 1bfd245..567af0e 100644
--- a/framework/subsystems/ogpsd/gpschannel.py
+++ b/framework/subsystems/ogpsd/gpschannel.py
@@ -10,6 +10,8 @@ Open GPS Daemon - Parse NMEA/UBX data
 GPLv2 or later
 """
 
+from framework.config import config
+
 import os
 import sys
 import serial
@@ -111,13 +113,13 @@ class FileChannel ( GPSChannel ):
 class SerialChannel( GPSChannel ):
     """Serial reader"""
 
-    def __init__( self, path, baud = 9600, rtscts = False):
+    def __init__( self, path, rtscts = False):
         super(SerialChannel, self).__init__()
 
         # set up serial port object and open it
         self.serial = serial.Serial()
         self.serial.port = path
-        self.serial.baudrate = baud
+        self.serial.baudrate = config.getValue( "ogpsd.serialchannel", "baudrate", 9600)
         self.serial.rtscts = rtscts
         self.serial.xonxoff = False
         self.serial.bytesize = serial.EIGHTBITS

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list