Commits

Adam Bird committed 817cffa

Support reading list of FIT activities on device

  • Participants
  • Parent commits 9def5f7

Comments (0)

Files changed (1)

     Workouts: ['FitnessWorkouts', 'FitnessData'],
     Courses: ['FitnessCourses', 'FitnessData'],
     Goals: ['FitnessActivityGoals', 'FitnessData'],
-    Profile: ['FitnessUserProfile', 'FitnessData']
+    Profile: ['FitnessUserProfile', 'FitnessData'],
+    FITActivities: ['FIT_TYPE_4', 'FITDirectory']
   };
   
   // == Communicator ==
             // If we were passed in a callback function, we call it with either the data
             // we got from the plugin, or true (on a write).
             if (callback) {
-              callback(plugin.TcdXml || true);
+              // check both buffers (latter is used by FIT devices)
+              callback(plugin.TcdXml || plugin.DirectoryListingXml || true);
             }
             break;
           case Garmin.STATUS.waiting:
       this['read' + type] = readHandler(data[0], data[1], type);
       this['write' + type] = writeHandler(data[0], data[1], type);
     }, this);
-        
+
     // See if the plugin is actually installed.
     if (!plugin.Unlock) {
       this.installed = false;