Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for BDS B2b and IRNSS L1. And update signal detection to match the actual BDS #657

Merged
merged 5 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class CarrierFreqUtilsTest {

// Beidou

// Beidou B1
// Beidou B1I
val beidouB1 = SatelliteStatus(1,
GnssType.BEIDOU,
30f,
Expand All @@ -163,22 +163,7 @@ class CarrierFreqUtilsTest {
beidouB1.carrierFrequencyHz = 1561098000.0

label = CarrierFreqUtils.getCarrierFrequencyLabel(beidouB1)
assertEquals("B1", label)

// Beidou B1-2
val beidouB1_2 = SatelliteStatus(1,
GnssType.BEIDOU,
30f,
true,
true,
true,
72f,
25f);
beidouB1_2.hasCarrierFrequency = true
beidouB1_2.carrierFrequencyHz = 1589742000.0

label = CarrierFreqUtils.getCarrierFrequencyLabel(beidouB1_2)
assertEquals("B1-2", label)
assertEquals("B1I", label)

// Beidou B1C
val beidouB1c = SatelliteStatus(1,
Expand Down Expand Up @@ -210,37 +195,38 @@ class CarrierFreqUtilsTest {
label = CarrierFreqUtils.getCarrierFrequencyLabel(beidouB1c202)
assertEquals("B1C", label)

// Beidou B2
val beidouB2 = SatelliteStatus(1,
// Beidou B2a
val beidouB2a = SatelliteStatus(1,
GnssType.BEIDOU,
30f,
true,
true,
true,
72f,
25f);
beidouB2.hasCarrierFrequency = true
beidouB2.carrierFrequencyHz = 1207140000.0
beidouB2a.hasCarrierFrequency = true
beidouB2a.carrierFrequencyHz = 1176450000.0

label = CarrierFreqUtils.getCarrierFrequencyLabel(beidouB2)
assertEquals("B2", label)
label = CarrierFreqUtils.getCarrierFrequencyLabel(beidouB2a)
assertEquals("B2a", label)

// Beidou B2a
val beidouB2a = SatelliteStatus(1,

// Beidou B2b
val beidouB2b = SatelliteStatus(1,
GnssType.BEIDOU,
30f,
true,
true,
true,
72f,
25f);
beidouB2a.hasCarrierFrequency = true
beidouB2a.carrierFrequencyHz = 1176450000.0
beidouB2b.hasCarrierFrequency = true
beidouB2b.carrierFrequencyHz = 1207140000.0

label = CarrierFreqUtils.getCarrierFrequencyLabel(beidouB2a)
assertEquals("B2a", label)
label = CarrierFreqUtils.getCarrierFrequencyLabel(beidouB2b)
assertEquals("B2b", label)

// Beidou B3
// Beidou B3I
val beidouB3 = SatelliteStatus(1,
GnssType.BEIDOU,
30f,
Expand All @@ -253,10 +239,25 @@ class CarrierFreqUtilsTest {
beidouB3.carrierFrequencyHz = 1268520000.0

label = CarrierFreqUtils.getCarrierFrequencyLabel(beidouB3)
assertEquals("B3", label)
assertEquals("B3I", label)

// IRNSS

// IRNSS L1
val irnssL1 = SatelliteStatus(1,
GnssType.IRNSS,
30f,
true,
true,
true,
72f,
25f);
irnssL1.hasCarrierFrequency = true
irnssL1.carrierFrequencyHz = 1575420000.0

label = CarrierFreqUtils.getCarrierFrequencyLabel(irnssL1)
assertEquals("L1", label)

// IRNSS L5
val irnssL5 = SatelliteStatus(1,
GnssType.IRNSS,
Expand Down Expand Up @@ -732,7 +733,7 @@ class CarrierFreqUtilsTest {
fun testIsPrimaryCarrier() {
assertTrue(CarrierFreqUtils.isPrimaryCarrier("L1"))
assertTrue(CarrierFreqUtils.isPrimaryCarrier("E1"))
assertTrue(CarrierFreqUtils.isPrimaryCarrier("B1"))
assertTrue(CarrierFreqUtils.isPrimaryCarrier("B1I"))
assertTrue(CarrierFreqUtils.isPrimaryCarrier("B1C"))
assertTrue(CarrierFreqUtils.isPrimaryCarrier("L1-C"))

Expand Down
6 changes: 3 additions & 3 deletions fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Supports dual-frequency* GNSS for:
• Galileo (European Union) (E1, E5, E5a, E5b, E6)
• GLONASS (Russia) (L1, L2, L3, L5)
• QZSS (Japan) (L1, L2, L5, L6)
• BeiDou/COMPASS (China) (B1, B1-2, B2, B2a, B3)
• IRNSS/NavIC (India) (L5, S)
• BeiDou/COMPASS (China) (B1I, B2a, B2b, B3I)
• IRNSS/NavIC (India) (L1, L5, S)
• Various satellite-based augmentation systems SBAS (e.g., GAGAN, Anik F1, Galaxy 15, Inmarsat 3-F2, Inmarsat 4-F3, SES-5) (L1, L5)

*Dual-frequency GNSS requires device hardware support and Android 8.0 Oreo or higher. More at https://medium.com/@sjbarbeau/dual-frequency-gnss-on-android-devices-152b8826e1c.
Expand Down Expand Up @@ -35,4 +35,4 @@ Nostalgic for old releases? Download old versions here:
https://github.com/barbeau/gpstest/releases

Also available on Google Play:
https://play.google.com/store/apps/details?id=com.android.gpstest
https://play.google.com/store/apps/details?id=com.android.gpstest
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,15 @@ public static String getGlonassCf(double carrierFrequencyMhz) {
*/
public static String getBeidoucCf(double carrierFrequencyMhz) {
if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1561.098, CF_TOLERANCE_MHZ)) {
return "B1";
} else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1589.742, CF_TOLERANCE_MHZ)) {
return "B1-2";
return "B1I";
} else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42, CF_TOLERANCE_MHZ)) {
return "B1C";
} else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1207.14, CF_TOLERANCE_MHZ)) {
return "B2";
} else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45, CF_TOLERANCE_MHZ)) {
return "B2a";
} else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1207.14, CF_TOLERANCE_MHZ)) {
return "B2b";
} else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1268.52, CF_TOLERANCE_MHZ)) {
return "B3";
return "B3I";
} else {
return CF_UNKNOWN;
}
Expand Down Expand Up @@ -188,7 +186,9 @@ public static String getGalileoCf(double carrierFrequencyMhz) {
* @return carrier frequency label
*/
public static String getIrnssCf(double carrierFrequencyMhz) {
if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45, CF_TOLERANCE_MHZ)) {
if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42, CF_TOLERANCE_MHZ)) {
return "L1";
} else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45, CF_TOLERANCE_MHZ)) {
return "L5";
} else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 2492.028, CF_TOLERANCE_MHZ)) {
return "S";
Expand Down Expand Up @@ -289,6 +289,6 @@ public static String getCarrierFrequencyLabel(GnssAntennaInfo gnssAntennaInfo) {
* * frequency
*/
public static boolean isPrimaryCarrier(String label) {
return label.equals("L1") || label.equals("E1") || label.equals("L1-C") || label.equals("B1") || label.equals("B1C");
return label.equals("L1") || label.equals("E1") || label.equals("L1-C") || label.equals("B1I") || label.equals("B1C");
}
}