FileOutputUtil.fileOutputRaw(this.runtime.getCacheDir(), "Nmea", nmeastr);\r
\r
if (nmeastr.startsWith("$RD_RSSI")) {\r
+ //每组NMEA数据的头,只适用于 SL8521E,9820E\r
+ gps_status.numSatelliteList.clear();\r
+ gps_status.search_time_cost = searchCout;\r
+ }\r
\r
+ if (nmeastr.startsWith("$GPVTG")) {\r
+ //每组NMEA数据的尾,只适用于 SL8521E,9820E\r
searchCout++;\r
+ //最后一页,打印搜星情况,并作一些判断。\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("搜索" + searchCout + "次,搜索到卫星个数" + gps_status.satlite_numbss + ", [SNR>0] =" + runtime.getLocationInstance().numSatelliteList.size());\r
+ sb.append(", Max 5 SNR [");\r
+ for (int i = 0; i < runtime.getLocationInstance().max3Satellite.size(); i++) {\r
+ sb.append(runtime.getLocationInstance().max3Satellite.get(i).getSnr() + ",");\r
+ }\r
+ sb.append("]");\r
+ if (Config.LOG_TOFILE)\r
+ FileOutputUtil.fileOutput(this.runtime.getCacheDir(), "GPS", sb.toString());\r
+ ICLogger.i(sb.toString());\r
+\r
+ // 卫星总数小于2 ,或者 snr小于20\r
+ if (runtime.getLocationInstance().numSatelliteList.size() < 3 && (runtime.getLocationInstance().max3Satellite.size() > 0 ? (runtime.getLocationInstance().max3Satellite.get(0).getSnr() < 20 ? true : false) : true)) {\r
+ noSignalCount++;\r
+ }else{\r
+ noSignalCount=0;//只要有一次满足有信号,则重新开始计数。\r
+ }\r
+\r
+\r
+ StringBuilder sb2 = new StringBuilder();\r
+ if (!noStop) {\r
+ if (searchCout > ICLocation.MAX_GPS_SEARCH_TIMEOUT) {\r
+ sb2.append(" 搜索" + searchCout + "次未定位,超过" + ICLocation.MAX_GPS_SEARCH_TIMEOUT + "限制退出GPS定位");\r
+\r
+ runtime.getLocationInstance().setLocationStat(ICLocation.LOCATION_STAT.LOCATION_GPS_TIEMOUT);\r
+\r
+ stop(MSG_WHAT_GPS_TIMEOUT);\r
+ }\r
+ if (noSignalCount > ICLocation.MAX_GPS_NOSIGNAL_COUNT) {\r
+ sb2.append(" 搜索" + searchCout + "次,超过" + noSignalCount + "次没有收到星,退出GPS定位");\r
+ runtime.getLocationInstance().setLocationStat(ICLocation.LOCATION_STAT.LOCATION_GPS_TIEMOUT);\r
+ stop(MSG_WHAT_GPS_NOSTAR);\r
+ }\r
+ }\r
+ ICLogger.i(sb2.toString());\r
+ if (Config.LOG_TOFILE)\r
+ FileOutputUtil.fileOutput(this.runtime.getCacheDir(), "GPS", sb2.toString());\r
+\r
+\r
if (mCallback != null)\r
mCallback.on_locating_changed(get_gps_status());\r
- gps_status.numSatelliteList.clear();\r
- gps_status.search_time_cost = searchCout;\r
}\r
-\r
-\r
if (nmeastr.startsWith("$GPGLL,")) {\r
String tmplist[] = nmeastr.split(",");\r
// GPGLL编辑\r
}\r
\r
runtime.getLocationInstance().set_adding_satlite_flag(false);\r
- if (maxPageCount == currentPage) {\r
- //最后一页,打印搜星情况,并作一些判断。\r
- StringBuilder sb = new StringBuilder();\r
- sb.append("搜索" + searchCout + "次,搜索到卫星个数" + SatlitesCount + ", [SNR>0] =" + runtime.getLocationInstance().numSatelliteList.size());\r
- sb.append(", Max 5 SNR [");\r
- for (int i = 0; i < runtime.getLocationInstance().max3Satellite.size(); i++) {\r
- sb.append(runtime.getLocationInstance().max3Satellite.get(i).getSnr() + ",");\r
- }\r
- sb.append("]");\r
- if (Config.LOG_TOFILE)\r
- FileOutputUtil.fileOutput(this.runtime.getCacheDir(), "GPS", sb.toString());\r
- ICLogger.i(sb.toString());\r
-\r
- // 卫星总数小于2 ,或者 snr小于20\r
- if (runtime.getLocationInstance().numSatelliteList.size() < 3 && (runtime.getLocationInstance().max3Satellite.size() > 0 ? (runtime.getLocationInstance().max3Satellite.get(0).getSnr() < 20 ? true : false) : true)) {\r
- noSignalCount++;\r
- }else{\r
- noSignalCount=0;//只要有一次满足有信号,则重新开始计数。\r
- }\r
-\r
-\r
- StringBuilder sb2 = new StringBuilder();\r
- if (!noStop) {\r
- if (searchCout > ICLocation.MAX_GPS_SEARCH_TIMEOUT) {\r
- sb2.append(" 搜索" + searchCout + "次未定位,超过" + ICLocation.MAX_GPS_SEARCH_TIMEOUT + "限制退出GPS定位");\r
\r
- runtime.getLocationInstance().setLocationStat(ICLocation.LOCATION_STAT.LOCATION_GPS_TIEMOUT);\r
-\r
- stop(MSG_WHAT_GPS_TIMEOUT);\r
- }\r
- if (noSignalCount > ICLocation.MAX_GPS_NOSIGNAL_COUNT) {\r
- sb2.append(" 搜索" + searchCout + "次,超过" + noSignalCount + "次没有收到星,退出GPS定位");\r
- runtime.getLocationInstance().setLocationStat(ICLocation.LOCATION_STAT.LOCATION_GPS_TIEMOUT);\r
- stop(MSG_WHAT_GPS_NOSTAR);\r
- }\r
- }\r
- ICLogger.i(sb2.toString());\r
- if (Config.LOG_TOFILE)\r
- FileOutputUtil.fileOutput(this.runtime.getCacheDir(), "GPS", sb2.toString());\r
-\r
- }\r
} else if (nmeastr.startsWith("$GPGGA,")) {\r
\r
// GPGGA编辑\r