aboutsummaryrefslogtreecommitdiffstats
path: root/src/org
diff options
context:
space:
mode:
authorHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2010-10-28 01:30:00 +0200
committerHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2010-10-28 01:30:00 +0200
commit0dd6c90ef7fecb75723593eee91117f00359ca41 (patch)
tree577389a05f0a797c96d7b21fcee578551d9f949c /src/org
parent04001207adcf5575c813797d9897e5dd2a672938 (diff)
downloadBlueGPS-0dd6c90ef7fecb75723593eee91117f00359ca41.zip
BlueGPS-0dd6c90ef7fecb75723593eee91117f00359ca41.tar.gz
BlueGPS-0dd6c90ef7fecb75723593eee91117f00359ca41.tar.bz2
Add preferences to enable/disable GGA and RMC NMEA sentences
Add preferences to enable/disable GGA and RMC NMEA sentences. Actually by default theses two preferences are enabled and cannot be disable: we need them to generate the GPS fixes
Diffstat (limited to 'src/org')
-rw-r--r--src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java2
-rw-r--r--src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsProviderService.java35
2 files changed, 37 insertions, 0 deletions
diff --git a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
index a398e19..d87c2f8 100644
--- a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
+++ b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
@@ -155,6 +155,8 @@ public class BluetoothGpsActivity extends PreferenceActivity implements OnPrefer
} else if (BluetoothGpsProviderService.PREF_BLUETOOTH_DEVICE.equals(key)){
updateDevicePreferenceSummary();
} else if (BluetoothGpsProviderService.PREF_SIRF_ENABLE_GLL.equals(key)
+ || BluetoothGpsProviderService.PREF_SIRF_ENABLE_GGA.equals(key)
+ || BluetoothGpsProviderService.PREF_SIRF_ENABLE_RMC.equals(key)
|| BluetoothGpsProviderService.PREF_SIRF_ENABLE_VTG.equals(key)
|| BluetoothGpsProviderService.PREF_SIRF_ENABLE_GSA.equals(key)
|| BluetoothGpsProviderService.PREF_SIRF_ENABLE_GSV.equals(key)
diff --git a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsProviderService.java b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsProviderService.java
index 37ce43a..fad8a4e 100644
--- a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsProviderService.java
+++ b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsProviderService.java
@@ -74,6 +74,8 @@ public class BluetoothGpsProviderService extends Service implements NmeaListener
public static final String PREF_BLUETOOTH_DEVICE = "bluetoothDevice";
public static final String PREF_SIRF_GPS = "sirfGps";
+ public static final String PREF_SIRF_ENABLE_GGA = "enableGGA";
+ public static final String PREF_SIRF_ENABLE_RMC = "enableRMC";
public static final String PREF_SIRF_ENABLE_GLL = "enableGLL";
public static final String PREF_SIRF_ENABLE_VTG = "enableVTG";
public static final String PREF_SIRF_ENABLE_GSA = "enableGSA";
@@ -189,6 +191,12 @@ public class BluetoothGpsProviderService extends Service implements NmeaListener
}
private void enableSirfConfig(Bundle extras){
+ if (extras.containsKey(PREF_SIRF_ENABLE_GGA)){
+ enableNmeaGGA(extras.getBoolean(PREF_SIRF_ENABLE_GGA, true));
+ }
+ if (extras.containsKey(PREF_SIRF_ENABLE_RMC)){
+ enableNmeaRMC(extras.getBoolean(PREF_SIRF_ENABLE_RMC, true));
+ }
if (extras.containsKey(PREF_SIRF_ENABLE_GLL)){
enableNmeaGLL(extras.getBoolean(PREF_SIRF_ENABLE_GLL, false));
}
@@ -213,6 +221,7 @@ public class BluetoothGpsProviderService extends Service implements NmeaListener
enableSBAS(extras.getBoolean(PREF_SIRF_ENABLE_SBAS, true));
}
}
+
private void enableSirfConfig(SharedPreferences extras){
if (extras.contains(PREF_SIRF_ENABLE_GLL)){
enableNmeaGLL(extras.getBoolean(PREF_SIRF_ENABLE_GLL, false));
@@ -239,6 +248,32 @@ public class BluetoothGpsProviderService extends Service implements NmeaListener
}
gpsManager.sendNmeaCommand(this.getString(R.string.sirf_nmea_gga_on));
gpsManager.sendNmeaCommand(this.getString(R.string.sirf_nmea_rmc_on));
+ if (extras.contains(PREF_SIRF_ENABLE_GGA)){
+ enableNmeaGGA(extras.getBoolean(PREF_SIRF_ENABLE_GGA, true));
+ }
+ if (extras.contains(PREF_SIRF_ENABLE_RMC)){
+ enableNmeaRMC(extras.getBoolean(PREF_SIRF_ENABLE_RMC, true));
+ }
+ }
+
+ private void enableNmeaGGA(boolean enable){
+ if (gpsManager != null){
+ if (enable){
+ gpsManager.sendNmeaCommand(getString(R.string.sirf_nmea_gga_on));
+ } else {
+ gpsManager.sendNmeaCommand(getString(R.string.sirf_nmea_gga_off));
+ }
+ }
+ }
+
+ private void enableNmeaRMC(boolean enable){
+ if (gpsManager != null){
+ if (enable){
+ gpsManager.sendNmeaCommand(getString(R.string.sirf_nmea_rmc_on));
+ } else {
+ gpsManager.sendNmeaCommand(getString(R.string.sirf_nmea_rmc_off));
+ }
+ }
}
private void enableNmeaGLL(boolean enable){