     
     func resumeFromOffset(anOffset : UInt32) {
         self.bytesSent = Int(anOffset)
-        print("Last offset = \(self.bytesSent)")
         startTime = CFAbsoluteTimeGetCurrent()
         lastTime = startTime
     }

            let packet = firmware.data.subdataWithRange(NSRange(location: bytesSent, length: packetLength))
            peripheral.writeValue(packet, forCharacteristic: characteristic, type: CBCharacteristicWriteType.WithoutResponse)


            print("\(totalPackets): \(packetsSent) + \(packetsLeft) = \(packetsSent + packetsLeft)")
            print("\(bytesTotal): \(self.bytesSent) + \(bytesLeft) = \(self.bytesSent + bytesLeft)")

            bytesSent += packetLength
            packetsToSendNow -= 1


        var bytesToSend = initPacketData.length
        
        repeat {

            let packetLength = min(bytesToSend, PacketSize)
            let packet = initPacketData.subdataWithRange(NSRange(location: offset, length: packetLength))
            
