ZTSport

public final class ZTSport

ZTSport provides methods to ork with ZTSport insoles & shoes

Private methods

  • Get actual state of connected device

    Declaration

    Swift

    public func readGeneralState(completion: @escaping ((ZTDeviceActualState?) -> Void))

    Parameters

    completion

    ZTDeviceActualState?

  • Algorithm selection to use with activity

    Declaration

    Swift

    public func setMode(mode: ZTActivityMode, completion: @escaping ZTBaseResult)

    Parameters

    mode

    ZTActivityMode - algo type

Data related methods

  • Retrieve routing data for activity

    Declaration

    Swift

    public func getMapRouteData(activityId: String, completion: @escaping (([String : Any]?, Data?, Error?) -> Void))

    Parameters

    id

    Activity id

    completion

    ( array of ZTSportActivitySummary, Error)

  • Retrieve route segment details

    Declaration

    Swift

    public func getSegmentDetails(activityId: String, segmentId: String, completion: @escaping ((ZTActivityRunAnalysis?, Error?) -> Void))

    Parameters

    activityId

    activity id

    segmentId

    segment id

    completion

    ( ZTSportSegmentDetails, Error)

  • Retrieve route segment details

    Declaration

    Swift

    public func getSegmentDetails(activityId: String, segmentId: String, completion: @escaping (([String : Any]?, Data?, Error?) -> Void))

    Parameters

    activityId

    activity id

    segmentId

    segment id

    completion

    ( [String: Any]], Error)

  • Retrieve activity data for time range

    Declaration

    Swift

    public func getActivitySummary(id: String,
                                   fields: [ZTSportActivity.Field] = [],
                                   include: [String]? = nil,
                                   completion: @escaping (ZTResultObject<ZTSportActivitySummary>))

    Parameters

    id

    activity ID

    fields

    Array of ZTSportActivity.Field to include in response

    include

    addtitional information to include, e.g. “supplimentalData.geoThumbnail” , “attributes.goalType”, “attributes.goalValue”

    completion
  • Retrieve activity summary list

    Declaration

    Swift

    public func getActivitiesSummary(code: String?,
                                     offset: Int,
                                     limit: Int,
                                     fields: [ZTSportActivity.Field] = [],
                                     include: [String]? = nil,
                                     whereOptions: [String: Any]? = nil,
                                     duration: [String: Any]? = nil,
                                     start: Date? = nil,
                                     end: Date? = nil,
                                     completion: @escaping (ZTResultArray<ZTSportActivitySummary>))

    Parameters

    code

    shoe code Optional

    offset

    starting index of the activities

    limit

    number of objects to return

    fields

    Array of ZTSportActivity.Field to include in response

    include

    addtitional information to include, e.g. “supplimentalData.geoThumbnail” , “attributes.goalType”, “attributes.goalValue”

    completion

    callback with array of activities

  • Retrieve activity data for time range

    Declaration

    Swift

    public func getActivitySummary(id: String,
                                   fields: [String] = [],
                                   include: [String]? = nil,
                                   whereOptions: [String: Any]? = nil,
                                   duration: [String: Any]? = nil,
                                   start: Date? = nil,
                                   end: Date? = nil,
                                   completion: @escaping (ZTResultObject<ZTSportActivitySummary>))

    Parameters

    id

    activity ID

    fields

    Array of ZTSportActivity.Field to include in response

    include

    addtitional information to include, e.g. “supplimentalData.geoThumbnail” , “attributes.goalType”, “attributes.goalValue”

    completion
  • Retrieve activity summary list

    Declaration

    Swift

    public func getActivitiesSummary(code: String?,
                                     offset: Int,
                                     limit: Int,
                                     fields: [String],
                                     include: [String]? = nil,
                                     whereOptions: [String: Any]? = nil,
                                     duration: [String: Any]? = nil,
                                     start: Date? = nil,
                                     end: Date? = nil,
                                     completion: @escaping (ZTResultArray<ZTSportActivitySummary>))

    Parameters

    code

    shoe code Optional

    offset

    starting index of the activities

    limit

    number of objects to return

    fields

    Array of ZTSportActivity.Field to include in response

    include

    addtitional information to include, e.g. “supplimentalData.geoThumbnail” , “attributes.goalType”, “attributes.goalValue”

    completion

    callback with array of activities

  • Add activity data for current activity

    Declaration

    Swift

    public func addActivityData(timestamp: TimeInterval, data: [Any], completion: @escaping (ZTBaseResult))

    Parameters

    timestamp

    TimeInterval current timestamp

    data

    [Any] array of activity data

    completion

    The closure called when the Data is saved.

  • Retrieve timeline rollup

    Declaration

    Swift

    public func getActivityTimelineRollup(start: Date,
                                          end: Date,
                                          completion: @escaping (ZTResultObject<ZTTimelineRollup>))

    Parameters

    start

    to include activities from Date

    end

    to include activites up to Date

    completion

    (ZTSportTimelineRollup?,Error?)

  • Retrieve run analysis for activity

    Declaration

    Swift

    public func getActivityRunAnalysis(activityId: String, completion: @escaping (ZTResultObject<ZTActivityRunAnalysis>))

    Parameters

    activityId

    Activity id

    completion

    callback with array of activities

  • Retrieve activity analysis

    Declaration

    Swift

    public func getPeriodActivityAnalysis(code: String?,
                                     period: ZTPeriod,
                                     completion: @escaping (ZTResultObject<ZTActivityAnalysis>))

    Parameters

    code

    shoe code

    period

    to include activities from Date

    completion

    callback with array of activities

  • Retrieve sqi optimisation to get range of the SQI and its optimized value for stepLength and cadence

    Declaration

    Swift

    public func getAnalysisSqiOptimisation(activityId: String, completion: @escaping (([String : Any]?, Error?) -> Void))

    Parameters

    activityId

    Activity id

    completion

    callback with optional dictionary [String: Any]? and Error

  • Start activity. Result of activity start command can be observed in completion handler.

    Declaration

    Swift

    public func startActivity(attributes: [String: Any],
                              userParameters: ZTUserDataParameters? = nil,
                              enableRawData: Bool = false,
                              samplingMode: ZTSamplingMode? = nil,
                              timeout: Double = 15,
                              completion: ZTActivityResult?)

    Parameters

    attributes

    attributes for activity. It may include goal and goalValue or any additional attributes for this activity

    userParameters

    ZTUserDataParameters? optional with height, weight and shoe size

    enableRawData

    enable raw data mode to write raw data

    enableFastSampling

    enable 208Hz mode (default is 104Hz)

    timeout

    timeout to start activity

    completion

    (activityId?, ZTError?)

  • Stop activity

    Declaration

    Swift

    public func stopActivity(timeout: Double = 30, completion: ZTActivityResult?)

    Parameters

    timeout

    timeout to stop activity in seconds

    completion

    (activityId?, Error?)

  • Goals enum

    Declaration

    Swift

    enum ActivityGoal : String, Codable