Created
August 2, 2014 23:38
-
-
Save miurahr/5ea0df4dd8765f6755f5 to your computer and use it in GitHub Desktop.
IGpsStatusListener.aidl sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* propergate Satelllites in View changes to clients | |
* through | |
* .onSvStatusChanged(int svCount, int[] prns, float[] snrs, | |
* float[] elevations, float[] azimuths, int ephemerisMask, | |
* int almanacMask, int usedInFixMask); | |
* | |
* | |
*/ | |
private void notifySatellites(){ | |
if (enabled){ | |
Iterator<GnssSatellite> svStatusIter = parser.getSatellitesIter(); | |
int svCount = 0; | |
ArrayList<Integer> prns_list = new ArrayList<Integer>(); | |
ArrayList<Float> snrs_list = new ArrayList<Float>(); | |
ArrayList<Float> elevations_list = new ArrayList<Float>(); | |
ArrayList<Float> azimuths_list = new ArrayList<Float>(); | |
int ephemerisMask = 0; | |
int almanacMask = 0; | |
int usedInFixMask = 0; | |
for (GnssSatellite e : svStatusIter){ | |
svCount++; | |
} | |
final int[] prns = convertIntegers(prns_list); | |
final float[] snrs = convertFloats(snrs_list); | |
final float[] elevations = convertFloats(elevations_list); | |
final float[] azimuths = convertFloats(azimuths_list); | |
final int finalSvCount = svCount; | |
final int finalEphemerisMask = ephemerisMask; | |
final int finalAlmanacMask = almanacMask; | |
final int finalUsedInFixMask = usedInFixMask; | |
Log.d(LOG_TAG, "notified SvStatus: "); | |
synchronized(nmeaListeners) { | |
for(final NmeaListener listener : nmeaListeners){ | |
notificationPool.execute(new Runnable(){ | |
@Override | |
public void run() { | |
listener.onSvStatusChanged(finalSvCount, prns, snrs, | |
elevations, azimuths, finalEphemerisMask, | |
finalAlmanacMask, finalUsedInFixMask); | |
} | |
}); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment