Null UnitId

Bug #226300 reported by Victor Scaletchi
2
Affects Status Importance Assigned to Milestone
garmin-sync
New
Undecided
Unassigned

Bug Description

readSessionStartedPacket in garmin.py doesn't return the unit_id value. As a result, the import on both TrainingPeaks and MotionBase is failing, the UnitId tag in the .tcx file is populated with "None" (a numeric value is expected here).
The fix (see bellow) was to add the return line.

    def readSessionStartedPacket(self):
        """Read from the USB bus until session started packet is received."""
        session_started = False
        unit_id_data = None
        while not session_started:
            packet = self.readUSBPacket(16)
            if len(packet) != 16:
                continue
            # We have something that could be the right packet.
            packet_id, unit_id_data = self.unpack(packet)
            if packet_id in [self.Pid_Session_Started,
                             self.Pid_Session_Started2]:
                session_started = True
        [self.unit_id] = struct.unpack("<L", unit_id_data)
        return self.unit_id

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.