[Pkg-running-devel] [antpm] 37/41: antfs: hint which files would be downloaded based on date

Kristof Ralovich ralovich-guest at moszumanska.debian.org
Tue Feb 23 21:46:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

ralovich-guest pushed a commit to branch upstream
in repository antpm.

commit 5447c149a0839a1d569b49517fcb7b324301166e
Author: RALOVICH, Kristof <tade60 at freemail.hu>
Date:   Tue Feb 23 22:08:31 2016 +0100

    antfs: hint which files would be downloaded based on date
---
 src/AntFr310XT.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/src/AntFr310XT.cpp b/src/AntFr310XT.cpp
index dc62b99..654f5ab 100644
--- a/src/AntFr310XT.cpp
+++ b/src/AntFr310XT.cpp
@@ -523,6 +523,56 @@ AntFr310XT::handleEvents()
 
     // channel status <>
     //CHECK_RETURN_FALSE_LOG_OK(ANT_RequestMessage(chan, MESG_CHANNEL_STATUS_ID));
+
+    for(size_t i=0; i<zfc.waypointsFiles.size(); i++)
+    {
+      ushort fileIdx = zfc.waypointsFiles[i];
+      time_t t       = GarminConvert::gOffsetTime(zfc.getFitFileTime(fileIdx));
+      if(t < m_ds->LastTransferredTime)
+      {
+        logger() << "Skipping waypoints file 0x" << toString<ushort>(fileIdx,4,'0')
+                 << "@" << DeviceSettings::time2str(t) << " older than "
+                 << DeviceSettings::time2str(m_ds->LastTransferredTime) <<  "\n";
+        continue;
+      }
+      logger() << "Would transfer waypoints file 0x" << toString<ushort>(fileIdx,4,'0')
+               << "@" << DeviceSettings::time2str(t) << " newer than "
+               << DeviceSettings::time2str(m_ds->LastTransferredTime) <<  "\n";
+    }
+
+    for (size_t i=0; i<zfc.activityFiles.size(); i++)
+    {
+      ushort fileIdx = zfc.activityFiles[i];
+      time_t t       = GarminConvert::gOffsetTime(zfc.getFitFileTime(fileIdx));
+      if(t < m_ds->LastTransferredTime)
+      {
+        logger() << "Skipping activity file 0x" << toString<ushort>(fileIdx,4,'0')
+                 << "@" << DeviceSettings::time2str(t) << " older than "
+                 << DeviceSettings::time2str(m_ds->LastTransferredTime) <<  "\n";
+        continue;
+      }
+      logger() << "Would transfer activity file 0x" << toString<ushort>(fileIdx,4,'0')
+               << "@" << DeviceSettings::time2str(t) << " newer than "
+               << DeviceSettings::time2str(m_ds->LastTransferredTime) <<  "\n";
+    }
+
+    for (size_t i=0; i<zfc.courseFiles.size(); i++)
+    {
+      ushort fileIdx = zfc.courseFiles[i];
+      time_t t       = GarminConvert::gOffsetTime(zfc.getFitFileTime(fileIdx));
+      if(t < m_ds->LastTransferredTime)
+      {
+        logger() << "Skipping course file 0x" << toString<ushort>(fileIdx,4,'0')
+                 << "@" << DeviceSettings::time2str(t) << " older than "
+                 << DeviceSettings::time2str(m_ds->LastTransferredTime) <<  "\n";
+        continue;
+      }
+      logger() << "Would transfer course file 0x" << toString<ushort>(fileIdx,4,'0')
+               << "@" << DeviceSettings::time2str(t) << " older than "
+               << DeviceSettings::time2str(m_ds->LastTransferredTime) <<  "\n";
+    }
+
+
     if(mode==MD_DIRECTORY_LISTING)
       changeStateSafe(ST_ANTFS_LAST);
     else
@@ -536,6 +586,7 @@ AntFr310XT::handleEvents()
     // dl course files
     // NOTE: seems like, if a file was downloaded, it's date in the directory file changes to the date of transfer
 
+
     uint fileCnt=0;
     for(size_t i=0; i<zfc.waypointsFiles.size() && fileCnt<m_ds->MaxFileDownloads; i++)
     {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/antpm.git



More information about the Pkg-running-devel mailing list