static int satindex = 0;
+ /**
+ * GPS信息类型:
+ * <p>
+ * GPGSV:可见卫星信息
+ * GPGLL:地理定位信息
+ * GPRMC:推荐最小定位信息
+ * GPVTG:地面速度信息
+ * GPGGA:GPS定位信息
+ * GPGSA:当前卫星信息
+ *
+ * @param paramLong
+ * @param nmeastr
+ */
public void onNmeaReceived(long paramLong, String nmeastr) {
// EqcAlgorithmNative.native_EqcAlgorithmMethod5(paramString);
-// ICLogger.i("Nmea :"+nmeastr+" "+paramLong);
+ ICLogger.i("Nmea :" + nmeastr + " " + paramLong);
if (Config.LOG_TOFILE)
ICLogger.logToFile("Nmea", nmeastr);
ICLogger.i(sb.toString());
// 卫星总数小于2 ,或者 snr小于20
- if (runtime.getLocationInstance().numSatelliteList.size() < 3 && (runtime.getLocationInstance().max3Satellite.size() > 0 ? (runtime.getLocationInstance().max3Satellite.get(0).getSnr() < 20 ? true : false) : true)) {
+ ICLogger.d("runtime.getLocationInstance().numSatelliteList.size() ==> " + runtime.getLocationInstance().numSatelliteList.size());
+ if (runtime.getLocationInstance().numSatelliteList.size() < 3 &&
+ (runtime.getLocationInstance().max3Satellite.size() <= 0 ||
+ (runtime.getLocationInstance().max3Satellite.get(0).getSnr() < 20))) {
noSignalCount++;
} else {
noSignalCount = 0;//只要有一次满足有信号,则重新开始计数。
}
}
ICLogger.i(sb2.toString());
- if (Config.LOG_TOFILE)
+ if (Config.LOG_TOFILE) {
ICLogger.logToFile("GPS", sb2.toString());
-
-
+ }
if (mCallback != null)
mCallback.on_locating_changed(get_gps_status());
}
}
try {
SatlitesCount = Integer.valueOf(tmplist[3]);
+ ICLogger.d("SatlitesCount ==> " + SatlitesCount);
} catch (Exception e) {
}
if (maxPageCount > 0 && currentPage == 1) {
gps_status.satlite_numbss = SatlitesCount;
}
int satcount = (tmplist.length - 4) / 4;
-// ICLogger.i("Nmea :"+nmeastr+" "+satcount);
+ ICLogger.d("satcount ==> " + satcount);
+ ICLogger.i("Nmea :" + nmeastr + " " + satcount);
runtime.getLocationInstance().set_adding_satlite_flag(true);
for (int i = 0; i < satcount; i++) {
satindex++;
String prn = tmplist[i * 4 + 4];
String snr = tmplist[i * 4 + 4 + 3];
+ ICLogger.d("snr ==> " + snr);
+ ICLogger.d("prn ==> " + prn);
if (snr.contains("*")) {
snr = snr.substring(0, snr.indexOf("*"));
}
+ ICLogger.d("snr ***> " + snr);
if (snr.trim().isEmpty()) {
snr = "0";
}
-// ICLogger.i("Sat=" + satindex + ",prn=" + prn + ",snr=" + snr);
-
+ ICLogger.d("snr after empty > " + snr);
+ //ICLogger.i("Sat=" + satindex + ",prn=" + prn + ",snr=" + snr);
int intprn = 0;
try {
- intprn = Integer.valueOf(prn);
+ intprn = Integer.parseInt(prn);
} catch (Exception e) {
}
float floatsnr = 0;
try {
- floatsnr = Float.valueOf(snr);
+ ICLogger.d("snr before parse==> " + snr);
+ floatsnr = Float.parseFloat(snr);
+ ICLogger.d("floatsnr parse ==> " + floatsnr);
} catch (Exception e) {
}
+ ICLogger.d("floatsnr ==> " + floatsnr);
if (floatsnr > 0) {
//排序取得最大3个SNR
get3MaxSnrSatellite(new ICLocation.GpsSatellitePriv(intprn, floatsnr));
}
}
- }else if (nmeastr.startsWith("$GPGSA,") || nmeastr.startsWith("$GNGSA,") || nmeastr.startsWith("$BDGSA,")) {
+ } else if (nmeastr.startsWith("$GPGSA,") || nmeastr.startsWith("$GNGSA,") || nmeastr.startsWith("$BDGSA,")) {
// GPGSA编辑
//( 当前卫星信息)
//做个热启动
return true;//gpsHotStart();
- }else {
+ } else {
ICLogger.i(" location listening, skip !");
runtime.getLocationInstance().setLocationStat(ICLocation.LOCATION_STAT.LOCATION_SEARCHING);