BaseType

public enum BaseType : UInt8
extension BaseType: FitFieldCodeable

FIT Base Type

  • Enum

    Declaration

    Swift

    case enumtype = 0
  • sInt8

    Declaration

    Swift

    case sint8 = 1
  • UInt8

    Declaration

    Swift

    case uint8 = 2
  • SInt16

    Declaration

    Swift

    case sint16 = 3
  • UInt16

    Declaration

    Swift

    case uint16 = 4
  • SInt32

    Declaration

    Swift

    case sint32 = 5
  • UInt32

    Declaration

    Swift

    case uint32 = 6
  • string

    Null terminated string UTF-8

    Declaration

    Swift

    case string = 7
  • Float32

    Declaration

    Swift

    case float32 = 8
  • Float64

    Declaration

    Swift

    case float64 = 9
  • UInt8 zero

    Declaration

    Swift

    case uint8z = 10
  • UInt16 zero

    Declaration

    Swift

    case uint16z = 11
  • UInt32 zero

    Declaration

    Swift

    case uint32z = 12
  • Byte

    Declaration

    Swift

    case byte = 13
  • SInt64

    Declaration

    Swift

    case sint64 = 14
  • UInt64

    Declaration

    Swift

    case uint64 = 15
  • UInt64 zero

    Declaration

    Swift

    case uint64z = 16
  • Unknown

    Declaration

    Swift

    case unknown = 255
  • Encode Into Data

    Declaration

    Swift

    public func encode(base: BaseTypeData) -> Data?

    Parameters

    base

    BaseTypeData

  • Decode FIT Field

    Declaration

    Swift

    public static func decode<T>(type: T.Type, data: Data, base: BaseTypeData, arch: Endian) -> T?

    Parameters

    type

    Type of Field

    data

    Data to Decode

    base

    BaseTypeData

    arch

    Endian

    Return Value

    Decoded Value