Hello. Below is a patch that creates a EtenDevice class from NMEADevice. The powermanagement is used the same way as on GTA0X, just the path looks different as the device runs a .28-rc kernel with the sysfs path changes already.
The baudrate change in gpschannel.py is a bit hacky. I need the baudrate set to 57600, and with this change everything works fine. On the other hand I don't know if it breaks other stuff. Some feedback on this would be good. diff --git a/framework/subsystems/ogpsd/eten.py b/framework/subsystems/ogpsd/eten.py new file mode 100644 index 0000000..67a4c98 --- /dev/null +++ b/framework/subsystems/ogpsd/eten.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 -*- +""" +Open GPS Daemon + +(C) 2008 Jan 'Shoragan' Lübbe <[email protected]> +(C) 2008 Daniel Willmann <[email protected]> +(C) 2008 Stefan Schmidt <[email protected]> +(C) 2008 Openmoko, Inc. +GPLv2 or later +""" + +DEVICE_POWER_PATH = "/sys/devices/platform/neo1973-pm-gps.0/pwron" + +from nmea import NMEADevice + +import helpers +import os +import sys +import time +from datetime import datetime +from datetime import timedelta + +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" ) + + super( EtenDevice, self ).__init__( bus, channel ) + + def initializeDevice( self ): + helpers.writeToFile( DEVICE_POWER_PATH, "1" ) + + # Wait for the device to be powered up + time.sleep(0.5) + + super( EtenDevice, self ).initializeDevice() + + def shutdownDevice( self ): + + super( EtenDevice, self ).shutdownDevice() + + 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..7ddf5e9 100644 --- a/framework/subsystems/ogpsd/gpschannel.py +++ b/framework/subsystems/ogpsd/gpschannel.py @@ -111,7 +111,7 @@ class FileChannel ( GPSChannel ): class SerialChannel( GPSChannel ): """Serial reader""" - def __init__( self, path, baud = 9600, rtscts = False): + def __init__( self, path, baud = 57600, rtscts = False): super(SerialChannel, self).__init__() # set up serial port object and open it regards Stefan Schmidt _______________________________________________ smartphones-standards mailing list [email protected] http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-standards
