Rest Distance & Elapsed Time

Post questions and issues with Concept2 PM3 SDK
Post Reply
Piboo
Paddler
Posts: 12
Joined: April 7th, 2015, 6:33 pm

Rest Distance & Elapsed Time

Post by Piboo » September 5th, 2015, 4:53 am

Hi,

I have a problem with getting the value of Rest Distance & Elapsed Time in SWIFT (iOS).

I get the values from CBUUID(string: "CE060032-43E5-11E4-916C-0800200C9A66") but the values assigned to Rest Distance & Time are empties.

Where am I doing wrong please ?

This is how I get my values:

class func getRestDistance(value:NSData) -> Double {
let dataFromRowing = dataToUnsignedBytes8(value)
let restDistance:Double = Double(dataFromRowing[12]) * 256 + Double(dataFromRowing[11])

return restDistance
}

class func getRestTime(value:NSData) -> Double {
let dataFromRowing = dataToUnsignedBytes8(value)
let restTime:Double = (Double(dataFromRowing[15]) * 65536 + Double(dataFromRowing[14]) * 256 + Double(dataFromRowing[13])) / 100 // in seconds
return restTime
}


Thanks & Regards

Post Reply