         
         public var targetTilt: Double? {
             if eventCode == .targetTiltChanged && bytes.count >= 2 {
-                return Double(UInt16(bytes[1]) << 8 | UInt16(bytes[0])) / 100
+                return decodeTilt(lsb: bytes[0], msb: bytes[1])
             }
             return nil
         }

//

import Foundation

open class WahooAdvancedFitnessMachineSerializer {
    public enum OpCode: UInt8 {

    }
    
    public static func setTargetTilt(grade: Double) -> CommandPacket {
        let targetTilt = UInt16(bitPattern: Int16(grade * 100))
        let data = [
            UInt8(targetTilt & 0xFF),
            UInt8(targetTilt >> 8 & 0xFF)
