resUpdateGoGPSUpBodyListWithHeaderPeakOutdoorNew function

void resUpdateGoGPSUpBodyListWithHeaderPeakOutdoorNew(
  1. Pointer<PERIPHERAL_GOGPS_HEADER_V2> pGogpsHeader,
  2. Pointer<PERIPHERAL_GOGPS_BODY_PEAK_OUTDOORNEW> pGoGPSBody,
  3. int size,
  4. int bHeaderUpdated,
  5. int bAccuracyTest,
)

Implementation

void  resUpdateGoGPSUpBodyListWithHeaderPeakOutdoorNew(
    Pointer<PERIPHERAL_GOGPS_HEADER_V2> pGogpsHeader,
    Pointer<PERIPHERAL_GOGPS_BODY_PEAK_OUTDOORNEW> pGoGPSBody,
    int size,
    int bHeaderUpdated,
    int bAccuracyTest) {
  slog('resUpdateGoGPSUpBodyListWithHeaderPeakOutdoorNew entered, size: $size');

    //header
  final header =   CLCmdGogpsHeaderV2.from(pGogpsHeader.ref);
  updateGoGpsHeader(header,bHeaderUpdated);

  // if (GoGpsParam.mdGogpsLastLat.abs() < 0.01 && GoGpsParam.mdGogpsLastLng.abs() < 0.01) {
  //   return ;
  // }

  if (size > 0) {
          // slog('resUpdateGoGPSUpBodyListWithHeaderPeakOutdoorNew size:$size');

    for (int i = 0; i < size; i++) {
      final bodyItem = CLCmdGogpsBodyPeakNew.from(pGoGPSBody[i]) ;
      // int timestamp = bodyItem.timestamp;
      // int secIndex = bodyItem.secIndex;
      // int lat = bodyItem.lat;
      // int lon = bodyItem.lon;
      // slog('timestamp:$timestamp, secIndex:$secIndex, lat:$lat, lon:$lon');
      var translateItem = updateGoGPSUpBodyEntryNewProtocol(header,bodyItem);
      //接口回调
      if(translateItem!=null){
        int  cal = translateItem.kcal;
        slog('resUpdateGoGPSUpBodyListWithHeaderPeakOutdoorNew pgu.cal:$cal');
      }
      (translateItem!=null)?CLCmdGoGpsUpStreamData.subject.add(translateItem):{};
    }
  }
}